Endpoints
Every endpoint fronts the same service, account and keys — only the network route differs. Use the primary endpoint from mainland China; switch to another one from overseas or whenever the primary misbehaves. Nothing else in your configuration changes.
1. Endpoint list
| Endpoint | Role | Route | Recommendation |
|---|---|---|---|
https://cn.chatapi.app | Primary · China direct | CN2 + 163 + 163 | Default; all docs and client guides use it |
https://jp.chatapi.app | Global · Global CDN | CN2 + 9929 + CMIN2 | Best from overseas, Hong Kong, Taiwan and cross-border teams |
https://apicdn.xycai.us | Backup | Cloudflare proxied | Switch here if the primary is unreachable |
https://apicdn.xyc.ai | Overseas direct | Direct | For servers outside China; needs a proxy from the mainland |
Old address still works
https://apicdn.xyc.ai from earlier docs and client configs keeps working — no forced migration. DNS for xyc.ai is unreliable inside mainland China, so users there should move to https://cn.chatapi.app.
2. Base URL per protocol
Different SDKs expect the base URL in different shapes. Pick the endpoint and protocol, then copy:
| Where | Value |
|---|---|
OpenAI SDK base_url / OPENAI_BASE_URL | https://cn.chatapi.app/v1 |
Anthropic SDK / Claude Code ANTHROPIC_BASE_URL | https://cn.chatapi.app |
Codex (Responses API) base_url | https://cn.chatapi.app/v1 |
Gemini SDK http_options.base_url / GOOGLE_GEMINI_BASE_URL | https://cn.chatapi.app |
| Gemini native full path | https://cn.chatapi.app/v1beta/models/{model}:generateContent |
| curl / any HTTP client | https://cn.chatapi.app/v1/chat/completions |
3. Paths at a glance
| Capability | Method & path | Docs |
|---|---|---|
| Chat Completions (all vendors) | POST /v1/chat/completions | Chat Completions |
| Responses API (GPT / Codex) | POST /v1/responses | Responses API |
| Claude native | POST /v1/messages | Claude Messages |
| Gemini native | POST /v1beta/models/{model}:generateContent | Gemini native |
| Image generation / edit | POST /v1/images/generations · POST /v1/images/edits | Image generation |
| Video generation (async) | POST /v1/video/generations → GET /v1/videos/{task_id} → GET /v1/videos/{task_id}/content | Video generation |
| Text-to-speech | POST /v1/audio/speech | Text-to-speech |
| Embeddings | POST /v1/embeddings | Embeddings |
| Jev decision model | POST /v1/decisions (alias /v1/systemone) | Jev decision model |
| Model list | GET /v1/models | Models |
4. Connectivity check
Run this against any endpoint; a JSON model list means both the route and your key work. It also lets you compare latency and pick the fastest endpoint:
for h in cn.chatapi.app jp.chatapi.app apicdn.xycai.us apicdn.xyc.ai; do
curl -s -o /dev/null -w "$h %{http_code} %{time_total}s\n" \
-H "Authorization: Bearer sk-xxxxxxxx" https://$h/v1/models
done
PowerShell:
Invoke-RestMethod -Uri "https://cn.chatapi.app/v1/models" -Headers @{ Authorization = "Bearer sk-xxxxxxxx" }
5. Notes
- Stream long requests (
stream: true). A non-streaming call that stays silent for minutes may be cut by idle timeouts on intermediate network gear. - WebSocket: Codex's
wss://…/v1/responsesis supported on every endpoint. - The console (www.xycai.us) and the API endpoints are different hosts; keys work on all API endpoints alike.
