Use Zhipu AI in Codex

Prices and modelsEndpoint verified 2026-11-09

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 gohttps://open.bigmodel.cn/api/v1Codex needs this dedicated Responses endpoint, not /api/paas/v4.Docs · verified 2026-11-09

Generate the config

Pick from the 5 models this provider sells, or type another model name.

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

ModelInputOutputRatio
GLM-5.3-FlashXglm-5.3-flashx$0.30$1.051.00×
GLM-5.3-Flashglm-5.3-flash$0.12$0.421.00×
GLM-5.3glm-5.3$1.20$4.201.00×
GLM-5.2glm-5.2$1.20$4.201.00×
GLM-5.1glm-5.1$0.899$3.601.00×
$ 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.

Codex configs for other providers