Codex
Official Codex CLI and the VS Code plugin. Since February 2026 it only speaks /v1/responses — a custom provider goes in ~/.codex/config.toml.
Three fields. Copy, don’t type
https://cheapai.lol/v1
claude-opus-4.8
model = "claude-opus-4.8" model_provider = "cheapai" [model_providers.cheapai] name = "cheapai" base_url = "https://cheapai.lol/v1" env_key = "CHEAPAI_API_KEY" wire_api = "responses" requires_openai_auth = false
Do it in order. Don’t skip
Install Codex: npm install -g @openai/codex — or from the OpenAI site, link in the header. The VS Code / Cursor plugin reads the same config file.
User-level config only: ~/.codex/config.toml. On Windows: C:\Users\YourName\.codex\config.toml. The folder may be missing: mkdir -p ~/.codex, or in PowerShell mkdir "$env:USERPROFILE\.codex" -Force
Do not put this in a repo-local .codex/config.toml. Codex ignores model_provider, model_providers and openai_base_url there — the key will not attach.
Paste the block from the card. Do not name the provider openai, ollama or lmstudio — those IDs are reserved and will not take a custom address.
base_url is https://cheapai.lol/v1, with the /v1 tail and no trailing slash. Codex appends /responses itself.
wire_api = "responses" is required. chat has been a hard startup error since February 2026; switching it to chat/completions will not help.
Do not put the key in the file. Set the variable in the same window you launch Codex from. Mac/Linux: export CHEAPAI_API_KEY="sk-…". Windows PowerShell: $env:CHEAPAI_API_KEY="sk-…"
A lone openai_base_url on the built-in openai provider still expects an OpenAI login. You need a separate [model_providers.cheapai] table and model_provider = "cheapai".
Run: codex. Type “hi”. In the plugin pick claude-opus-4.8 — the name from the card, not gpt-5-codex from OpenAI’s site.
Check
codex replies to “hi” with model claude-opus-4.8. The plugin uses the same ~/.codex/config.toml.
If it didn’t start
- “wire_api = chat is no longer supported” — the file still says chat. Set responses, as on the card.
- Traffic still hits api.openai.com — model_provider = "cheapai" is missing, or you edited the repo .codex/ file instead of ~/.codex/config.toml.
- 401 / invalid token — this window cannot see CHEAPAI_API_KEY. Check with echo $CHEAPAI_API_KEY (PowerShell: echo $env:CHEAPAI_API_KEY). Close the terminal and the export is gone.
- 404 on /v1/v1/responses — extra path on base_url. Leave exactly https://cheapai.lol/v1.
- It asks you to sign in to ChatGPT — you landed on the built-in openai provider. The table name must not be openai.
- “401 / unauthorized / invalid api key” — the key was not copied whole. It starts with sk- and has no space at either end.
- “model not found” / “named models unavailable” / model in red — the name must match exactly: claude-opus-4.8. Not “Opus 5”, not opus, not claude-3, not gpt-4.
- The app shows no models — reopen its settings page: the model list is served from our address and appears once the Base URL and key are right.
- “Connection error” / spinner and silence — wrong Base URL. Almost every app wants the address with a /v1 tail.
- “/v1/v1” in the error — the app appends /v1 itself. Drop the tail, leave the site address.
- It replied, then stopped — you ran out of tokens. The balance is in your dashboard. Topping up on FunPay from the same nick lands on the same key.