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 10 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 Table – OpenAI Compatible
| 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, see notes) | ARK_API_KEY | doubao-pro-32k |
| Baidu (Wenxin) | https://qianfan.baidubce.com/v2 | (no dedicated international endpoint, see notes) | 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 (Aggregator) | https://api.siliconflow.cn/v1 | https://api.siliconflow.com/v1 | 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.
Provider‑by‑Provider Setup (OpenAI Compatible)
Common prerequisite: All examples use the official OpenAI Python SDK. You only need to swap
base_urlandapi_key.
For international users: Replace the China endpoint with the International URL listed in each section.
1. DeepSeek
Recommended model: deepseek-v4-pro (Flagship V4, 128K context) or deepseek-v4-flash (lightweight)
| Region | Base URL |
|---|---|
| China & International (same) | https://api.deepseek.com |
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ.get("DEEPSEEK_API_KEY"),
base_url="https://api.deepseek.com"
)
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- Aug 2026 critical update: The older
deepseek-chatanddeepseek-reasonerwere deprecated on July 24, 2026. Migrate to V4 series. - DeepSeek does not differentiate between China and international endpoints – one URL works worldwide.
2. Alibaba Cloud (Qwen)
Recommended model: qwen-plus (best value) or qwen-max (top performance)
| Region | Base URL |
|---|---|
| Mainland China | https://dashscope.aliyuncs.com/compatible-mode/v1 |
| International (Singapore) | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
from openai import OpenAI
import os
base_url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1" # International
# base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1" # Mainland China
client = OpenAI(
api_key=os.environ.get("DASHSCOPE_API_KEY"),
base_url=base_url
)
response = client.chat.completions.create(
model="qwen-plus",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- International users should use the
dashscope-intlendpoint for better performance. - Model family:
qwen-turbo,qwen-plus,qwen-max,qwen-long.
3. Zhipu AI (GLM)
Recommended model: glm-5.3 (latest flagship as of August 2026)
| Region | Base URL |
|---|---|
| Mainland China | https://open.bigmodel.cn/api/paas/v4 |
| International | https://api.z.ai/api/paas/v4 |
from openai import OpenAI
import os
base_url = "https://api.z.ai/api/paas/v4" # International
# base_url = "https://open.bigmodel.cn/api/paas/v4" # Mainland China
client = OpenAI(
api_key=os.environ.get("ZHIPU_API_KEY"),
base_url=base_url
)
response = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- The international endpoint (
z.ai) is recommended for users outside China. GLM-4-Flashis a free tier for testing.
4. Moonshot (Kimi)
Recommended model: kimi-k3 (general) or kimi-k3-long (ultra-long context)
| Region | Base URL |
|---|---|
| Mainland China | https://api.moonshot.cn/v1 |
| International | https://api.moonshot.ai/v1 |
from openai import OpenAI
import os
base_url = "https://api.moonshot.ai/v1" # International
# base_url = "https://api.moonshot.cn/v1" # Mainland China
client = OpenAI(
api_key=os.environ.get("MOONSHOT_API_KEY"),
base_url=base_url
)
response = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- Aug 2026 update:
kimi-k3replaces oldermoonshot-v1models. Usekimi-k3-longfor long documents. - Important: China (
.cn) and International (.ai) may have separate account systems – ensure your API key matches the domain.
5. ByteDance (Doubao)
Recommended model: doubao-pro-32k (best) or doubao-lite-32k (lightweight)
| Region | Base URL |
|---|---|
| Mainland China (General) | https://ark.cn-beijing.volces.com/api/v3 |
| Mainland China (Coding Plan) | https://ark.cn-beijing.volces.com/api/coding/v3 |
| International | No dedicated endpoint; use Volcano Engine International or API gateway |
from openai import OpenAI
import os
# For users inside China – general models
client = OpenAI(
api_key=os.environ.get("ARK_API_KEY"),
base_url="https://ark.cn-beijing.volces.com/api/v3"
)
# For Coding Plan (China) – use separate base URL
# client = OpenAI(
# api_key=os.environ.get("ARK_API_KEY"),
# base_url="https://ark.cn-beijing.volces.com/api/coding/v3"
# )Notes:
- Access requires activation via Volcano Engine and obtaining an
ARK_API_KEY. - Coding Plan uses
/coding/v3– do not mix with general models. - No official international endpoint – use China endpoint (latency may vary) or third‑party gateway.
6. Baidu (Wenxin)
Recommended model: ERNIE-4.0-Turbo-8K (flagship) or ERNIE-Speed-128K (fast & long)
| Region | Base URL |
|---|---|
| Mainland China | https://qianfan.baidubce.com/v2 |
| International | No official dedicated endpoint |
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ.get("QIANFAN_API_KEY"),
base_url="https://qianfan.baidubce.com/v2"
)
response = client.chat.completions.create(
model="ERNIE-4.0-Turbo-8K",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- Critical auth note: Baidu uses a non‑standard OAuth flow –
QIANFAN_API_KEYis actually a combination ofAccess Key IDandSecret Access Key. You must obtain anaccess_tokenfirst. Refer to the official docs for the token exchange steps. - No dedicated international endpoint is currently documented. International users can access the China endpoint, but may experience higher latency.
7. MiniMax
Recommended model: MiniMax-M3 (latest, 1M+ ultra‑long context)
| Region | Base URL |
|---|---|
| Mainland China | https://api.minimaxi.com/v1 |
| International | https://api.minimax.io/v1 |
from openai import OpenAI
import os
base_url = "https://api.minimax.io/v1" # International
# base_url = "https://api.minimaxi.com/v1" # Mainland China
client = OpenAI(
api_key=os.environ.get("MINIMAX_API_KEY"),
base_url=base_url
)
response = client.chat.completions.create(
model="MiniMax-M3",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- Aug 2026 critical update: Base URL changed – use
api.minimax.io(intl) orapi.minimaxi.com(China). Olderabab6.5series deprecated. - Supports video understanding and 1M+ token context.
8. SiliconFlow (Aggregator)
Recommended model: Qwen/Qwen2.5-7B-Instruct (great open‑source choice)
| Region | Base URL |
|---|---|
| Mainland China | https://api.siliconflow.cn/v1 |
| International | https://api.siliconflow.com/v1 |
from openai import OpenAI
import os
base_url = "https://api.siliconflow.com/v1" # International
# base_url = "https://api.siliconflow.cn/v1" # Mainland China
client = OpenAI(
api_key=os.environ.get("SILICONFLOW_API_KEY"),
base_url=base_url
)
response = client.chat.completions.create(
model="Qwen/Qwen2.5-7B-Instruct",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)Notes:
- Aggregates 200+ open‑source models (Llama, Qwen, DeepSeek, etc.).
- Transparent token‑based pricing – ideal for multi‑model comparison.
Anthropic‑Compatible Endpoints (for Claude Code & Native Anthropic Clients)
In addition to the standard OpenAI‑compatible interfaces, several providers offer Anthropic‑protocol‑compatible endpoints. This allows you to use native Anthropic clients like Claude Code to connect directly to Chinese LLMs.
Quick Reference Table – Anthropic Compatible
| Provider | China (Mainland) Base URL | International Base URL | Auth Env Variable | Notes |
|---|---|---|---|---|
| Zhipu AI | https://open.bigmodel.cn/api/anthropic | https://api.z.ai/api/anthropic | ANTHROPIC_AUTH_TOKEN (use Zhipu API Key) | Official "Claude API 用户特别搬家计划" |
| Alibaba (Qwen) | See detailed table below | See detailed table below | ANTHROPIC_AUTH_TOKEN (use DashScope API Key) | Address varies by plan and region |
| MiniMax | https://api.minimaxi.com/anthropic | https://api.minimax.io/anthropic | ANTHROPIC_AUTH_TOKEN (use MiniMax API Key) | Official Anthropic-compatible support |
| Moonshot (Kimi) | TBD | https://api.moonshot.ai/anthropic | ANTHROPIC_AUTH_TOKEN (use Moonshot API Key) | Coding-specific endpoint may be https://api.kimi.com/coding |
| Tencent (TokenHub) | https://tokenhub.tencentmaas.com/plan/anthropic | https://tokenhub-intl.tencentmaas.com/plan/anthropic | ANTHROPIC_AUTH_TOKEN (use TokenHub API Key) | Tencent Cloud MaaS platform |
| SiliconFlow | https://api.siliconflow.cn/v1/messages | (same as China) | ANTHROPIC_AUTH_TOKEN (use SiliconFlow API Key) | Supports both OpenAI and Anthropic APIs |
💡 What is this for? If you're using Claude Code, Claude Desktop, or any tool that natively speaks the Anthropic API, you can point it to these endpoints and use your Chinese LLM provider's API key – no code changes required beyond environment variables.
Alibaba Cloud (Qwen) – Detailed 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.
Usage Example (with Zhipu AI)
# Set environment variables for Anthropic client
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" # International
# export ANTHROPIC_BASE_URL="https://open.bigmodel.cn/api/anthropic" # Mainland China
export ANTHROPIC_AUTH_TOKEN="your-zhipu-api-key-here"Then run any Anthropic‑native tool (e.g., Claude Code):
claude --prompt "Write a Python function to reverse a linked list"The request will be transparently routed to Zhipu's GLM model through the Anthropic‑compatible gateway.
Python Example with Anthropic SDK
from anthropic import Anthropic
import os
# Example: Zhipu AI via Anthropic SDK (International endpoint)
client = Anthropic(
api_key=os.environ.get("ZHIPU_API_KEY"),
base_url="https://api.z.ai/api/anthropic"
)
response = client.messages.create(
model="glm-5.2", # Updated model name per Zhipu docs
max_tokens=1024,
messages=[{"role": "user", "content": "Explain quantum computing simply"}]
)
print(response.content[0].text)Notes:
- The model name parameter should match the provider's supported model names (e.g.,
glm-5.2for Zhipu,qwen-plusfor Qwen,MiniMax-M3for MiniMax,kimi-k2.7-codefor Kimi coding). - Not all providers support all Anthropic API features (e.g., streaming, tool use) – check each provider's documentation.
- For Alibaba Cloud, you must use the correct endpoint for your specific plan and replace
{WorkspaceId}with your actual ID.
Best Practice: Multi‑Provider Switching with Region & Protocol Awareness
In production, you may want to switch both provider and region, and even protocol (OpenAI vs Anthropic). Here's an extended config pattern:
from openai import OpenAI
from anthropic import Anthropic
import os
OPENAI_CONFIGS = {
"deepseek": {
"base_url": "https://api.deepseek.com",
"api_key": os.environ.get("DEEPSEEK_API_KEY"),
"default_model": "deepseek-v4-pro"
},
"qwen": {
"china": {
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": os.environ.get("DASHSCOPE_API_KEY"),
"default_model": "qwen-plus"
},
"intl": {
"base_url": "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
"api_key": os.environ.get("DASHSCOPE_API_KEY"),
"default_model": "qwen-plus"
}
},
# Add other providers similarly...
}
ANTHROPIC_CONFIGS = {
"zhipu": {
"china": {
"base_url": "https://open.bigmodel.cn/api/anthropic",
"api_key": os.environ.get("ZHIPU_API_KEY"),
"default_model": "glm-5.2"
},
"intl": {
"base_url": "https://api.z.ai/api/anthropic",
"api_key": os.environ.get("ZHIPU_API_KEY"),
"default_model": "glm-5.2"
}
},
# Add MiniMax, Kimi, etc. similarly
}
def get_openai_client(provider: str, region: str = "china"):
config = OPENAI_CONFIGS[provider]
if isinstance(config, dict) and region in config:
config = config[region]
return OpenAI(api_key=config["api_key"], base_url=config["base_url"])
def get_anthropic_client(provider: str, region: str = "china"):
config = ANTHROPIC_CONFIGS[provider]
if isinstance(config, dict) and region in config:
config = config[region]
return Anthropic(api_key=config["api_key"], base_url=config["base_url"])
# Usage examples
openai_client = get_openai_client("qwen", region="intl")
openai_response = openai_client.chat.completions.create(
model="qwen-plus",
messages=[{"role": "user", "content": "Hello from overseas!"}]
)
anthropic_client = get_anthropic_client("zhipu", region="intl")
anthropic_response = anthropic_client.messages.create(
model="glm-5.2",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)💡 Pro tip: Externalize all configs to a shared
config.jsonormodels.jsonfile. Your article and your upcoming tool page can share the exact same data source – ensuring consistency and easy updates.
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 (Python/JS/curl) | 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.