Quick answer: 321AI speaks the Anthropic Messages protocol at https://321ai.cc (the SDK appends /v1/messages itself — do not add /v1 to this base URL). Authenticate with your 321AI key the same way the Anthropic SDK does (x-api-key). Claude Code works by setting ANTHROPIC_BASE_URL=https://321ai.cc and ANTHROPIC_AUTH_TOKEN=<your key>.
Audience: developers using the Anthropic SDK, Claude Code, or any client that speaks the Messages protocol.
| Setting | Value | Note |
|---|---|---|
Anthropic protocol (Messages) | https://321ai.cc | SDK appends /v1/messages — no /v1 in base |
OpenAI protocol (chat/completions) | https://321ai.cc/v1 | include /v1 |
Auth (Anthropic) | x-api-key: your 321AI key | or Authorization: Bearer for Claude Code env vars |
curl https://321ai.cc/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-sonnet-5","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'
from anthropic import Anthropic
client = Anthropic(api_key="YOUR_KEY", base_url="https://321ai.cc")
msg = client.messages.create(
model="claude-sonnet-5", max_tokens=256,
messages=[{"role": "user", "content": "Hello"}],
)
print(msg.content)
For the Anthropic protocol the base is https://321ai.cc WITHOUT /v1 — the SDK appends /v1/messages itself. For the OpenAI protocol (chat/completions) the base is https://321ai.cc/v1 WITH /v1.
See the live catalog at /pricing/claude — prices are the market minimum across vendors, updated daily.
Yes — the Messages protocol (system, messages, tools, streaming SSE) is passed through; report any protocol gap via the in-console ticket.
Related: Claude Code 中文教程 · Claude price table · relay glossary