Docs
EN中文
Get started/Endpoints
.md

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

EndpointRoleRouteRecommendation
https://cn.chatapi.appPrimary · China directCN2 + 163 + 163Default; all docs and client guides use it
https://jp.chatapi.appGlobal · Global CDNCN2 + 9929 + CMIN2Best from overseas, Hong Kong, Taiwan and cross-border teams
https://apicdn.xycai.usBackupCloudflare proxiedSwitch here if the primary is unreachable
https://apicdn.xyc.aiOverseas directDirectFor 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:

https://cn.chatapi.app/v1
WhereValue
OpenAI SDK base_url / OPENAI_BASE_URLhttps://cn.chatapi.app/v1
Anthropic SDK / Claude Code ANTHROPIC_BASE_URLhttps://cn.chatapi.app
Codex (Responses API) base_urlhttps://cn.chatapi.app/v1
Gemini SDK http_options.base_url / GOOGLE_GEMINI_BASE_URLhttps://cn.chatapi.app
Gemini native full pathhttps://cn.chatapi.app/v1beta/models/{model}:generateContent
curl / any HTTP clienthttps://cn.chatapi.app/v1/chat/completions

3. Paths at a glance

CapabilityMethod & pathDocs
Chat Completions (all vendors)POST /v1/chat/completionsChat Completions
Responses API (GPT / Codex)POST /v1/responsesResponses API
Claude nativePOST /v1/messagesClaude Messages
Gemini nativePOST /v1beta/models/{model}:generateContentGemini native
Image generation / editPOST /v1/images/generations · POST /v1/images/editsImage generation
Video generation (async)POST /v1/video/generations → GET /v1/videos/{task_id} → GET /v1/videos/{task_id}/contentVideo generation
Text-to-speechPOST /v1/audio/speechText-to-speech
EmbeddingsPOST /v1/embeddingsEmbeddings
Jev decision modelPOST /v1/decisions (alias /v1/systemone)Jev decision model
Model listGET /v1/modelsModels

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/responses is supported on every endpoint.
  • The console (www.xycai.us) and the API endpoints are different hosts; keys work on all API endpoints alike.