Skip to content

Anthropic Messages

Anthropic Messages is the protocol used by Claude Code, Anthropic SDKs and compatible Messages clients.

Base URL

text
https://quotarouter.ai

Common paths:

text
/v1/messages
/v1/models

Authentication headers:

http
x-api-key: YOUR_QUOTAAPI_KEY
anthropic-version: 2023-06-01

Messages request

bash
curl https://quotarouter.ai/v1/messages \
  -H "x-api-key: YOUR_QUOTAAPI_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.8",
    "max_tokens": 120,
    "system": "You answer with concise technical guidance.",
    "messages": [
      {
        "role": "user",
        "content": "Show a one-sentence QuotaAPI connection check."
      }
    ]
  }'

Streaming

bash
curl https://quotarouter.ai/v1/messages \
  -H "x-api-key: YOUR_QUOTAAPI_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4.8",
    "max_tokens": 120,
    "stream": true,
    "messages": [
      { "role": "user", "content": "Stream a short response." }
    ]
  }'

Models

bash
curl https://quotarouter.ai/v1/models \
  -H "x-api-key: YOUR_QUOTAAPI_KEY" \
  -H "anthropic-version: 2023-06-01"

Client mapping

Client fieldRecommended value
Base URLhttps://quotarouter.ai
API KeyYOUR_QUOTAAPI_KEY
Headerx-api-key
Version2023-06-01

Claude Code usually only needs ANTHROPIC_BASE_URL and an auth variable. The exact variable name can vary by client version, so test with a short prompt after configuring it.

Troubleshooting

  • Missing anthropic-version: some clients or manual requests will be rejected.
  • Base URL includes /v1: Claude Code may append paths again and produce a wrong request URL.
  • Model unavailable: check Claude group permissions and model name.
  • Insufficient balance: the console will show a failed charge or insufficient-balance record.

QuotaAPI is an AI API relay service for developers and teams.