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

cheapaimodelの残高でOpenAI Codex CLIを動かします。



Codex CLIは設定ファイルでカスタムのモデルプロバイダーを追加できます。

## 設定 [#set-it-up]

キーを環境変数としてexportします。

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

続いて、`~/.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"
```

あとはいつもどおり`codex`を実行します。CodexはResponses APIのみを使用します。[モデルカタログ](/ja/models)で`/v1/responses`に対応しているモデルなら、`glm-5.3`の代わりに使えます。
