CheapAI

Documentation

Everything you need to plug CheapAI into your tooling — setup guides for popular agents, API reference, FAQ.

Codex

OpenAI Codex CLI

Create an API key on the Keys page and copy it.

Install Node.js 18+, then the Codex CLI:

bash
npm install -g @openai/codex

Add the provider to ~/.codex/config.toml (user-level only — Codex ignores project-local configs):

toml
model = "gpt-5.6-sol"
model_provider = "cheapai"

[model_providers.cheapai]
name = "CheapAI"
base_url = "https://cheapai.io/v1"
env_key = "CHEAPAI_API_KEY"
wire_api = "responses"
requires_openai_auth = true

Create ~/.codex/auth.json so Codex stops treating you as signed in with an OpenAI account:

json
{
  "auth_mode": "apikey",
  "OPENAI_API_KEY": "YOUR_API_KEY"
}
This step is easy to miss and it is the most common reason setup "silently does nothing": with a leftover OpenAI session Codex keeps using it and never touches your provider block, so you see no error at all - just the old account's quota.

Export your key — macOS / Linux (add to ~/.zshrc for persistence):

bash
export CHEAPAI_API_KEY="YOUR_API_KEY"

Windows PowerShell: $env:CHEAPAI_API_KEY = "YOUR_API_KEY"

Run codex. The model is any slug from our catalog (e.g. gpt-5.6-sol, claude-opus-4-8) without a vendor prefix.

Use wire_api = "responses" — Codex removed the chat mode in early 2026. The provider id can't be openai / ollama / lmstudio (reserved) — that's why we use cheapai.

Replace YOUR_API_KEY with a real key from the Keys section.