GoodPut AI

Connect Codex CLI

Configure config.toml to switch between platform models.

Codex CLI connects through the OpenAI-compatible protocol. Add a custom model provider, then use -m to select any platform model.

Install Codex CLI

npm install -g @openai/codex

Add the GoodPut provider

~/.codex/config.toml
model_provider = "goodput"
model = "z-ai/glm-5.2"

[model_providers.goodput]
name = "GoodPut AI"
base_url = "https://api.goodputai.cn/v1"
env_key = "GOODPUT_API_KEY"

Set the key and start

export GOODPUT_API_KEY="YOUR_GOODPUT_API_KEY"
codex                                # Use the default model
codex -m deepseek/deepseek-v4-pro    # Switch models for this run

env_key names an environment variable. Codex reads the key from that variable at startup; do not put a plaintext key in config.toml.

Use the Responses protocol (optional)

The platform also supports OpenAI Responses (/v1/responses). To use it in Codex, add this line to the provider configuration:

[model_providers.goodput]
name = "GoodPut AI"
base_url = "https://api.goodputai.cn/v1"
env_key = "GOODPUT_API_KEY"
wire_api = "responses"

If a model has compatibility problems, remove wire_api to return to the default Chat Completions protocol.

On this page