Use Zhipu AI in Codex
Generate a Codex config from the Responses-compatible endpoint in Zhipu AI's docs. The API key in the config is a placeholder; replace it with a key you create at Zhipu AI.
Endpoints
- Pay as you go
https://open.bigmodel.cn/api/v1Codex needs this dedicated Responses endpoint, not /api/paas/v4.Docs · verified 2026-11-09
Generate the config
Save to ~/.codex/config.toml; merge it in if the file already exists
model = "glm-5.3"
model_provider = "zhipu"
[model_providers.zhipu]
name = "Zhipu AI"
base_url = "https://open.bigmodel.cn/api/v1"
env_key = "ZHIPU_API_KEY"
wire_api = "responses"
Models and prices
$ per 1M tokens. Each model uses the provider's cheapest group; the ratio uses the output price
How to check it works
Restart Codex and send a message. If it replies and the request shows up in Zhipu AI's console, it is using this endpoint.
FAQ
Why is the key in an environment variable?
config.toml only holds the variable's name, so the key never goes into the config file and does not leak when you share or sync it. To keep it, add the export line to ~/.zshrc or ~/.bashrc.
How do I switch back to OpenAI?
Remove the model_provider line from config.toml, then restart Codex.
Does my key pass through this site?
No. The page only generates config text and never asks for your key; the key only goes into the terminal or environment variables on your own machine.