Skip to content

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

ProviderChina (Mainland) Base URLInternational Base URLEnv VariableRecommended Model (Aug 2026)
DeepSeekhttps://api.deepseek.com(same as China)DEEPSEEK_API_KEYdeepseek-v4-pro
Alibaba (Qwen)https://dashscope.aliyuncs.com/compatible-mode/v1https://dashscope-intl.aliyuncs.com/compatible-mode/v1DASHSCOPE_API_KEYqwen-plus
Zhipu AI (GLM)https://open.bigmodel.cn/api/paas/v4https://api.z.ai/api/paas/v4ZHIPU_API_KEYglm-5.3
Moonshot (Kimi)https://api.moonshot.cn/v1https://api.moonshot.ai/v1MOONSHOT_API_KEYkimi-k3
ByteDance (Doubao)https://ark.cn-beijing.volces.com/api/v3(via Volcano Engine International, see notes)ARK_API_KEYdoubao-pro-32k
Baidu (Wenxin)https://qianfan.baidubce.com/v2(no dedicated international endpoint, see notes)QIANFAN_API_KEYERNIE-4.0-Turbo-8K
MiniMaxhttps://api.minimaxi.com/v1https://api.minimax.io/v1MINIMAX_API_KEYMiniMax-M3
SiliconFlow (Aggregator)https://api.siliconflow.cn/v1https://api.siliconflow.com/v1SILICONFLOW_API_KEYQwen/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_url and api_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)

RegionBase 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-chat and deepseek-reasoner were 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)

RegionBase URL
Mainland Chinahttps://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-intl endpoint 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)

RegionBase URL
Mainland Chinahttps://open.bigmodel.cn/api/paas/v4
Internationalhttps://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-Flash is a free tier for testing.

4. Moonshot (Kimi)

Recommended model: kimi-k3 (general) or kimi-k3-long (ultra-long context)

RegionBase URL
Mainland Chinahttps://api.moonshot.cn/v1
Internationalhttps://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-k3 replaces older moonshot-v1 models. Use kimi-k3-long for 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)

RegionBase 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
InternationalNo 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)

RegionBase URL
Mainland Chinahttps://qianfan.baidubce.com/v2
InternationalNo 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_KEY is actually a combination of Access Key ID and Secret Access Key. You must obtain an access_token first. 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)

RegionBase URL
Mainland Chinahttps://api.minimaxi.com/v1
Internationalhttps://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) or api.minimaxi.com (China). Older abab6.5 series deprecated.
  • Supports video understanding and 1M+ token context.

8. SiliconFlow (Aggregator)

Recommended model: Qwen/Qwen2.5-7B-Instruct (great open‑source choice)

RegionBase URL
Mainland Chinahttps://api.siliconflow.cn/v1
Internationalhttps://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

ProviderChina (Mainland) Base URLInternational Base URLAuth Env VariableNotes
Zhipu AIhttps://open.bigmodel.cn/api/anthropichttps://api.z.ai/api/anthropicANTHROPIC_AUTH_TOKEN (use Zhipu API Key)Official "Claude API 用户特别搬家计划"
Alibaba (Qwen)See detailed table belowSee detailed table belowANTHROPIC_AUTH_TOKEN (use DashScope API Key)Address varies by plan and region
MiniMaxhttps://api.minimaxi.com/anthropichttps://api.minimax.io/anthropicANTHROPIC_AUTH_TOKEN (use MiniMax API Key)Official Anthropic-compatible support
Moonshot (Kimi)TBDhttps://api.moonshot.ai/anthropicANTHROPIC_AUTH_TOKEN (use Moonshot API Key)Coding-specific endpoint may be https://api.kimi.com/coding
Tencent (TokenHub)https://tokenhub.tencentmaas.com/plan/anthropichttps://tokenhub-intl.tencentmaas.com/plan/anthropicANTHROPIC_AUTH_TOKEN (use TokenHub API Key)Tencent Cloud MaaS platform
SiliconFlowhttps://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:

PlanChina (Mainland) Base URLInternational Base URL
Pay-as-you-gohttps://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/apps/anthropichttps://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Token Plan (Personal/Team)https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropichttps://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Coding Planhttps://coding.dashscope.aliyuncs.com/apps/anthropichttps://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.2 for Zhipu, qwen-plus for Qwen, MiniMax-M3 for MiniMax, kimi-k2.7-code for 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.json or models.json file. 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 LocationOpenAI‑CompatibleAnthropic‑Compatible
Mainland ChinaUse China endpointsUse China endpoints
Outside ChinaPrefer International endpointsPrefer International endpoints
No intl endpoint (Baidu, Doubao)Use China endpointN/A
Your Use CaseRecommended Protocol
General LLM integration (Python/JS/curl)OpenAI‑compatible (wider ecosystem)
Claude Code / Claude DesktopAnthropic‑compatible
Existing Anthropic SDK codebaseAnthropic‑compatible (minimal migration)

What’s Next

I keep this guide updated regularly.