Docs
Call every frontier model through one API
Cufora AI speaks both the OpenAI and the Anthropic API. Point the OpenAI SDK, the Anthropic SDK or Claude Code at our base URL, use your key and pick Claude, GPT or Gemini per request.
Getting started
Introduction
Cufora AI is an API gateway for Claude, GPT and Gemini. It speaks two formats, the OpenAI Chat Completions API and the Anthropic Messages API. You send a request to one of the two endpoints, and we route it to the provider of the model you name. You get one key, one bill and usage per key and model.
Both formats use the same key, the same plan allowance and the same model IDs. Code written for the OpenAI SDK, the Anthropic SDK or Claude Code works after you change the base URL and the key.
| Format | Base URL | Endpoint | Works with |
|---|---|---|---|
| OpenAI | https://www.cufora.net/api/v1 | POST /chat/completions | OpenAI SDKs, VS Code BYOK, GitHub Copilot chat |
| Anthropic | https://www.cufora.net/api | POST /v1/messages | Anthropic SDKs and Claude Code |
Getting started
Quickstart
1. Create an account and a key
Sign up, pick a plan and open Dashboard → API keys. Create a key and copy it. The full key is shown only once.
2. Store the key
Put the key in an environment variable on your server. Never commit it to Git.
CUFORA_API_KEY=your_api_key3. Install the OpenAI SDK
npm install openai4. Send your first request
curl https://www.cufora.net/api/v1/chat/completions \
-H "Authorization: Bearer $CUFORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"messages": [{ "role": "user", "content": "Hello!" }]
}'The response has the same shape as an OpenAI response:
{
"id": "chatcmpl-8f3a2c",
"object": "chat.completion",
"model": "claude-sonnet-5",
"choices": [
{
"index": 0,
"message": { "role": "assistant", "content": "Hello! How can I help?" },
"finish_reason": "stop"
}
],
"usage": { "prompt_tokens": 9, "completion_tokens": 8, "total_tokens": 17 }
}Getting started
Anthropic SDK & Claude Code
Cufora AI also speaks the Anthropic Messages API. Use the base URL without /v1, because the Anthropic SDK and Claude Code add /v1/messages themselves.
https://www.cufora.net/apiInstall the Anthropic SDK
npm install @anthropic-ai/sdkSend a message
curl https://www.cufora.net/api/v1/messages \
-H "x-api-key: $CUFORA_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"messages": [{ "role": "user", "content": "Hello!" }]
}'The response has the same shape as an Anthropic response:
{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "claude-sonnet-5",
"content": [{ "type": "text", "text": "Hello! How can I help?" }],
"stop_reason": "end_turn",
"usage": { "input_tokens": 9, "output_tokens": 8 }
}Claude Code
Point Claude Code at Cufora AI with environment variables, then start it as usual. ANTHROPIC_MODEL picks the model; any Claude model ID from the list below works.
export ANTHROPIC_BASE_URL=https://www.cufora.net/api
export ANTHROPIC_AUTH_TOKEN=your_api_key
export ANTHROPIC_MODEL=claude-opus-5-5
claude- The Messages endpoint accepts your key in the x-api-key header or as Authorization: Bearer.
- Streaming, tool use and system prompts work as in the Anthropic API.
- Tokens from both formats count against the same plan allowance.
Getting started
GitHub Copilot & VS Code (BYOK)
Use Cufora as a Custom Endpoint in VS Code chat (Bring Your Own Key). This works with GitHub Copilot chat when your organization allows language model BYOK. Inline code suggestions still use GitHub; only the chat agent calls your Cufora key.
- You need a paid Cufora plan and an API key (Dashboard → API keys).
- Base URL for chat: https://www.cufora.net/api/v1
- API type: Chat Completions. Authentication: Authorization: Bearer your_api_key.
- Enable toolCalling on models that support tools (Claude Sonnet, GPT 5.5, Codex, etc.).
Add the endpoint in VS Code
- Open Chat → language model picker → Manage Language Models (gear), or run Chat: Manage Language Models.
- Add Models → Custom Endpoint.
- Group name: Cufora. API type: Chat Completions.
- Paste the JSON below into chatLanguageModels.json (or download the template).
- When prompted, enter your Cufora API key. It is stored in VS Code Secret Storage, not in the file.
[
{
"name": "Cufora",
"vendor": "customendpoint",
"apiKey": "${input:cuforaApiKey}",
"apiType": "chat-completions",
"url": "https://www.cufora.net/api/v1/models",
"models": [
{
"id": "composer-2.5",
"name": "Composer 2.5 (Cufora)",
"url": "https://www.cufora.net/api/v1/chat/completions",
"apiType": "chat-completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 1000000,
"maxOutputTokens": 500000
},
{
"id": "claude-sonnet-5",
"name": "Claude Sonnet 5 (Cufora)",
"url": "https://www.cufora.net/api/v1/chat/completions",
"apiType": "chat-completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 400000,
"maxOutputTokens": 200000
},
{
"id": "claude-sonnet-5-5",
"name": "Claude Sonnet 5.5 (Cufora)",
"url": "https://www.cufora.net/api/v1/chat/completions",
"apiType": "chat-completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 400000,
"maxOutputTokens": 200000
},
{
"id": "gpt-5.5",
"name": "GPT 5.5 (Cufora)",
"url": "https://www.cufora.net/api/v1/chat/completions",
"apiType": "chat-completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 400000,
"maxOutputTokens": 200000
},
{
"id": "gpt-5.3-codex",
"name": "GPT 5.3 Codex (Cufora)",
"url": "https://www.cufora.net/api/v1/chat/completions",
"apiType": "chat-completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 400000,
"maxOutputTokens": 200000
}
]
}
]Pre-filled template (no key): https://www.cufora.net/api/v1/copilot/language-models
For each model, url must be the full chat route, e.g. https://www.cufora.net/api/v1/chat/completions. Optional provider url points at https://www.cufora.net/api/v1/models so VS Code can discover model IDs from your account.
Getting started
Authentication
Send your key as a bearer token in the Authorization header of every request. In the Anthropic format you can also send it in the x-api-key header.
OpenAI-compatible base URL: https://www.cufora.net/api/v1. Anthropic base URL: https://www.cufora.net/api (the SDK adds /v1/messages).
- Use keys only on your server. Never ship them in a browser or mobile app.
- Create one key per project or environment, so you can see usage separately and revoke one key without touching the others.
- From the Plus plan upwards, each key can have its own spend limit.
- If a key leaks, revoke it in the dashboard and create a new one.
Authorization: Bearer $CUFORA_API_KEYAPI reference
Chat completions
POST /chat/completions creates a model response for a conversation.
| Parameter | Type | Description |
|---|---|---|
modelRequired | string | Model ID, for example claude-sonnet-5. See Models below. |
messagesRequired | array | The conversation so far. Each item has a role (system, user, assistant or tool) and content. |
stream | boolean | Send the answer as server-sent events while it is generated. Default false. |
max_tokens | integer | Upper limit for the number of tokens in the answer. |
temperature | number | Sampling temperature between 0 and 2. Lower values give more focused answers. |
tools | array | Functions the model may call, in the OpenAI tools format. |
response_format | object | Set {"type": "json_object"} to ask for JSON output. |
Not every model supports every parameter. Unsupported parameters return a 400 error with the type invalid_request.
API reference
Streaming
Set stream to true to receive the answer while it is generated. The response is a stream of server-sent events. Each event carries the next piece of text, and the stream ends with data: [DONE].
const stream = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Write a haiku about APIs" }],
stream: true,
})
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "")
}API reference
Models
GET /models returns every model your key can use. Pass the ID as the model parameter.
curl https://www.cufora.net/api/v1/models \
-H "Authorization: Bearer $CUFORA_API_KEY"| Model | ID | Provider | Context |
|---|---|---|---|
| Claude Opus 5 Thinking | claude-opus-5-thinking | Anthropic | 1M |
| Claude Fable 5 Thinking | claude-fable-5-thinking | Anthropic | 400K |
| Claude Sonnet 5 Thinking | claude-sonnet-5-thinking | Anthropic | 400K |
| Claude Opus 5.5 | claude-opus-5-5 | Anthropic | 1M |
| Claude Opus 5 | claude-opus-5 | Anthropic | 1M |
| Claude Opus 4.8 | claude-opus-4-8 | Anthropic | 1M |
| Claude Opus 4.8 Thinking | claude-opus-4-8-thinking | Anthropic | 1M |
| Claude Fable 5.2 | claude-fable-5-2 | Anthropic | 400K |
| Claude Fable 5.1 | claude-fable-5-1 | Anthropic | 400K |
| Claude Fable 5.1 Thinking | claude-fable-5-1-thinking | Anthropic | 400K |
| Claude Fable 5 | claude-fable-5 | Anthropic | 400K |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | Anthropic | 400K |
| Claude Sonnet 5 | claude-sonnet-5 | Anthropic | 400K |
| Claude 4.6 Sonnet | claude-sonnet-4-6 | Anthropic | 400K |
| Claude 4.6 Sonnet Medium Thinking | claude-sonnet-4-6-medium-thinking | Anthropic | 400K |
| Claude Opus 4.7 | claude-opus-4-7 | Anthropic | 1M |
| Claude Opus 4.7 Thinking | claude-opus-4-7-thinking | Anthropic | 1M |
| Claude Opus 4.6 | claude-opus-4-6 | Anthropic | 1M |
| Claude Opus 4.6 High Thinking | claude-opus-4-6-high-thinking | Anthropic | 1M |
| Claude Opus 4.6 Max Thinking | claude-opus-4-6-max-thinking | Anthropic | 1M |
| Claude Opus 4.5 | claude-opus-4-5 | Anthropic | 1M |
| Claude Opus 4.5 High Thinking | claude-opus-4-5-high-thinking | Anthropic | 1M |
| Claude 4.5 Sonnet | claude-sonnet-4-5 | Anthropic | 400K |
| Claude 4.5 Sonnet Thinking | claude-sonnet-4-5-thinking | Anthropic | 400K |
| Claude Haiku 5.5 | claude-haiku-5-5 | Anthropic | 1M |
| Claude Haiku 5.5 Thinking | claude-haiku-5-5-thinking | Anthropic | 1M |
| GPT 5.6 Solean | gpt-5.6-solean | OpenAI | 400K |
| GPT 5.6 Luna | gpt-5.6-luna | OpenAI | 400K |
| GPT 5.6 Terra | gpt-5.6-terra | OpenAI | 400K |
| GPT 5.5 | gpt-5.5 | OpenAI | 400K |
| GPT 5.5 Extra | gpt-5.5-extra | OpenAI | 400K |
| GPT 5.4 | gpt-5.4 | OpenAI | 400K |
| GPT 5.4 Mini | gpt-5.4-mini | OpenAI | 1M |
| GPT 5.4 Nano | gpt-5.4-nano | OpenAI | 1M |
| GPT 5.3 Codex | gpt-5.3-codex | OpenAI | 400K |
| GPT 5.2 | gpt-5.2 | OpenAI | 400K |
| GPT 5.1 | gpt-5.1 | OpenAI | 400K |
| GPT 5 Mini | gpt-5-mini | OpenAI | 1M |
| Gemini 4 Carbon | gemini-4-carbon | 400K | |
| Gemini 4 Argon | gemini-4-argon | 400K | |
| Gemini 3.8 Flash | gemini-3.8-flash | 1M | |
| Gemini 3.1 Pro | gemini-3.1-pro | 400K | |
| Gemini 3 Flash | gemini-3-flash | 1M | |
| Gemini 3.5 Flash | gemini-3.5-flash | 1M | |
| Grok 4.7 | grok-4.7 | xAI | 400K |
| Grok 4.6 | grok-4.6 | xAI | 400K |
| Grok 4.5 | grok-4.5 | xAI | 400K |
| DeepSeek V4.1 Flash | deepseek-v41-flash-1017 | DeepSeek | 1M |
| Composer 2.5 | composer-2.5 | Cufora | 1M |
API reference
Errors
Errors come back with an HTTP status code and a JSON body that names the error type.
{
"error": {
"type": "rate_limit_exceeded",
"message": "Rate limit of 60 requests per minute reached. Retry in 12 seconds.",
"code": 429
}
}| Status | Type | Meaning |
|---|---|---|
| 400 | invalid_request | The body is malformed or a parameter is not supported by the model. |
| 401 | invalid_api_key | The key is missing, wrong or revoked. |
| 402 | token_limit_reached | The token allowance of your plan for this period is used up. |
| 404 | model_not_found | The model ID does not exist. Call GET /models for the list. |
| 429 | rate_limit_exceeded | Too many requests per minute for your plan. Wait and retry. |
| 502 | upstream_error | The model provider returned an error. Retry, or set a fallback model. |
Retry 429 and 502 errors with exponential backoff, for example after 1, 2 and 4 seconds.
Account
Plans & limits
Each plan includes a token allowance per billing period and a request limit per minute. Weekly plans include a quarter of the monthly allowance.
| Plan | Tokens / month | Tokens / week | Requests / min |
|---|---|---|---|
| Starter | 250M | 62.5M | 60 |
| Plus | 2B | 500M | 300 |
| Pro | 10B | 2.5B | 1,000 |
| Max | 50B | 12.5B | 5,000 |
The allowance resets at the start of each period. Unused tokens do not carry over. See pricing.
Account
Usage & billing
Every response contains a usage object with prompt_tokens, completion_tokens and total_tokens. Input and output tokens both count against your allowance.
Dashboard → Usage shows tokens, cost and latency per key and per model. When the allowance is used up, requests return a 402 error until the next period starts. You can upgrade or top up credits in Billing at any time.