Skip to content
Guides

Connect CheapLLM to Codex CLI

Add CheapLLM as a custom Codex provider and select an available model.

1. Prepare your API key

Create a CheapLLM key and export it in the same environment that runs Codex. Note that the CheapLLM site is still a demonstration and the API does not accept requests yet; the configuration below is the target setup.

Terminal
export CHEAPLLM_API_KEY="YOUR_CHEAPLLM_API_KEY"

2. Configure the provider

Open ~/.codex/config.toml and add a separate provider entry. Codex talks to the Responses API, and the config file holds the name of the environment variable instead of the credential.

~/.codex/config.toml
[model_providers.cheapllm]
name = "CheapLLM"
base_url = "https://api.cheapllm.com/v1"
env_key = "CHEAPLLM_API_KEY"
wire_api = "responses"

3. Select the model

In the same config.toml set the model identifier from your catalog and point Codex at the provider you just created.

~/.codex/config.toml
model = "MODEL_ID"
model_provider = "cheapllm"

4. Run Codex

Start Codex from the terminal where the key is set and send a test prompt. If an error appears, first check whether the selected model supports the Responses API.

Terminal
codex
All guides