The Complete Guide to Connecting Codex CLI to Chinese LLMs: Responses API Requirements and Every Working Bridge

OpenAI’s Codex CLI is one of the most-watched AI coding terminals of 2025-2026. It ships bound to a ChatGPT account, but since third-party model support officially opened in early 2026, demand for plugging in Chinese LLMs has surged — for obvious reasons. DeepSeek V4 Flash output costs roughly one-fiftieth of GPT-5.3-codex, and Qwen3-Coder outperforms same-size overseas models on Chinese-language codebases.

The road there is bumpy, though, because of one protocol-level fact: Codex CLI speaks the OpenAI Responses API, while the vast majority of Chinese model platforms have only implemented the older Chat Completions API. This guide starts at the protocol layer, covers four viable connection paths in priority order, and gives reference configs for every major platform.

The Core Problem: Responses API Is Not Chat Completions

Since 2026, Codex CLI’s wire_api setting supports exactly one value: "responses". This is not a backward-compatible extension of Chat Completions. Responses API is OpenAI’s redesign for agentic workloads — native tool calling, multimodal input, streaming, and server-side state management — whereas Chat Completions is the classic completion interface.

The practical consequence: even if a model is OpenAI-compatible, a platform that only implements the Chat Completions endpoint will return 404 to every request Codex sends. Your key works; your endpoint matches; the protocol doesn’t.

There are four ways across the gap, ordered by recommendation:

  1. Direct connection — the platform natively supports Responses API. Zero middlemen, most stable.
  2. Compute aggregators — call models that lack native Responses support through platforms like Alibaba DashScope or Baidu Qianfan.
  3. Bridge proxy services — third-party cloud services that translate the protocol.
  4. Local proxy — you run the translation layer yourself.

Preparation: How the Config Is Structured

Codex keeps its configuration in the ~/.codex/ directory:

~/.codex/
├── config.toml    # main config: model, providers, feature flags
└── auth.json      # credentials: API keys

A standard custom provider block takes six lines:

model_provider = "my-provider"
model = "my-model"

[model_providers.my-provider]
name = "My Provider"
base_url = "https://api.example.com/v1"
env_key = "MY_API_KEY"
wire_api = "responses"

In 2026 the wire_api line can be omitted — "responses" is the default. Authentication comes in three flavors: env_key (recommended, safest), experimental_bearer_token (not recommended), and the [auth] command-based token for short-lived credentials.

Path A: Direct Connections — Platforms With Native Responses Support

These platforms already implement Responses API and can be configured straight into Codex.

Alibaba DashScope (Qwen family)

DashScope was the first Chinese platform to support Responses API and remains the most complete: built-in web search, code interpreter, and web-fetch tools, session caching, and five-tier reasoning control.

auth.json:

{
  "DASHSCOPE_API_KEY": "your DashScope API key"
}

config.toml:

model_provider = "dashscope"
model = "qwen3-coder-plus"
model_reasoning_effort = "high"
model_context_window = 262144
model_auto_compact_token_limit = 200000

[model_providers.dashscope]
name = "DashScope"
base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1"
env_key = "DASHSCOPE_API_KEY"

Recommended models: qwen3-coder-plus (strongest for code), qwen3.7-plus (strongest general reasoning).

  • Built-in tools activate directly: web_search, code_interpreter.
  • Session caching: add the header x-dashscope-session-cache: enable and context is cached automatically (minimum 1,024 tokens, five-minute TTL).
  • Five-tier reasoning control: none / minimal / low / medium / high.
  • Multi-region deployment: China, Singapore, US, and Germany endpoints.

Baidu Qianfan (DeepSeek / GLM / Qwen)

Qianfan is a compute aggregator, and its core value is exactly that: it lets you reach models like DeepSeek that have no native Responses API by routing through Qianfan’s compatible layer.

auth.json:

{
  "QIANFAN_API_KEY": "bce-v3/your Qianfan API key"
}

config.toml, using DeepSeek-v4-pro as the example:

model_provider = "qianfan"
model = "deepseek-v4-pro"
model_reasoning_effort = "high"
model_context_window = 131072
model_auto_compact_token_limit = 100000

[model_providers.qianfan]
name = "Qianfan"
base_url = "https://qianfan.baidubce.com/v2"
env_key = "QIANFAN_API_KEY"

Qianfan’s distinct advantages: MCP protocol support (declare MCP servers in the tools parameter and the model can call Baidu AI Search and other external tools automatically); one endpoint covering the DeepSeek, GLM, and Qwen families; full function calling plus structured output. Supported models include DeepSeek-v4-pro, DeepSeek-v4-flash, DeepSeek-v3.2 (with think mode), GLM-5.1, GLM-5, Qwen3-coder-480b, and Qwen3-235b.

StepFun

StepFun’s Responses API is early-stage, but multimodal (image plus video) and reasoning controls are in place:

model_provider = "stepfun"
model = "step-3.7-flash"
model_reasoning_effort = "high"
model_context_window = 256000
model_auto_compact_token_limit = 200000
model_reasoning_summary = "none"
model_supports_reasoning_summaries = false
preferred_auth_method = "apikey"

[model_providers.stepfun]
name = "StepFun"
base_url = "https://api.stepfun.com/v1"

Note the two flags: StepFun does not support reasoning summaries, so model_reasoning_summary = "none" and model_supports_reasoning_summaries = false must be set explicitly or requests will fail.

MiniMax

MiniMax is currently the only Chinese platform serving /v1/responses as its primary interface — the smoothest onboarding of the bunch:

model_provider = "minimax"
model = "MiniMax-M3"
model_reasoning_effort = "high"
model_context_window = 1048576
model_auto_compact_token_limit = 800000

[model_providers.minimax]
name = "MiniMax"
base_url = "https://api.minimaxi.com/v1"

MiniMax M3 supports a one-million-token context window, which makes it the natural pick for code review across large repositories.

Volcano Ark (Doubao family)

auth.json:

{
  "ARK_API_KEY": "your Volcano Ark API key"
}

config.toml:

model_provider = "volcark"
model = "your-endpoint-id"
model_reasoning_effort = "high"
model_context_window = 32768
model_auto_compact_token_limit = 25000

[model_providers.volcark]
name = "VolcanoArk"
base_url = "https://ark.cn-beijing.volces.com/api/v3"
env_key = "ARK_API_KEY"

The one gotcha: on Volcano Ark, the model field takes the endpoint ID you create in the console (something like ep-20250xxx), not the model’s name.

Paths B and C: Bridging Models Without Responses Support

DeepSeek’s official API, Kimi, Zhipu GLM, and SiliconFlow currently serve Chat Completions only and cannot connect to Codex directly. Two workarounds exist.

Bridge proxy service: NovAI. NovAI (aiapi-pro.com) is currently the only third-party platform offering Responses API bridging, translating Responses requests into Chat Completions automatically:

model_provider = "novai"
model = "glm-5"

[model_providers.novai]
name = "NovAI"
base_url = "https://aiapi-pro.com/v1"
env_key = "NOVAI_API_KEY"
{
  "NOVAI_API_KEY": "nvai-your NovAI API key"
}

Coverage includes GLM-5, GLM-5-Turbo, and MiniMax-Text-01, and new accounts get a $2 credit.

Local proxy: codex-cn-bridge. An open-source option for developers who don’t want a third-party cloud in the loop:

# install and run the local proxy (forwards to any Chat Completions endpoint)
npx codex-cn-bridge --port 8080 --target https://api.deepseek.com/v1

The matching Codex config:

model_provider = "local-deepseek"
model = "deepseek-chat"

[model_providers.local-deepseek]
name = "Local DeepSeek"
base_url = "http://localhost:8080/v1"

The approach is fully transparent: Codex believes it is talking to a Responses endpoint while every request is actually translated and forwarded to DeepSeek’s Chat Completions interface.

Beyond the purpose-built options, generic gateways work too: OpenRouter now speaks Responses API with one key across hundreds of models and unified billing; LiteLLM is the open-source gateway you can self-host for protocol conversion across nearly every Chinese model; and 4SAPI is a domestic aggregation gateway purpose-built for Chinese models with multi-model routing and key management built in.

Choosing Between Them

RouteLatencyCostModel choiceOps burdenBest for
DashScope directLowMediumQwen familyNoneDefault pick; heavy Qwen users
Qianfan directLowMediumDeepSeek + GLM + QwenNoneDefault pick for DeepSeek or GLM
MiniMax directLowMediumMiniMax M3NoneVery large contexts
Volcano Ark directLowMediumDoubao familyLowDeep ByteDance-ecosystem ties
NovAI bridgeMediumLowBroadNoneZero-config bridging in one stop
Local proxyLowLowestAny Chat-format modelMediumDeep customization; privacy-sensitive
LiteLLM / OpenRouterMediumVariableVery broadMediumTeam-level multi-model governance

Hands-On: Code Review With Codex

Once configured, daily operation is identical to the native experience:

# review uncommitted changes
codex review --uncommitted

# review specific files
codex review --uncommitted src/utils.ts

# non-interactive mode, output to file
codex exec -o review.md "review the current uncommitted changes; list potential bugs, readability issues, and improvement suggestions"

To verify the connection:

codex exec "which model are you?"

If the CLI header shows the correct model and provider, you are connected.

What It Costs

July 2026 prices, per one million output tokens: GPT-5.3-codex runs $14 via API key; ChatGPT Plus is $20 per month but capped at 20-100 messages per five-hour window; DeepSeek V4 Flash through Qianfan lands near $0.28; Qwen3-Coder-Plus through DashScope around $0.80; MiniMax M3 at $1.20; a local Ollama setup costs nothing beyond hardware.

The highest-value strategy right now: route the grunt work to Chinese models and save planning-and-debugging sessions for ChatGPT Plus quota. The combination beats either side alone.

The Bottom Line

Connecting Codex CLI to Chinese LLMs is, at its core, a protocol adaptation problem. Prefer platforms with native Responses API support — DashScope, Qianfan, MiniMax, StepFun, Volcano Ark — and bridge the rest with NovAI or a local proxy.

The config itself is six lines of TOML plus one API key. Once it runs, the experience is indistinguishable from native ChatGPT mode — at one-tenth to one-fiftieth of the cost. For developers working in Chinese, this is not the budget alternative; it is the better setup: lower latency, lower cost, sharper comprehension of Chinese requirements, and no VPN required.

Related News