Documentation

How touse it.

ClaudeOpus speaks the Anthropic Messages API, byte for byte. Change one base URL and your SDK, your CLI, and your editor carry on as if nothing happened.

the whole change
01

What this is.

An Anthropic-compatible proxy. Same /v1/messages protocol, same headers, same SSE event stream. Point any Anthropic client at it and pass a ClaudeOpus key where you'd pass an Anthropic one.

One detail worth reading twice: routes are mounted at the root. It's https://api.claudeopus.pro/v1/messages — there is no /api in front of it.

base url
https://api.claudeopus.pro

0M

Max context

0K

Max output

0

Models

0h

Token window

Keys start with sk-ant-co- and are issued by an administrator or a reseller. You can check any key's limits, window, and recent usage on the usage page.

02

Quick start.

The setup script asks for your key, writes the Claude Code config, and verifies the connection before it exits.

macOS / Linux
curl -fsSL https://claudeopus.pro/setup.sh | bash
Windows (PowerShell)
irm https://claudeopus.pro/setup.ps1 | iex

Prefer to do it yourself? Everything the script writes is in Editors & CLIs, and the rest of this page covers the shape of every request and response.

03

Authentication.

Send the key as x-api-key, the way the Anthropic SDK does. Authorization: Bearer works identically — whichever your client already sends.

request
curl https://api.claudeopus.pro/v1/messages \
  -H "x-api-key: sk-ant-co-YOUR_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello, world."}]
  }'

A missing or bad key doesn't throw a 401 here — see Limits & errors for why.

04

Models.

The three current tiers:

Opusflagship
claude-opus-4-8

Flagship. Deepest reasoning, longest output.

context

1,000,000

max output

128,000

Sonnetbalanced
claude-sonnet-4-6

Balanced — and the default when no model is named.

context

1,000,000

max output

64,000

Haikufast
claude-haiku-4-5-20251001

Low latency, high throughput.

context

200,000

max output

8,192

Shorthand

Three aliases resolve to the newest model in each family, so you never have to chase a date-stamped ID:

  • opusclaude-opus-4-8
  • sonnetclaude-sonnet-4-6
  • haikuclaude-haiku-4-5-20251001
  • Claude Code's context-tier suffix is accepted as-is, too — send claude-opus-4-8[1m] and it just works.

    Also available

    Earlier releases stay routable for pinned clients:

    claude-opus-4-7
    claude-opus-4-6
    claude-opus-4-5
    claude-sonnet-4-5-20250929
    claude-opus-4-1-20250805
    claude-opus-4-20250514
    claude-sonnet-4-20250514

    Listing them

    GET /v1/models returns all ten with their context and output limits. GET /v1/models/{id} returns one, or a 404. Neither needs a key.

    GET /v1/models
    curl https://api.claudeopus.pro/v1/models
    05

    Messages API.

    The same shape as Anthropic's /v1/messages. If it works against the Anthropic SDK, it works here unchanged — tools, system prompts, multi-turn, and all.

    response
    {
      "id": "msg_abc123",
      "type": "message",
      "role": "assistant",
      "content": [{"type": "text", "text": "Hello, world."}],
      "model": "claude-opus-4-8",
      "stop_reason": "end_turn",
      "usage": {
        "input_tokens": 12,
        "output_tokens": 6,
        "cache_read_input_tokens": 0,
        "cache_creation_input_tokens": 0
      }
    }

    Omit max_tokens and it defaults to 4096. Omit model and you get Sonnet. The usage block is the real upstream count — it's what your token window is charged from.

    Very long conversations are compacted automatically rather than rejected: the proxy trims oldest-first until the request fits, and only gives up once there's nothing left to cut.

    06

    Streaming.

    Set "stream": true and read the response as SSE. Upstream events are piped straight through — no buffering, no aggregation, no added latency.

    stream
    data: {"type":"message_start","message":{...}}
    data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
    data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}
    data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", world."}}
    data: {"type":"content_block_stop","index":0}
    data: {"type":"message_delta","delta":{"stop_reason":"end_turn"}}
    data: {"type":"message_stop"}

    Streams are held open for as long as the model keeps talking, and usage is metered from the final message_delta. Disconnect early and the upstream request is cancelled with you.

    07

    Prompt caching.

    Mark any large, stable prefix — a system prompt, a tool schema, a document — with cache_control and it's cached upstream.

    cache_control
    {
      "model": "claude-opus-4-8",
      "max_tokens": 1024,
      "system": [
        {
          "type": "text",
          "text": "<your long, stable instructions>",
          "cache_control": {"type": "ephemeral"}
        }
      ],
      "messages": [{"role": "user", "content": "Hello, world."}]
    }

    Cached tokens are free against your budget. Only non-cached input plus output is charged to your five-hour window — both cache reads and cache writes are excluded outright. A long cached system prompt effectively costs you nothing to keep sending.

    08

    Editors & CLIs.

    Every client needs the same two facts: a base URL and a key. These are exactly what the setup script writes.

    Claude Code

    In ~/.claude/settings.json:

    ~/.claude/settings.json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.claudeopus.pro",
        "ANTHROPIC_AUTH_TOKEN": "sk-ant-co-YOUR_KEY",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      }
    }

    Restart Claude Code afterwards. Add ANTHROPIC_MODEL if you want to pin a tier; leave it out and Claude Code picks per task.

    Cursor

    Settings → Models → Add custom OpenAI-compatible model. Cursor speaks OpenAI, so point it at the compatibility layer:

  • Base URL — https://api.claudeopus.pro/v1
  • API key — your ClaudeOpus key
  • Model — claude-opus-4-8
  • Windsurf, Cline, Roo Code

    All three accept an Anthropic-compatible base URL in their provider settings. Use https://api.claudeopus.pro and your key — no other changes.

    09

    OpenAI-compatible.

    For clients that only speak OpenAI, there's /v1/chat/completions. Requests are translated into Anthropic format on the way in and back again on the way out — streaming included, tool calls and all.

    POST /v1/chat/completions
    curl https://api.claudeopus.pro/v1/chat/completions \
      -H "Authorization: Bearer sk-ant-co-YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "claude-sonnet-4-6",
        "messages": [{"role": "user", "content": "Hello"}],
        "stream": true
      }'

    This route returns real OpenAI-shaped errors with real status codes, not the 200-with-a-message behaviour described below.

    10

    Server-side tools.

    Web search and image analysis run on our side — nothing to install, no MCP server, no client plugin. Images you put in a message are analysed server-side before the model sees them.

    Both are also callable directly, with the same key:

    POST /tools/web_search
    curl https://api.claudeopus.pro/tools/web_search \
      -H "x-api-key: sk-ant-co-YOUR_KEY" \
      -H "content-type: application/json" \
      -d '{"query": "anthropic messages api changelog"}'
    POST /tools/understand_image
    curl https://api.claudeopus.pro/tools/understand_image \
      -H "x-api-key: sk-ant-co-YOUR_KEY" \
      -H "content-type: application/json" \
      -d '{
        "prompt": "What does this diagram show?",
        "image_url": "https://example.com/diagram.png"
      }'

    image_url takes a URL or a base64 data URI. Payloads over 18 MB are refused with a 413.

    11

    Limits & errors.

    Each key carries a per-minute request ceiling and a rolling five-hour token window. The window opens on your first billed token, not at a fixed hour, and resets five hours later.

    Failures you can read

    Anything wrong with your key comes back as a normal 200 with an assistant message explaining it. It looks like a reply, so clients that handle error codes badly — most editors — show you the reason instead of a red box or a crash.

    Unknown keyThe key isn’t recognised.
    Disabled keyAn admin switched it off.
    Expired keyPast its expiry date. The message names the date.
    Rate limitedOver your per-minute ceiling. Sets retry-after.
    Window spentFive-hour token budget gone. The message says when it resets.

    Failures you can catch

    Everything else uses Anthropic's error shape and a real status code:

    400Malformed body — or context_length_exceeded, once auto-compaction still couldn’t make the conversation fit.
    401Authentication could not be completed upstream.
    413Request body over 50 MB.
    429The global per-IP ceiling — 200 requests a minute, across every key. Check retry-after.
    503Scheduled maintenance. Honour the Retry-After header and come back.

    Upstream hiccups aren't your problem: rate-limited and overloaded responses are retried transparently, rotating keys as needed, before anything surfaces to you.

    — Questions? Check the status page first, then reach your admin. —