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/v1Replace {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
| Alias | Maps to (Bedrock model ID) |
|---|---|
| claude-sonnet-4 | anthropic.claude-sonnet-4-20250514-v1:0 |
| claude-haiku-3.5 | anthropic.claude-haiku-3-5-20241022-v1:0 |
| claude-sonnet-3.5 | anthropic.claude-3-5-sonnet-20241022-v2:0 |
| llama-3-70b | meta.llama3-3-70b-instruct-v1:0 |
| llama-3-405b | meta.llama3-1-405b-instruct-v1:0 |
| mixtral-8x7b | mistral.mixtral-8x7b-instruct-v0:1 |
| mistral-large | mistral.mistral-large-2402-v1:0 |
| titan-embed-text-v2 | amazon.titan-embed-text-v2:0 |
Error Codes
| HTTP status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | API key missing or invalid |
| 429 | rate_limit_exceeded | Usage plan quota exhausted — check your plan limits |
| 400 | invalid_model | Model alias not found in your environment |
| 400 | context_length_exceeded | Input exceeds model's context window |
| 503 | model_unavailable | Bedrock model temporarily unavailable — retry with exponential backoff |
| 500 | internal_error | Contact 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:
| Tier | Requests/min | Tokens/min |
|---|---|---|
| Pilot | 60 RPM | 100K TPM |
| Standard | 300 RPM | 500K TPM |
| Pro | 1,000 RPM | 2M TPM |
| Enterprise | Custom | Custom |
Provisioned throughput units on Pro and Enterprise tiers provide guaranteed TPM above the on-demand baseline.