Cufora AI

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.

FormatBase URLEndpointWorks with
OpenAIhttps://www.cufora.net/api/v1POST /chat/completionsOpenAI SDKs, VS Code BYOK, GitHub Copilot chat
Anthropichttps://www.cufora.net/apiPOST /v1/messagesAnthropic 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_key

3. Install the OpenAI SDK

npm install openai

4. 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/api

Install the Anthropic SDK

npm install @anthropic-ai/sdk

Send 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_KEY

API reference

Chat completions

POST /chat/completions creates a model response for a conversation.

ParameterTypeDescription
modelRequiredstringModel ID, for example claude-sonnet-5. See Models below.
messagesRequiredarrayThe conversation so far. Each item has a role (system, user, assistant or tool) and content.
streambooleanSend the answer as server-sent events while it is generated. Default false.
max_tokensintegerUpper limit for the number of tokens in the answer.
temperaturenumberSampling temperature between 0 and 2. Lower values give more focused answers.
toolsarrayFunctions the model may call, in the OpenAI tools format.
response_formatobjectSet {"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"
ModelIDProviderContext
Claude Opus 5 Thinkingclaude-opus-5-thinkingAnthropic1M
Claude Fable 5 Thinkingclaude-fable-5-thinkingAnthropic400K
Claude Sonnet 5 Thinkingclaude-sonnet-5-thinkingAnthropic400K
Claude Opus 5.5claude-opus-5-5Anthropic1M
Claude Opus 5claude-opus-5Anthropic1M
Claude Opus 4.8claude-opus-4-8Anthropic1M
Claude Opus 4.8 Thinkingclaude-opus-4-8-thinkingAnthropic1M
Claude Fable 5.2claude-fable-5-2Anthropic400K
Claude Fable 5.1claude-fable-5-1Anthropic400K
Claude Fable 5.1 Thinkingclaude-fable-5-1-thinkingAnthropic400K
Claude Fable 5claude-fable-5Anthropic400K
Claude Sonnet 5.5claude-sonnet-5-5Anthropic400K
Claude Sonnet 5claude-sonnet-5Anthropic400K
Claude 4.6 Sonnetclaude-sonnet-4-6Anthropic400K
Claude 4.6 Sonnet Medium Thinkingclaude-sonnet-4-6-medium-thinkingAnthropic400K
Claude Opus 4.7claude-opus-4-7Anthropic1M
Claude Opus 4.7 Thinkingclaude-opus-4-7-thinkingAnthropic1M
Claude Opus 4.6claude-opus-4-6Anthropic1M
Claude Opus 4.6 High Thinkingclaude-opus-4-6-high-thinkingAnthropic1M
Claude Opus 4.6 Max Thinkingclaude-opus-4-6-max-thinkingAnthropic1M
Claude Opus 4.5claude-opus-4-5Anthropic1M
Claude Opus 4.5 High Thinkingclaude-opus-4-5-high-thinkingAnthropic1M
Claude 4.5 Sonnetclaude-sonnet-4-5Anthropic400K
Claude 4.5 Sonnet Thinkingclaude-sonnet-4-5-thinkingAnthropic400K
Claude Haiku 5.5claude-haiku-5-5Anthropic1M
Claude Haiku 5.5 Thinkingclaude-haiku-5-5-thinkingAnthropic1M
GPT 5.6 Soleangpt-5.6-soleanOpenAI400K
GPT 5.6 Lunagpt-5.6-lunaOpenAI400K
GPT 5.6 Terragpt-5.6-terraOpenAI400K
GPT 5.5gpt-5.5OpenAI400K
GPT 5.5 Extragpt-5.5-extraOpenAI400K
GPT 5.4gpt-5.4OpenAI400K
GPT 5.4 Minigpt-5.4-miniOpenAI1M
GPT 5.4 Nanogpt-5.4-nanoOpenAI1M
GPT 5.3 Codexgpt-5.3-codexOpenAI400K
GPT 5.2gpt-5.2OpenAI400K
GPT 5.1gpt-5.1OpenAI400K
GPT 5 Minigpt-5-miniOpenAI1M
Gemini 4 Carbongemini-4-carbonGoogle400K
Gemini 4 Argongemini-4-argonGoogle400K
Gemini 3.8 Flashgemini-3.8-flashGoogle1M
Gemini 3.1 Progemini-3.1-proGoogle400K
Gemini 3 Flashgemini-3-flashGoogle1M
Gemini 3.5 Flashgemini-3.5-flashGoogle1M
Grok 4.7grok-4.7xAI400K
Grok 4.6grok-4.6xAI400K
Grok 4.5grok-4.5xAI400K
DeepSeek V4.1 Flashdeepseek-v41-flash-1017DeepSeek1M
Composer 2.5composer-2.5Cufora1M

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
  }
}
StatusTypeMeaning
400invalid_requestThe body is malformed or a parameter is not supported by the model.
401invalid_api_keyThe key is missing, wrong or revoked.
402token_limit_reachedThe token allowance of your plan for this period is used up.
404model_not_foundThe model ID does not exist. Call GET /models for the list.
429rate_limit_exceededToo many requests per minute for your plan. Wait and retry.
502upstream_errorThe 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.

PlanTokens / monthTokens / weekRequests / min
Starter250M62.5M60
Plus2B500M300
Pro10B2.5B1,000
Max50B12.5B5,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.