Skip to content

API Documentation

Build with allmodelapi.com.

One gateway to models from Anthropic, OpenAI, DeepSeek, Mistral, Gemini, Z.ai, and Kimi. Requests use the Anthropic Messages API format with your allmodelapi.com key.

Connection

Base URLhttps://api.opusrouter.com/v1

Send your key using the x-api-key header and include the anthropic-version header on every request.

Quick start

curl https://api.opusrouter.com/v1/messages \
  -H "x-api-key: $OPUSROUTER_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 2048,
    "messages": [{"role":"user","content":"Hello"}]
  }'

Auto subscriptions

When enabled on your deployment, use a personal API key and model: auto with Chat Completions, Messages, or Responses. Plus, Pro and Max provide 100M, 300M and 700M total tokens per day. Input, output and cached tokens count once. Reset is at 00:00 UTC; unused tokens do not roll over.

POST /v1/chat/completions
Authorization: Bearer YOUR_PERSONAL_API_KEY
Content-Type: application/json

{
  "model": "auto",
  "messages": [{"role": "user", "content": "Explain this function."}],
  "max_tokens": 1024
}

Auto selects an available eligible model from the configured catalog. Check x-allmodelapi-selected-model for the selected model and x-allmodelapi-quota-reset for the next reset. Active paid access is required (402 otherwise); exhausted allowance returns 429 with Retry-After. No eligible route returns 503. An interrupted response with missing usage keeps a pending reservation until reconciled.

Exact model IDs continue to use separate PAYG credit. Workspace keys do not consume personal subscription tokens. Test subscriptions require test keys on an isolated staging deployment. Manage billing, paid upgrades, next-renewal downgrades, invoices and cancellation in Plans & Billing.

Models

Claude Opus 4.8claude-opus-4-8
Claude Opus 4.7claude-opus-4-7
Claude Opus 4.6claude-opus-4-6
Claude Sonnet 4.6claude-sonnet-4-6
Fable 5claude-fable-5

Claude Code

export ANTHROPIC_BASE_URL=https://api.opusrouter.com
export ANTHROPIC_API_KEY=or_your_key_here

claude --model claude-opus-4-8

Any client that accepts a custom Anthropic base URL can use the same credentials and model IDs to reach every provider on the platform.

Errors

401 — missing, invalid, revoked, or expired API key.

400 — malformed request or unsupported model ID.

429 — daily or monthly plan allocation exhausted.

5xx — temporary upstream or routing failure; retry with backoff.