Codex CLI (command line)
Download Codex CLI, then connect it to CheapAI with CC Switch or Folkbench Switch.
If you haven't installed a setup tool yet, start with Setup tools (required).
Install Codex CLI
Open Terminal, paste the official install command, and press Return:
curl -fsSL https://chatgpt.com/codex/install.sh | shOr install with Homebrew:
brew install --cask codexWhen it finishes, run codex --version to confirm. See also the official Codex CLI guide.
Configure with CC Switch
Open CC Switch, select Codex in the left sidebar, then click Add provider.

- Choose Custom

Fill in the following fields:
- Name:
CheapAI - API Key: paste the key from API Keys
- API URL:
https://cheapai.info/v1

- Name:
Scroll down and click Fetch model list.
In the Select models dialog, check the models you want, then click Apply.


After you click Fetch model list, check models in Select models, then click Apply. Scroll further to Advanced options and set Upstream format based on the models you use most:
- Mainly OpenAI (GPT) models: choose
Responses - Also using other domestic models: choose
Chat Completions - Mainly Anthropic (Claude) models: choose
Anthropic Messages

In Advanced options, set Upstream format based on the models you use most. - Mainly OpenAI (GPT) models: choose
- Click Add. CheapAI should show In use (if not, click ▷ on the card).

- Close and reopen the terminal, then run
codex
Configure with Folkbench Switch
Open Folkbench Switch, then:
- Switch to Pro in the top-right
- Select Codex in the top bar
- Click + Add service

- Choose Quick fill from listed sites

- Pick CheapAI in the list

In Prepare service, confirm and fill in:
- Protocol:
OpenAI Responses (recommended) - API Base URL:
https://cheapai.info/v1 - API Key: paste the key from API Keys
- Model: optional
Then click Save.

- Protocol:
Saving only adds it to the local list.
On the cheapai card at the bottom, click Switch.

- Restart
codex
Manual setup
If you prefer not to use CC Switch or Folkbench Switch, set CHEAPAI_API_KEY in your environment and merge these fields into your user-level ~/.codex/config.toml. Avoid duplicate TOML keys and choose a model that supports Responses.
model_provider = "cheapai"
model = "YOUR_MODEL_ID"
[model_providers.cheapai]
name = "CheapAI"
base_url = "https://cheapai.info/v1"
env_key = "CHEAPAI_API_KEY"
wire_api = "responses"
requires_openai_auth = false