Claude Code
Claude Code uses the Anthropic Messages protocol. With QuotaAPI, set the Base URL to https://quotarouter.ai and use the API Key created in the console.
Environment variables
Set:
bash
export ANTHROPIC_BASE_URL="https://quotarouter.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_QUOTAAPI_KEY"If your client version expects ANTHROPIC_API_KEY, use:
bash
export ANTHROPIC_BASE_URL="https://quotarouter.ai"
export ANTHROPIC_API_KEY="YOUR_QUOTAAPI_KEY"Restart the terminal or Claude Code so the updated environment is loaded.
cc-switch import
If you manage profiles with cc-switch, keep these fields aligned:
| Field | Value |
|---|---|
| Provider | Anthropic compatible |
| Base URL | https://quotarouter.ai |
| API Key | YOUR_QUOTAAPI_KEY |
| Model | claude-opus-4.8 or a Claude model enabled in the console |
After importing, run a short prompt before switching to production work.
Manual Anthropic Messages test
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": 80,
"messages": [
{ "role": "user", "content": "Reply with one sentence about QuotaAPI." }
]
}'Model names
Use the model names enabled in your console. Common Claude examples:
| Model | Good for |
|---|---|
claude-opus-4.8 | Complex reasoning, long context and coding tasks |
claude-sonnet-4.5 | Daily development, Q&A and cost-sensitive work |
If the client reports that a model is missing, check that the API Key has access to the Claude group and that the model name is spelled exactly as shown in the console.
Troubleshooting
- Authentication fails: check whether
ANTHROPIC_AUTH_TOKENorANTHROPIC_API_KEYcontains your QuotaAPI Key. - Requests still hit the default official URL:
ANTHROPIC_BASE_URLwas not loaded. Restart the terminal or check profile files. - Insufficient balance: open the console and review balance and request records.
- Model unavailable: check group permissions and model name.
