API Reference
Use your OpenLimits API key with Anthropic-compatible and OpenAI-compatible request shapes. Claude traffic uses Messages, GPT traffic uses Responses or Chat Completions, and model lists use the OpenAI-compatible format.
Quick Start
Anthropic-compatible clients use the root base URL:
export ANTHROPIC_BASE_URL=https://openlimits.app
export ANTHROPIC_API_KEY=your-key-hereOpenAI-compatible clients use the /v1 base URL:
export OPENAI_BASE_URL=https://openlimits.app/v1
export OPENAI_API_KEY=your-key-hereAuthentication
All API requests require one of these headers:
x-api-key: YOUR_KEYfor Anthropic-style clientsAuthorization: Bearer YOUR_KEYfor OpenAI-style clients
curl https://openlimits.app/v1/messages \
-H "x-api-key: YOUR_KEY" \
-H "content-type: application/json" \
-d '{"model":"anthropic/claude-opus-4.8","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'POST /v1/messages
Anthropic-compatible endpoint for Claude, Fable, and open model-group requests.
POST /v1/messages
Content-Type: application/json
x-api-key: YOUR_KEY
{
"model": "anthropic/claude-opus-4.8",
"max_tokens": 1024,
"messages": [
{ "role": "user", "content": "Explain recursion in one sentence." }
],
"stream": false
}{
"id": "msg_...",
"type": "message",
"role": "assistant",
"content": [
{ "type": "text", "text": "Recursion is when a function calls itself..." }
],
"model": "anthropic/claude-opus-4.8",
"usage": {
"input_tokens": 14,
"output_tokens": 32
}
}Set stream to true for Anthropic-compatible SSE streaming. Effort can be supplied through output_config.effort where supported.
POST /v1/responses
OpenAI Responses-compatible endpoint for GPT and Fable models. This is the preferred endpoint for Codex CLI/Desktop.
POST /v1/responses
Content-Type: application/json
Authorization: Bearer YOUR_KEY
{
"model": "openai/gpt-5.6-sol",
"instructions": "You are a helpful assistant.",
"input": "Explain recursion in one sentence.",
"stream": true,
"store": false
}streamis forced totruestoreis forced tofalse- If
instructionsis omitted, a default instruction is supplied
POST /v1/chat/completions
OpenAI-compatible endpoint for OpenAI SDK clients. Claude requests are translated to Anthropic Messages; OpenAI-family requests route through OpenAI providers.
POST /v1/chat/completions
Content-Type: application/json
Authorization: Bearer YOUR_KEY
{
"model": "anthropic/claude-opus-4.8",
"messages": [
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello" }
],
"max_tokens": 1024,
"stream": false
}| Model | Routes to |
|---|---|
anthropic/claude-* | Anthropic-compatible provider pool |
anthropic/fable-5 | OpenAI provider pool as upstream gpt-5.5 |
openai/gpt-5.6-* | OpenAI provider pool as the matching upstream GPT-5.6 model |
minimax/minimax-m3 | MiniMax provider pool |
GET /v1/models
Returns available models in OpenAI-compatible list format. See Models for the complete table.
GET /v1/models
x-api-key: YOUR_KEYErrors
Anthropic-style endpoints return Anthropic-style errors; OpenAI-style endpoints return OpenAI-style errors where appropriate.
| Status | Type | Meaning |
|---|---|---|
400 | invalid_request_error | Invalid model or malformed request |
401 | authentication_error | Missing or invalid API key |
403 | permission_error | Spend limit exceeded, token expired, or model not allowed |
429 | rate_limit_error | All matching providers are temporarily at capacity |