Base URLs & Auth

All APIs are accessed through a unified gateway address. The mainstream path is the OpenAI-compatible protocol + Bearer token auth; the Anthropic / Gemini native endpoints are extended compatibility, covered below.

Base URL (BASE_URL)

OpenAI-compatible endpoints:

PurposeMethodURL
Chat (single/multi-turn, streaming)POSThttps://api-model.shuntianchuang.cn/v1/chat/completions
Responses (new-style chat API)POSThttps://api-model.shuntianchuang.cn/v1/responses
Model listGEThttps://api-model.shuntianchuang.cn/v1/models
Text embeddingsPOSThttps://api-model.shuntianchuang.cn/v1/embeddings
RerankPOSThttps://api-model.shuntianchuang.cn/v1/rerank
Image generationPOSThttps://api-model.shuntianchuang.cn/v1/images/generations
Image editingPOSThttps://api-model.shuntianchuang.cn/v1/images/edits
Video generation (submit)POSThttps://api-model.shuntianchuang.cn/v1/videos
Video task query / downloadGEThttps://api-model.shuntianchuang.cn/v1/videos/{task_id} (/content to download)
Speech synthesis (TTS)POSThttps://api-model.shuntianchuang.cn/v1/audio/speech
Speech-to-text (STT)POSThttps://api-model.shuntianchuang.cn/v1/audio/transcriptions
TIP

With the official OpenAI SDKs, set base_url to https://api-model.shuntianchuang.cn/v1 (with /v1 — the SDK appends the rest of the path); when sending raw HTTP requests, use the full URLs in the table above.

The base URLs can also be viewed and copied from the API Info card on the console's "Overview" page, which additionally offers a "Test latency" entry.

Authentication

Different protocol endpoints use different auth headers — first figure out which kind of endpoint you're calling:

EndpointAuth header
OpenAI-compatible endpoints (all endpoints above)Authorization: Bearer sk-your-token
Anthropic native endpoint (/v1/messages)x-api-key: sk-your-token, plus anthropic-version: 2023-06-01
Gemini native endpoint (/v1beta/models/{model}:generateContent)x-goog-api-key: sk-your-token

API Keys are created on the console's "API Keys" page — see API Key Management. The OpenAI-compatible endpoints match the official OpenAI API in both paths and request/response formats — with an SDK, just swap base_url for this site's address and api_key for a site token; no other code changes. Three common ways to set it up:

cURL
Python (openai)
Node.js (openai)
# Attach the Authorization header to every request
curl https://api-model.shuntianchuang.cn/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-token" \
  -d '{
    "model": "deepseek-v4-flash",
    "messages": [{ "role": "user", "content": "Hello" }]
  }'

# Or store it in a variable for reuse
export SHUNTIANCHUANG_API_KEY=sk-your-token
curl https://api-model.shuntianchuang.cn/v1/chat/completions \
  -H "Authorization: Bearer $SHUNTIANCHUANG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "deepseek-v4-flash", "messages": [{ "role": "user", "content": "Hello" }] }'

Extended Compatibility: Anthropic / Gemini

For some models, the site also exposes Anthropic and Gemini native endpoints so the corresponding official SDKs and clients can connect directly (auth headers in Authentication above; already included in the SDK examples):

ProtocolURL
Anthropic nativePOST https://api-model.shuntianchuang.cn/v1/messages
Gemini nativePOST https://api-model.shuntianchuang.cn/v1beta/models/{model}:generateContent
NOTE

Only some models support the multi-protocol endpoints — see Models for the supported list. On both endpoints, use a site model name (e.g. glm-5.2); the platform does not host Anthropic / Google official model names.

Anthropic SDK

Set base_url to the site root (without /v1 — the SDK appends /v1/messages) and authenticate with api_key (the SDK sends the x-api-key and anthropic-version headers automatically):

cURL
Python (anthropic)
Node.js (@anthropic-ai/sdk)
curl https://api-model.shuntianchuang.cn/v1/messages \
  -H "x-api-key: sk-your-token" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.2",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Hello" }]
  }'

Gemini SDK

Likewise set base_url to the site root (without /v1beta — the SDK appends the rest of the path); pass the token via api_key (mapped to the x-goog-api-key header):

cURL
Python (google-genai)
Node.js (@google/genai)
# The model name is part of the URL, right before :generateContent
curl -X POST "https://api-model.shuntianchuang.cn/v1beta/models/glm-5.2:generateContent" \
  -H "x-goog-api-key: sk-your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{ "role": "user", "parts": [{ "text": "Hello" }] }]
  }'

For full configuration guides to client tools like Claude Code and Codex, see App Integration.

Common Auth Problems

SymptomCause
401 UnauthorizedToken missing, mistyped, has stray whitespace, or was deleted
403 ForbiddenToken disabled, or the token's model scope / IP allowlist blocked this request
"Insufficient quota" despite sufficient balanceThe token's own cap is used up or it has expired

See Error Codes & Troubleshooting for the full error reference. For your first call, start with Quick Start.