Anthropic Messages
Anthropic Messages is the protocol used by Claude Code, Anthropic SDKs and compatible Messages clients.
Base URL
text
https://quotarouter.aiCommon paths:
text
/v1/messages
/v1/modelsAuthentication headers:
http
x-api-key: YOUR_QUOTAAPI_KEY
anthropic-version: 2023-06-01Messages 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 field | Recommended value |
|---|---|
| Base URL | https://quotarouter.ai |
| API Key | YOUR_QUOTAAPI_KEY |
| Header | x-api-key |
| Version | 2023-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.
