API Reference

Base URLs, authentication, endpoints, request/response schemas, and error codes.

Capped AI's API is OpenAI-compatible. Any SDK or client that works with OpenAI's API works with Capped AI by changing the base URL and API key.

Base URL

Your environment has a dedicated subdomain:

https://api.{your-account}.capped.ai/v1

Replace {your-account} with the account slug provided at deployment. The exact base URL is available in your Capped AI dashboard and in AWS Secrets Manager at lomao/api-base-url.

Authentication

All requests require a bearer token in the Authorization header:

Authorization: Bearer lom_live_...

API keys are issued per application and stored in AWS Secrets Manager in your account. Rotate them any time from the Capped AI dashboard or via the Secrets Manager console.

Endpoints

Chat Completions

POST /v1/chat/completions

{
  "model": "claude-sonnet-4",
  "messages": [
    { "role": "system", "content": "You are a helpful assistant." },
    { "role": "user", "content": "What is the capital of France?" }
  ],
  "max_tokens": 512,
  "temperature": 0.7,
  "stream": false
}

Streaming Chat Completions

POST /v1/chat/completions

{
  "model": "claude-sonnet-4",
  "messages": [{ "role": "user", "content": "Write a haiku." }],
  "stream": true
}

// Response: SSE stream
data: {"id":"cmpl-...","choices":[{"delta":{"content":"An old silent pond"}}]}
data: {"id":"cmpl-...","choices":[{"delta":{"content":"..."}}]}
data: [DONE]

Embeddings

POST /v1/embeddings

{
  "model": "titan-embed-text-v2",
  "input": "The quick brown fox jumps over the lazy dog"
}

// Response
{
  "object": "list",
  "data": [{ "object": "embedding", "embedding": [...], "index": 0 }],
  "model": "titan-embed-text-v2",
  "usage": { "prompt_tokens": 10, "total_tokens": 10 }
}

List Models

GET /v1/models

// Response
{
  "object": "list",
  "data": [
    { "id": "claude-sonnet-4", "object": "model", "created": 1714521600 },
    { "id": "claude-haiku-3.5", "object": "model", "created": 1714521600 },
    { "id": "llama-3-70b", "object": "model", "created": 1714521600 }
  ]
}

Model Aliases

AliasMaps to (Bedrock model ID)
claude-sonnet-4anthropic.claude-sonnet-4-20250514-v1:0
claude-haiku-3.5anthropic.claude-haiku-3-5-20241022-v1:0
claude-sonnet-3.5anthropic.claude-3-5-sonnet-20241022-v2:0
llama-3-70bmeta.llama3-3-70b-instruct-v1:0
llama-3-405bmeta.llama3-1-405b-instruct-v1:0
mixtral-8x7bmistral.mixtral-8x7b-instruct-v0:1
mistral-largemistral.mistral-large-2402-v1:0
titan-embed-text-v2amazon.titan-embed-text-v2:0

Error Codes

HTTP statusCodeMeaning
401invalid_api_keyAPI key missing or invalid
429rate_limit_exceededUsage plan quota exhausted — check your plan limits
400invalid_modelModel alias not found in your environment
400context_length_exceededInput exceeds model's context window
503model_unavailableBedrock model temporarily unavailable — retry with exponential backoff
500internal_errorContact support@capped.ai with the request ID from the response header

Rate Limits

Rate limits are set per API key in API Gateway usage plans. Defaults vary by tier:

TierRequests/minTokens/min
Pilot60 RPM100K TPM
Standard300 RPM500K TPM
Pro1,000 RPM2M TPM
EnterpriseCustomCustom

Provisioned throughput units on Pro and Enterprise tiers provide guaranteed TPM above the on-demand baseline.