Codex CLI connects to the VisionCoder gateway over the Responses protocol: set the gateway address, API key and model name, with copyable config, a verification command and common errors; 18 public models are available now, such as deepseek-v4-pro, deepseek-v4.1-flash, glm-5.2.
Home / Setup guides / Codex CLI
Protocol: Responses; checked 2026-11-10; 18 models available
Notice: The documentation does not say which path Codex appends to base_url. On 2026-11-10 this site checked it with Codex CLI 0.164.0 against a local mock server (not a real upstream): with base_url https://<gateway-host>/v1 Codex requests /v1/responses, which matches the gateway's Responses endpoint; without /v1 it requests /responses, which the gateway does not serve. A complete conversation has not been verified against a real upstream; if the connection fails, first confirm with the verification command below that the gateway itself works, then adjust against the official documentation.
Codex CLI speaks the Responses protocol (/v1/responses). The gateway does not convert protocols, so only models that declare it work. The wrong protocol returns 400 with the path to use instead.
Create a key and look up the gateway address on the API Keys page after signing in; below it appears as the placeholder <gateway-host>. Personal keys start with sk-u-, employee keys with sk-e-, organization tokens with sk-org-; all of them can call models. Management keys (sk-mgmt-) are rejected.
VISIONCODER_API_KEY; env_key in the next step refers to it.~/.codex/config.toml. Codex ignores model_provider and model_providers in a project's .codex/config.toml.[model_providers.<id>]: name is the display name, base_url is https://<gateway-host>/v1 (Codex appends /responses to it), env_key is the variable from the previous step, and wire_api is responses (the documentation says it is the only supported value and the default when omitted). <id> must not be a reserved name, for example openai, ollama or lmstudio.model to a model name from the table below and model_provider to the <id> above.codex.Shell environment variable (Bash / Zsh)
export VISIONCODER_API_KEY=sk-...
Config file ~/.codex/config.toml
model = "<model-name>"
model_provider = "visioncoder"
[model_providers.visioncoder]
name = "VisionCoder"
base_url = "https://<gateway-host>/v1"
env_key = "VISIONCODER_API_KEY"
wire_api = "responses"
Replace the model name with one from the table below; a JSON response means the gateway and key work.
curl https://<gateway-host>/v1/responses \
-H "Authorization: Bearer sk-..." \
-H "Content-Type: application/json" \
-d '{"model":"<model-name>","input":"Hello"}'
Only public models that declare the Responses protocol. Open a model for full pricing. Unit: CNY per million tokens.
| Model | Vendor | Region | Context | Input / output |
|---|---|---|---|---|
| deepseek-v4-pro | DeepSeek | domestic | 1M | ¥5.85 / ¥17.55 |
| deepseek-v4.1-flash | DeepSeek | domestic | 1M | ¥1.95 / ¥5.85 |
| glm-5.2 | GLM | domestic | 1M | ¥6.80 / ¥23.80 |
| glm-5.3 | GLM | domestic | 1M | ¥6.80 / ¥23.80 |
| gpt-5.6-sol | OpenAI | overseas | 1.05M | ¥2.75 / ¥16.50 |
| gpt-6-astra | OpenAI | overseas | 1.05M | ¥5.50 / ¥27.50 |
| gpt-6-sol | OpenAI | overseas | 1.05M | ¥1.10 / ¥5.50 |
| gpt-6.1-sol | OpenAI | overseas | 1.05M | ¥1.10 / ¥5.50 |
| gpt-6.2-astra | OpenAI | overseas | 1.05M | ¥4.40 / ¥22.00 |
| gpt-6.2-sol | OpenAI | overseas | 1.05M | ¥1.10 / ¥5.50 |
| grok-4.6 | xAI | overseas | 500K | ¥1.00 / ¥3.00 |
| grok-4.7 | xAI | overseas | 500K | ¥1.00 / ¥3.00 |
| kimi-k3 | Kimi | domestic | 1M | ¥17.00 / ¥85.00 |
| kimi-k3.1-pro | Kimi | domestic | 1M | ¥11.05 / ¥57.80 |
| qwen3.7-max-2026-06-08 | Qwen | domestic | 1M | ¥10.20 / ¥30.60 |
| qwen3.7-plus-2026-05-26 | Qwen | domestic | 1M | ¥1.70 / ¥6.80 |
| qwen3.8-flash | Qwen | domestic | 1M | ¥0.68 / ¥2.295 |
| qwen3.8-max-0902 | Qwen | domestic | 200K | ¥10.20 / ¥30.60 |
| Symptom | Cause and fix | Source |
|---|---|---|
| The custom provider has no effect, or Codex refuses to override a built-in provider | <id> must not be a reserved name such as openai, ollama or lmstudio, and model_providers belongs in ~/.codex/config.toml: it is ignored in a project's .codex/config.toml. | Official docs |
| 401, key rejected | Check that the variable named by env_key has a value in the terminal that starts codex, and that the key was created on VisionCoder and is still active. (error code 401060) | Gateway |
| 400, model does not support this endpoint | The model does not declare the Responses protocol; the response lists the paths it does support. Use only models from the table. (error code 400159) | Gateway |
| 404, model not found | The model name is misspelled or does not exist; it must match the table exactly. (error code 404042) | Gateway |
| 403, model unavailable | The model exists, but the workspace of your key cannot call it. (error code 403060) | Gateway |
| The error message starts with [402070] or [402072]: insufficient or used-up credit | The account has no usable credit; buy a plan or a top-up pack first, or ask your administrator if you belong to a company. Tools show different HTTP status codes for this error, so go by the error number at the start of the message. (error code 402070, 402072) | Gateway |
| The error message starts with [402073]: the plan has expired | The plan has expired; buy a plan or a top-up pack, or ask your administrator if you belong to a company. (error code 402073) | Gateway |
| The error message starts with [402074]: the monthly usage cap is reached | The company token has reached its monthly usage cap; ask the company administrator. (error code 402074) | Gateway |
| 429, rate limited | Too many requests or too many in flight; retry later or wait for the current requests to finish. (error code 429000, 429060, 429062, 429063) | Gateway |
| The error message starts with [503060]: no healthy channel | The model has no healthy channel right now; retry later. Tools show different HTTP status codes for this error, so go by the error number at the start of the message. (error code 503060) | Gateway |
Checked 2026-11-10. Unofficial guide: VisionCoder is not affiliated with the owners of Codex CLI, whose name and trademarks belong to them. The steps follow its official documentation and may differ after tool updates; the official documentation prevails.