Complete API Configuration Guide for Mainland Chinese LLMs (Updated August 2026)
One‑stop reference for DeepSeek, Qwen, Zhipu GLM, Kimi, Doubao, and more – with OpenAI‑compatible endpoints, Anthropic‑compatible endpoints, domestic and international addresses, environment variables, and recommended models.
Spend 8 minutes hunting through each provider’s docs? Or spend 2 minutes with this guide. All the OpenAI‑compatible endpoints for China’s major models – with both domestic and international addresses – kept up to date. Plus Anthropic‑compatible endpoints for Claude Code users.
Quick Reference – OpenAI Compatible Endpoints
| Provider | China (Mainland) Base URL | International Base URL | Env Variable | Recommended Model (Aug 2026) |
|---|---|---|---|---|
| DeepSeek | https://api.deepseek.com | (same as China) | DEEPSEEK_API_KEY | deepseek-v4-pro |
| Alibaba (Qwen) | https://dashscope.aliyuncs.com/compatible-mode/v1 | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 | DASHSCOPE_API_KEY | qwen-plus |
| Zhipu AI (GLM) | https://open.bigmodel.cn/api/paas/v4 | https://api.z.ai/api/paas/v4 | ZHIPU_API_KEY | glm-5.3 |
| Moonshot (Kimi) | https://api.moonshot.cn/v1 | https://api.moonshot.ai/v1 | MOONSHOT_API_KEY | kimi-k3 |
| ByteDance (Doubao) | https://ark.cn-beijing.volces.com/api/v3 | (via Volcano Engine International) | ARK_API_KEY | doubao-pro-32k |
| Baidu (Wenxin) | https://qianfan.baidubce.com/v2 | (no dedicated endpoint) | QIANFAN_API_KEY | ERNIE-4.0-Turbo-8K |
| MiniMax | https://api.minimaxi.com/v1 | https://api.minimax.io/v1 | MINIMAX_API_KEY | MiniMax-M3 |
| SiliconFlow | https://api.siliconflow.cn/v1 | https://api.siliconflow.com/v1 | SILICONFLOW_API_KEY | Qwen/Qwen2.5-7B-Instruct |
Quick Reference – Anthropic Compatible Endpoints
| Provider | China (Mainland) Base URL | International Base URL | Env Variable | Recommended Model (Aug 2026) |
|---|---|---|---|---|
| DeepSeek | https://api.deepseek.com/anthropic | (same as China) | ANTHROPIC_AUTH_TOKEN (use DeepSeek API Key) | deepseek-v4-pro |
| Zhipu AI | https://open.bigmodel.cn/api/anthropic | https://api.z.ai/api/anthropic | ANTHROPIC_AUTH_TOKEN (use Zhipu API Key) | glm-5.2 |
| Alibaba (Qwen) | See detailed table below | See detailed table below | ANTHROPIC_AUTH_TOKEN (use DashScope API Key) | qwen-plus |
| MiniMax | https://api.minimaxi.com/anthropic | https://api.minimax.io/anthropic | ANTHROPIC_AUTH_TOKEN (use MiniMax API Key) | MiniMax-M3 |
| Moonshot (Kimi) | TBD | https://api.moonshot.ai/anthropic | ANTHROPIC_AUTH_TOKEN (use Moonshot API Key) | kimi-k3 |
| Tencent (TokenHub) | https://tokenhub.tencentmaas.com/plan/anthropic | https://tokenhub-intl.tencentmaas.com/plan/anthropic | ANTHROPIC_AUTH_TOKEN (use TokenHub API Key) | — |
| SiliconFlow | https://api.siliconflow.cn/v1/messages | (same as China) | ANTHROPIC_AUTH_TOKEN (use SiliconFlow API Key) | Qwen/Qwen2.5-7B-Instruct |
🔔 Note:
- Model names change frequently – always check official announcements before production use.
- For developers outside Mainland China, prefer the International Base URL where available for better latency and compliance.
- The same API key works for both OpenAI and Anthropic protocols within each provider – just use the appropriate base URL.
Alibaba Cloud (Qwen) – Anthropic Endpoints by Plan
Alibaba Cloud's Anthropic-compatible endpoints vary by product plan and region:
| Plan | China (Mainland) Base URL | International Base URL |
|---|---|---|
| Pay-as-you-go | https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropic | https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic |
| Token Plan (Personal/Team) | https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic | https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic |
| Coding Plan | https://coding.dashscope.aliyuncs.com/apps/anthropic | https://coding-intl.dashscope.aliyuncs.com/apps/anthropic |
⚠️ Important: For Pay-as-you-go, replace
{WorkspaceId}with your actual Workspace ID from the DashScope console.
Universal Code Examples
Both protocols work with every provider listed above – just set the corresponding environment variables and use the Base URL from the tables.
OpenAI Compatible – Python Example
from openai import OpenAI
import os
# Set your provider's Base URL and API Key via environment variables
client = OpenAI(
api_key=os.environ.get("YOUR_PROVIDER_API_KEY"), # e.g., DEEPSEEK_API_KEY
base_url=os.environ.get("OPENAI_BASE_URL") # e.g., https://api.deepseek.com
)
# Use the model name from the quick reference table
response = client.chat.completions.create(
model="your-model-name", # e.g., deepseek-v4-pro
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Environment variables setup (example with DeepSeek):
export DEEPSEEK_API_KEY="your-api-key"
export OPENAI_BASE_URL="https://api.deepseek.com"For other providers, replace DEEPSEEK_API_KEY with the appropriate variable from the OpenAI table and set OPENAI_BASE_URL to the corresponding Base URL.
Anthropic Compatible – Python Example
from anthropic import Anthropic
import os
# Set your provider's API Key and Anthropic Base URL
client = Anthropic(
api_key=os.environ.get("YOUR_PROVIDER_API_KEY"), # e.g., DEEPSEEK_API_KEY
base_url=os.environ.get("ANTHROPIC_BASE_URL") # e.g., https://api.deepseek.com/anthropic
)
response = client.messages.create(
model="your-model-name", # e.g., deepseek-v4-pro
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}]
)
print(response.content[0].text)Environment variables setup (example with DeepSeek):
export DEEPSEEK_API_KEY="your-api-key"
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"For other providers, replace with the appropriate API key variable (from the Anthropic table) and set ANTHROPIC_BASE_URL to the matching Base URL.
💡 Pro tip: You can also set
ANTHROPIC_AUTH_TOKENinstead ofYOUR_PROVIDER_API_KEY– it's the same value.
Provider‑Specific Notes
1. DeepSeek
- OpenAI:
https://api.deepseek.com| Anthropic:https://api.deepseek.com/anthropic - Key:
DEEPSEEK_API_KEY - Critical:
deepseek-chatanddeepseek-reasonerdeprecated (July 2026). Usedeepseek-v4-proordeepseek-v4-flash. - DeepSeek does not differentiate China/International – one URL works everywhere.
- Anthropic model mapping:
claude-opus→deepseek-v4-pro,claude-haiku/sonnet→deepseek-v4-flash.
2. Alibaba Cloud (Qwen)
- OpenAI: China
https://dashscope.aliyuncs.com/compatible-mode/v1| Intlhttps://dashscope-intl.aliyuncs.com/compatible-mode/v1 - Key:
DASHSCOPE_API_KEY - Models:
qwen-turbo,qwen-plus,qwen-max,qwen-long - Anthropic endpoints vary by plan – see the detailed table above.
3. Zhipu AI (GLM)
- OpenAI: China
https://open.bigmodel.cn/api/paas/v4| Intlhttps://api.z.ai/api/paas/v4 - Anthropic: China
https://open.bigmodel.cn/api/anthropic| Intlhttps://api.z.ai/api/anthropic - Key:
ZHIPU_API_KEY - Recommended:
glm-5.3(OpenAI) /glm-5.2(Anthropic);GLM-4-Flashis free for testing.
4. Moonshot (Kimi)
- OpenAI: China
https://api.moonshot.cn/v1| Intlhttps://api.moonshot.ai/v1 - Anthropic: Intl
https://api.moonshot.ai/anthropic(China TBD) - Key:
MOONSHOT_API_KEY - Use
kimi-k3(general) orkimi-k3-long(long context); replaced oldermoonshot-v1. - China (
.cn) and International (.ai) may have separate account systems.
5. ByteDance (Doubao)
- OpenAI: China
https://ark.cn-beijing.volces.com/api/v3(general) or/coding/v3(Coding Plan) - Key:
ARK_API_KEY - No official international endpoint – use China endpoint or third‑party gateway.
- No Anthropic compatible endpoint documented.
6. Baidu (Wenxin)
- OpenAI:
https://qianfan.baidubce.com/v2(China only) - Key:
QIANFAN_API_KEY(actually Access Key + Secret Key; requires OAuth token exchange) - Models:
ERNIE-4.0-Turbo-8K(flagship) orERNIE-Speed-128K - No international or Anthropic endpoints documented.
7. MiniMax
- OpenAI: China
https://api.minimaxi.com/v1| Intlhttps://api.minimax.io/v1 - Anthropic: China
https://api.minimaxi.com/anthropic| Intlhttps://api.minimax.io/anthropic - Key:
MINIMAX_API_KEY - Use
MiniMax-M3– olderabab6.5series deprecated. - Supports video understanding and 1M+ token context.
8. SiliconFlow
- OpenAI: China
https://api.siliconflow.cn/v1| Intlhttps://api.siliconflow.com/v1 - Anthropic:
https://api.siliconflow.cn/v1/messages - Key:
SILICONFLOW_API_KEY - Aggregates 200+ open‑source models (Llama, Qwen, DeepSeek, etc.). Use
Qwen/Qwen2.5-7B-Instructas a solid default.
9. Tencent (TokenHub) – Anthropic only
- Anthropic: China
https://tokenhub.tencentmaas.com/plan/anthropic| Intlhttps://tokenhub-intl.tencentmaas.com/plan/anthropic - Key:
ANTHROPIC_AUTH_TOKEN(use TokenHub API Key) - Primarily an Anthropic‑compatible gateway.
Best Practice: Multi‑Provider Switching with Unified Config
You can manage all providers and protocols with a configuration dictionary, making it easy to switch in production:
from openai import OpenAI
from anthropic import Anthropic
import os
CONFIG = {
"deepseek": {
"api_key_env": "DEEPSEEK_API_KEY",
"openai_base": "https://api.deepseek.com",
"anthropic_base": "https://api.deepseek.com/anthropic",
"default_model": "deepseek-v4-pro"
},
"qwen": {
"api_key_env": "DASHSCOPE_API_KEY",
"openai_base": {
"china": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"intl": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
},
# Anthropic requires plan-specific URLs – handle separately
"default_model": "qwen-plus"
},
# Add other providers similarly...
}
def get_openai_client(provider, region="china"):
cfg = CONFIG[provider]
base = cfg.get("openai_base")
if isinstance(base, dict):
base = base.get(region, base["china"])
return OpenAI(
api_key=os.environ.get(cfg["api_key_env"]),
base_url=base
)
# Usage
client = get_openai_client("deepseek")
response = client.chat.completions.create(
model=CONFIG["deepseek"]["default_model"],
messages=[{"role": "user", "content": "Hello"}]
)💡 Pro tip: Externalize the config to a
models.jsonfile – this guide and the Model Catalog tool can share it for consistency.
Summary: Which Endpoint Should You Use?
| Your Location | OpenAI‑Compatible | Anthropic‑Compatible |
|---|---|---|
| Mainland China | Use China endpoints | Use China endpoints |
| Outside China | Prefer International endpoints | Prefer International endpoints |
| No intl endpoint (Baidu, Doubao) | Use China endpoint | N/A |
| Your Use Case | Recommended Protocol |
|---|---|
| General LLM integration | OpenAI‑compatible (wider ecosystem) |
| Claude Code / Claude Desktop | Anthropic‑compatible |
| Existing Anthropic SDK codebase | Anthropic‑compatible (minimal migration) |
What’s Next
I keep this guide updated regularly.
Companion tool: browse live pricing, context windows and endpoints for every model in this guide — plus 1,300+ more across 39 providers — in the Model Catalog. Filter by provider (DeepSeek, Qwen, GLM, Kimi, MiniMax…) or API protocol, sort by price, and star the models you care about. Prefer data over UI? The catalog behind it is also published as a static JSON file at /models.json — the exact models.json mentioned in the pro tip above.