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 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

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)ARK_API_KEYdoubao-pro-32k
Baidu (Wenxin)https://qianfan.baidubce.com/v2(no dedicated endpoint)QIANFAN_API_KEYERNIE-4.0-Turbo-8K
MiniMaxhttps://api.minimaxi.com/v1https://api.minimax.io/v1MINIMAX_API_KEYMiniMax-M3
SiliconFlowhttps://api.siliconflow.cn/v1https://api.siliconflow.com/v1SILICONFLOW_API_KEYQwen/Qwen2.5-7B-Instruct

Quick Reference – Anthropic Compatible Endpoints

ProviderChina (Mainland) Base URLInternational Base URLEnv VariableRecommended Model (Aug 2026)
DeepSeekhttps://api.deepseek.com/anthropic(same as China)ANTHROPIC_AUTH_TOKEN (use DeepSeek API Key)deepseek-v4-pro
Zhipu AIhttps://open.bigmodel.cn/api/anthropichttps://api.z.ai/api/anthropicANTHROPIC_AUTH_TOKEN (use Zhipu API Key)glm-5.2
Alibaba (Qwen)See detailed table belowSee detailed table belowANTHROPIC_AUTH_TOKEN (use DashScope API Key)qwen-plus
MiniMaxhttps://api.minimaxi.com/anthropichttps://api.minimax.io/anthropicANTHROPIC_AUTH_TOKEN (use MiniMax API Key)MiniMax-M3
Moonshot (Kimi)TBDhttps://api.moonshot.ai/anthropicANTHROPIC_AUTH_TOKEN (use Moonshot API Key)kimi-k3
Tencent (TokenHub)https://tokenhub.tencentmaas.com/plan/anthropichttps://tokenhub-intl.tencentmaas.com/plan/anthropicANTHROPIC_AUTH_TOKEN (use TokenHub API Key)—
SiliconFlowhttps://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:

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.


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_TOKEN instead of YOUR_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-chat and deepseek-reasoner deprecated (July 2026). Use deepseek-v4-pro or deepseek-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 | Intl https://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 | Intl https://api.z.ai/api/paas/v4
  • Anthropic: China https://open.bigmodel.cn/api/anthropic | Intl https://api.z.ai/api/anthropic
  • Key: ZHIPU_API_KEY
  • Recommended: glm-5.3 (OpenAI) / glm-5.2 (Anthropic); GLM-4-Flash is free for testing.

4. Moonshot (Kimi)

  • OpenAI: China https://api.moonshot.cn/v1 | Intl https://api.moonshot.ai/v1
  • Anthropic: Intl https://api.moonshot.ai/anthropic (China TBD)
  • Key: MOONSHOT_API_KEY
  • Use kimi-k3 (general) or kimi-k3-long (long context); replaced older moonshot-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) or ERNIE-Speed-128K
  • No international or Anthropic endpoints documented.

7. MiniMax

  • OpenAI: China https://api.minimaxi.com/v1 | Intl https://api.minimax.io/v1
  • Anthropic: China https://api.minimaxi.com/anthropic | Intl https://api.minimax.io/anthropic
  • Key: MINIMAX_API_KEY
  • Use MiniMax-M3 – older abab6.5 series deprecated.
  • Supports video understanding and 1M+ token context.

8. SiliconFlow

  • OpenAI: China https://api.siliconflow.cn/v1 | Intl https://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-Instruct as a solid default.

9. Tencent (TokenHub) – Anthropic only

  • Anthropic: China https://tokenhub.tencentmaas.com/plan/anthropic | Intl https://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.json file – this guide and the Model Catalog tool can share it for consistency.


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 integrationOpenAI‑compatible (wider ecosystem)
Claude Code / Claude DesktopAnthropic‑compatible
Existing Anthropic SDK codebaseAnthropic‑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.