Hit the Codex weekly limit? The cheapest API fallback
Updated 2026-11-03. Official OpenAI, DeepSeek and MiniMax docs, LMArena ranks.
When you hit the Codex weekly limit, the cheapest fallback that still codes well is DeepSeek V4.1 Flash, plugged into Codex as a custom provider: about $1.25 for our sample session at peak and $0.62 off-peak, ranked #12 of 50 on LMArena's Code Arena. Staying with OpenAI, Codex credits and an API key cost the same per token: about $4.90 a session on GPT-6.1 Terra and $9.80 on GPT-6.1 Sol. Or wait for your reset, which costs nothing.
| Fallback | Per session | 10 sessions | Code Arena rank |
|---|---|---|---|
| GPT-6.1 Sol | $9.80 | $98.00 | #4 of 50 |
| GPT-6.1 Terra | $4.90 | $49.00 | #11 of 50 |
| GPT-6 Luna | $0.53 | $5.30 | #27 of 50 |
| DeepSeek V4.1 Flash, peak | $1.25 | $12.48 | #12 of 50 |
| DeepSeek V4.1 Flash, off-peak | $0.62 | $6.24 | #12 of 50 |
| DeepSeek V4 Pro, peak | $4.97 | $49.72 | #38 of 50 |
| MiniMax-M3.1 Flash | $0.72 | $7.20 | #26 of 50 |
Our estimate. One sample session is 2M fresh input, 8M cached input and 0.5M output tokens, the same session we use for the Claude fallback guide, priced at each provider's list rate checked 2026-11-03. Credit counts come from OpenAI's Codex rate card; the dollar figure assumes about $0.04 a credit (our estimate, see below). Off-peak is DeepSeek's half-price window. Ranks are LMArena Code Arena positions among the models we price.
What happens when you hit the Codex weekly limit
Codex stops taking new turns until your limit resets, though a turn already running can finish, per OpenAI's Codex pricing page. Plus has a 5-hour window and a weekly limit; Pro plans currently have only the weekly one. Your exact reset times are in the usage dashboard, or type /status in the CLI. See Codex usage limit reached and when Codex resets.
OpenAI lists two ways to keep going: Plus and Pro can buy credits, and anyone can run extra local chats with an API key at standard API rates. You can also point Codex at another provider. If the reset is a day away, waiting is the cheapest option on this page.
Codex credits vs an OpenAI API key: same price per token
They cost the same. The credit rates for GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna on OpenAI's rate card are exactly 25 times their API prices: GPT-6.1 Sol is 50 credits per 1M input tokens in Codex and $2 on the API pricing page. OpenAI doesn't print a dollar price per credit, so we work it out at about $0.04 (our estimate, explained in Codex credits: what they cost). Our sample session is 245 credits on Sol, or about $9.80.
The difference is what you keep. Credits run on your ChatGPT login, so Codex cloud, GitHub code review and the Slack integration keep working. An API key covers the CLI, SDK and IDE extension only, with no cloud features, per OpenAI.
API keys also carry a long-prompt surcharge. Prompts over 272K tokens bill GPT-6.1 Sol at $4 in and $15 out per 1M tokens on the API. OpenAI says Sol usage drawn from your subscription has no long-context surcharge, and it doesn't say the same for API keys. Keep threads short if you switch.
Switch to a cheaper OpenAI model first
Model choice moves the bill more than anything else. GPT-6.1 Terra costs half of Sol per token ($1 / $5 vs $2 / $10), so our session drops to $4.90. GPT-6 Luna is $0.10 / $0.50, about $0.53 a session, though it ranks #27 of 50 on Code Arena against Terra's #11 of 50. Switch with /model before you buy anything. More in GPT-6.1 Terra vs Sol.
How to use an OpenAI API key in Codex
Pipe the key to the CLI: printenv OPENAI_API_KEY | codex login --with-api-key. In the desktop app or IDE extension, sign out and pick the API key option. From then on Codex bills your OpenAI Platform account at standard API rates instead of your plan, per OpenAI's Codex sign-in docs. Run codex login status to check which one is active.
One trap for Pro subscribers: the $100 to $500 of monthly API credits that come with Pro don't pay for this. OpenAI's API credits guide says "Codex usage through API keys is not supported by this benefit." Details in ChatGPT Pro API credits.
How to run DeepSeek V4.1 Flash in Codex
Codex talks to models through the Responses API, and DeepSeek supports it natively, per its Codex setup guide. The quickest route is DeepSeek's setup script: option 1 sets Codex to deepseek-flash, option 2 to deepseek-v4-pro, and option 9 restores your old config. It backs up ~/.codex/config.toml to ~/.codex/backup-deepseek/ first.
By hand, you add a [model_providers.deepseek] section with base_url = "https://api.deepseek.com/" and wire_api = "responses", set model = "deepseek-flash", and give it your DeepSeek key. The CLI, the ChatGPT desktop app and the IDE extension share that file, so one edit covers all three.
DeepSeek V4.1 Flash costs $0.30 in, $0.006 cached and $1.20 out per 1M tokens at peak, and off-peak is half, per DeepSeek's pricing page. Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday. In US Eastern time (EST) that's 8 PM to 11 PM and 1 AM to 5 AM, so a normal US workday is off-peak. See DeepSeek off-peak hours.
Two catches. Built-in web search only works with deepseek-v4-pro, and DeepSeek bills those searches at its Search API price ($0.75 per 1,000). V4 Pro also costs more ($4.97 a session at peak) and ranks #38 of 50, below Flash, so Flash is the better pick for coding. And your prompts and code go to DeepSeek under its terms, not OpenAI's.
How to run MiniMax-M3.1 Flash in Codex
MiniMax documents a Codex setup with model = "MiniMax-M3.1-Flash", base_url = "https://api.minimax.io/v1" and wire_api = "responses", and recommends Codex CLI 0.146.0 or newer. Its manual setup uses an M Plan subscription key. Its setup wizard (npx -y mmx-cli@latest agent setup) also takes pay-as-you-go keys, which bill separately.
Pay as you go, it's $0.15 in and $0.60 out per 1M tokens with no peak pricing, about $0.72 for our sample session. It ranks #26 of 50 on Code Arena, well behind DeepSeek V4.1 Flash, so DeepSeek is the better value unless you already pay for the M Plan. See MiniMax API pricing.
Should you upgrade to Pro instead?
Upgrade if you hit the limit most weeks. Pro 100 costs $100 a month against $20 for Plus, and it currently has no five-hour limit. The $80 gap buys about 8 sample sessions on GPT-6.1 Sol through credits or an API key, about 16 on Terra, or about 64 on DeepSeek V4.1 Flash at peak (our math). If you run out once a month, a fallback is cheaper. If it happens every week, Pro usually wins. See is ChatGPT Pro worth it.
How to switch Codex back to your ChatGPT plan
If you used an API key, run codex logout, then codex login and sign in with ChatGPT. If you added DeepSeek or MiniMax, run DeepSeek's script with option 9 or remove the model, model_provider, login-method and provider lines from ~/.codex/config.toml, then restart Codex. Your old sessions come back too: Codex keeps ChatGPT and third-party sessions in separate groups and only shows the one that matches your current setup, per DeepSeek.
Related comparisons
- GPT-6.1 Sol vs GPT-6.1 Terra and DeepSeek V4.1 Flash vs GPT-6 Luna.
- MiniMax-M3.1 Flash vs DeepSeek V4.1 Flash and Codex plan vs paying for the API.
- Claude weekly limit hit: cheapest API fallback and the cheapest LLM APIs.
Sources
- Codex pricing, usage limits and credit rate card (OpenAI)
- Codex authentication (OpenAI)
- API credits for ChatGPT subscribers (OpenAI)
- OpenAI API pricing (official)
- DeepSeek: integrate with Codex (official)
- DeepSeek models and pricing (official)
- MiniMax: Codex setup (official)
- MiniMax CLI setup wizard (official)
- LMArena leaderboard dataset (CC BY 4.0)
FAQ
What can I do when I hit the Codex weekly limit?
Wait for the reset, buy Codex credits (Plus and Pro), or sign in with an OpenAI API key and pay standard API rates, per OpenAI. You can also set Codex up with another provider's API, like DeepSeek's.
What is the cheapest way to keep using Codex after the limit?
DeepSeek V4.1 Flash as a Codex provider, at about $1.25 for our sample session at peak and $0.62 off-peak. Within OpenAI, GPT-6.1 Terra is about $4.90 and GPT-6 Luna about $0.53.
Are Codex credits cheaper than an API key?
No. The Codex credit rates for GPT-6.1 Sol, Terra and GPT-6 Luna are 25 times their API prices, so at about $0.04 a credit they cost the same per token. Credits keep cloud features; an API key doesn't.
Can Codex use DeepSeek?
Yes. DeepSeek supports the Responses API that Codex uses and publishes a setup script and a config.toml example with model = "deepseek-flash".
Do ChatGPT Pro API credits cover Codex with an API key?
No. OpenAI says Codex usage through API keys isn't covered by the monthly API credits, and they don't raise signed-in Codex limits either.
Where did my Codex sessions go after switching to DeepSeek?
Nowhere. Codex groups sessions by login method and only shows the group for your current setup. Switch back and they reappear.
Related
- Codex plans and limits
- Codex usage limit reached
- Codex limits explained
- Codex credits
- When does Codex reset?
- DeepSeek off-peak hours
- ChatGPT Pro API credits
More guides
- Cheapest paid AI chat plans in 2026, ranked
- OpenAI vs Anthropic API pricing
- OpenAI vs Gemini API pricing
- Qwen API pricing tiers explained
- StepFun API pricing explained
- AI plans with weekly usage limits
Not sure a plan beats the API for you? Try the plan vs API cost calculator.