Codex without a ChatGPT subscription: pointing it at another API
Codex takes its provider from a config file, so you can point it anywhere compatible. Here is the exact config and what each field does.
3 min · · Updated · codex · subscriptions · setup
Codex is OpenAI's console agent, and by default it calls their API. But the provider comes from a config file, which means any compatible address can take OpenAI's place. For anyone who cannot pay for the subscription, this is the only working route.
The config
Codex reads ~/.codex/config.toml:
model = "gpt-5.6-sol"
model_provider = "zukko"
model_reasoning_effort = "high"
[model_providers.zukko]
name = "zukko"
base_url = "https://api.zukko.pro/v1"
wire_api = "responses"
requires_openai_auth = trueThe key lives separately, in ~/.codex/auth.json:
{ "OPENAI_API_KEY": "fetch_your_key" }The non-obvious fields:
wire_api = "responses" — Codex speaks the Responses API rather than classic chat/completions. Your provider must support it; any other value sends requests to the wrong place.
base_url with the /v1 suffix — mandatory for OpenAI-compatible mode. Omitting it produces a 404 on every call.
model_reasoning_effort controls how much the model thinks before answering. Higher means better and more expensive. On simple tasks high earns little.
Automatic setup
If you would rather not edit config files by hand, there are ready scripts. For macOS, codex-setup-macos.command: download it and double-click, or from a terminal:
curl -fsSLO https://zukko.pro/downloads/codex-setup-macos.command
chmod +x codex-setup-macos.command
open codex-setup-macos.commandFor Windows, codex-setup-windows.vbs: download the file and double-click it.
The script creates both files and asks for your key. If you dislike running scripts from the internet, that is sound caution — set it up by hand from the config above, it is only two files.
Choosing a model
The model field takes any model from the provider's catalogue. Codex is an agent: it makes many calls in sequence and keeps loading context, so input token price matters most.
Rough guide in the Zukko catalogue: gpt-5.6-sol is the flagship ($0.30/$0.30 per million), gpt-5.6-luna the cheaper option ($0.10/$0.10); test which suits you on your own tasks. Nothing stops you putting an Anthropic model in Codex either: the API is compatible, and claude-opus-5-5 works the same way. The current model list is GET https://api.zukko.pro/v1/models.
Errors
404 on every request. A missing /v1 in base_url, or the wrong wire_api.
401 unauthorized. The key was not picked up: check it sits in ~/.codex/auth.json and the field is named OPENAI_API_KEY — Codex looks for that name regardless of provider.
402. An empty balance.
Model not found. Compare the name against the catalogue: curl https://api.zukko.pro/v1/models -H "Authorization: Bearer fetch_your_key".
What it costs
You pay for the tokens you used, with no monthly fee. Zukko accepts card, bank transfer and crypto, and prices sit well below list: Claude Opus 5.5 costs $0.30/$0.30 per million tokens against Anthropic's official $4 input and $20 output. A caveat for agents with a large context: vendors charge ~10% of the input price for prompt-cache reads, while we bill cached tokens at the regular price, so the real gap is smaller than a straight comparison suggests.
To learn what your own Codex will consume, start small: top-ups start at $1. There is no starting balance, but subscribing to the @zukkopro channel credits $0.50 once (link Telegram in the dashboard).
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- opencode agents: setting up roles, models and toolsA custom agent in opencode is a role, a model and a set of permissions. A working config where a cheap model handles routine work and a stronger one edits code.
- OpenAI API Keys in the Open: Why You Should Not Use ThemWhere free keys on GitHub come from, why using them is dangerous for you and for the owner, and how to protect your own key from the same leak.
- GLM API Errors: Why the Request Fails and How to Fix ItA wrong model id, an overflowing 128K context, the key, the balance, limits: the typical causes of GLM API errors and a quick way to find yours.
- Plan mode in Claude Code: plan first, then edit the codeIn plan mode Claude Code reads your code and proposes a plan but edits nothing until you agree. How to enable it, use it and what it costs.