# Codex CLI (/docs/guides/codex-cli)

Run OpenAI Codex CLI on your cheapaimodel balance.



Codex CLI supports custom model providers in its config file.

## Set it up [#set-it-up]

Export your key:

```bash title="~/.zshrc"
export CHEAPAIMODEL_API_KEY="sk-..."
```

Then add a provider to `~/.codex/config.toml`:

```toml title="~/.codex/config.toml"
model = "glm-5.3"
model_provider = "cheapaimodel"

[model_providers.cheapaimodel]
name = "cheapaimodel"
base_url = "https://api.cheapaimodel.ai/v1"
env_key = "CHEAPAIMODEL_API_KEY"
wire_api = "responses"
```

Run `codex` as usual. Codex speaks only the Responses API; any model in the [catalog](/models) that lists `/v1/responses` works in place of `glm-5.3`.
