Repository navigation
Description
Area
Multiple areas
What are you trying to accomplish?
I keep Codex Desktop authenticated with my ChatGPT account (needed for the phone remote app, voice, and threads), and I route model traffic through opencodex to external providers. When my OpenAI plan usage runs out, Codex Desktop shows the "You're out of Codex and Work usage" wall and refuses to start ANY new chat — including chats whose model is served by an external provider through opencodex and costs my OpenAI plan nothing.
What prevents this today?
Codex Desktop gates all new turns on the ChatGPT usage check (/backend-api/wham/usage). Once that endpoint reports the plan limit reached, the app blocks every composer action regardless of which model the request would use. The only workaround today is requires_openai_auth = false, which drops the ChatGPT login entirely and takes the phone remote app and voice with it.
What should OpenCodex do?
Offer an opt-in mode where Codex stays logged in, and the usage check no longer bricks the app once the plan limit is reached, while external-model chats keep flowing through the proxy. Concretely: when this mode is enabled, ocx sync should also point Codex's chatgpt_base_url at the opencodex loopback listener, which relays /backend-api/* to https://chatgpt.com and only rewrites the usage endpoint to report the limit as not reached (preserving account/window fields). Everything else passes through untouched with the real bearer token.
Example usage or interface
{
"port": 10100,
"hostname": "0.0.0.0",
"unauthenticatedLoopbackListener": { "enabled": true, "port": 10101 },
"codexQuotaMask": true
}Then ocx sync writes root chatgpt_base_url = "http://127.0.0.1:10101/backend-api" into ~/.codex/config.toml. After restarting Codex Desktop and logging in, the usage wall no longer blocks new chats, and model traffic still reaches external providers through the proxy.
Before: plan limit reached → every new chat blocked, even external models, until logout + requires_openai_auth = false.
After: plan limit reached → usage popup reports headroom, external-model chats work, ChatGPT login/remote/voice stay functional.
Alternatives or workarounds
requires_openai_auth = false: works for external models but destroys the ChatGPT login, phone remote control, and voice; not acceptable.- Waiting for the plan window to reset: no control over timing.
- Upstream fix in Codex Desktop: out of our hands; the wall affects every user mixing providers.
Additional context
The mask is deliberately narrow: only /backend-api/wham/usage is rewritten (allowed=true, limit_reached=false, upsell removed); every other backend-api request relays byte-for-byte with the caller's Authorization header, so login, threads, and voice keep working against the real backend. Default is off; nothing changes for users who do not opt in.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
Activity