Everything you need to integrate. Speak Anthropic or OpenAI — same key, same rules.
Sign up, then go to Dashboard → API Keys → Create new key. You'll get a string that starts with cc_user_. Copy it — we won't show it again.
The base URL is https://api.your-domain.com (or whatever your operator told you).
curl https://api.your-domain.com/v1/messages \
-H "x-api-key: $YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"max_tokens": 512,
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}'
curl https://api.your-domain.com/v1/chat/completions \
-H "Authorization: Bearer $YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}'
curl https://api.your-domain.com/v1/messages \
-H "x-api-key: $YOUR_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-sonnet-4-6","stream":true,"max_tokens":1024,
"messages":[{"role":"user","content":"Tell me a haiku."}]}'
Inline base64-encoded images:
{
"model": "claude-sonnet-4-6",
"max_tokens": 512,
"messages": [{
"role": "user",
"content": [
{"type": "image", "source": {
"type": "base64",
"media_type": "image/png",
"data": "iVBORw0KG..."
}},
{"type": "text", "text": "What's in this image?"}
]
}]
}
Mark message blocks with cache_control to keep them in cache and pay 10% on subsequent reads:
{
"role": "user",
"content": [
{"type": "text", "text": "Large system context...",
"cache_control": {"type": "ephemeral"}},
{"type": "text", "text": "User question goes here"}
]
}
{
"model": "claude-sonnet-4-6",
"max_tokens": 1024,
"tools": [{
"name": "get_weather",
"description": "Look up current weather",
"input_schema": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}],
"messages": [{"role":"user","content":"Weather in Tokyo?"}]
}
Every successful request returns:
X-CC-Request-Id — our internal id (use to look up usage later)X-CC-Account-Id — which upstream Anthropic account served yourequest-id — Anthropic's own id, for support escalationTo retrieve usage for any past request:
GET /v1/usage/{request_id}
→ {
"input_tokens": 781,
"output_tokens": 921,
"cache_read_input_tokens": 0,
"cache_creation": {"ephemeral_5m_input_tokens": 0, ...},
"cost_micro": 18234,
"model": "claude-sonnet-4-6"
}
| Code | Meaning |
|---|---|
401 | Missing or invalid API key. |
402 | Insufficient credit — top up to continue. |
429 | Rate limited (per-key RPM or upstream account RPM). |
502 | Upstream Anthropic error. Our cooldown system reroutes. |
503 | No healthy upstream account. Retry shortly. |
Use any existing SDK; just swap the base URL.
# Python (anthropic-sdk-python)
client = anthropic.Anthropic(
api_key="cc_user_...",
base_url="https://api.your-domain.com",
)
# Python (openai-python)
client = openai.OpenAI(
api_key="cc_user_...",
base_url="https://api.your-domain.com/v1",
)
# Node.js (@anthropic-ai/sdk)
const client = new Anthropic({ apiKey: process.env.YOUR_KEY,
baseURL: 'https://api.your-domain.com' });
Need something not listed here? Email support@example.com and we'll help.