Skip to content

fix(litellm): route chatgpt codex via /responses to dodge Cloudflare challenge#469

Open
samxu01 wants to merge 1 commit into
mainfrom
fix/codex-responses-endpoint
Open

fix(litellm): route chatgpt codex via /responses to dodge Cloudflare challenge#469
samxu01 wants to merge 1 commit into
mainfrom
fix/codex-responses-endpoint

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented Jun 4, 2026

Summary

Dev agents (theo/nova/pixel/ops/aria + Cody) have been silently running on OpenRouter Nemotron instead of codex for days. Root cause is a LiteLLM endpoint-routing bug — not an OpenAI block, not auth, not the IP.

  • With model: chatgpt/gpt-5.4*, LiteLLM hits /backend-api/codex/chat/completions → Cloudflare returns a JS bot-challenge page (HTML, not JSON) → call fails → router silently falls back to Nemotron (no error logged, so it hid).
  • The /responses endpoint is not challenged. Prefixing the model with responses/ forces it.

Change

All 8 chatgpt/ model entries: chatgpt/gpt-5.4*chatgpt/responses/gpt-5.4*.

Verification (in-cluster, before the change)

  • chatgpt/responses/gpt-5.4-mini5/5 real completions, 0 Cloudflare challenges; gpt-5.4 also works.
  • chatgpt/gpt-5.4-mini (old) → Cloudflare challenge every time.

Why this is the right fix

  • Keeps everything on the existing ChatGPT-OAuth + rotator — no paid OpenAI API key needed.
  • Restores real codex for all dev agents (openclaw via LiteLLM + Cody) on one config change.
  • OAuth tokens were valid throughout (confirmed: official Codex CLI worked from the same pod). This matches [Bug]: Cannot use ChatGPT subscription sucessfully BerriAI/litellm#27175 (open bug + this exact workaround) and openclaw#68033 (same issue, fixed in their transport).

Post-deploy check

  • litellm pod picks up the new configmap (may need kubectl rollout restart deploy/litellm if no config checksum annotation)
  • Proxy call to openai-codex/gpt-5.4-mini returns returned_model: gpt-5.4-mini (not nemotron)
  • Rotator signals start referencing codex models (not just Nemotron)

🤖 Generated with Claude Code

…challenge

Dev agents (theo/nova/pixel/ops/aria + Cody) were silently running on OpenRouter
Nemotron instead of codex. Root cause: with model `chatgpt/gpt-5.4*`, LiteLLM's
chatgpt/ provider hits /backend-api/codex/chat/completions, which Cloudflare
serves a JS bot-challenge for (HTML, not JSON). The call fails and the router
silently falls back to Nemotron with no error surfaced, so it hid for days.

The /responses endpoint is NOT challenged. Prefixing the model with `responses/`
(`chatgpt/responses/gpt-5.4*`) forces it. Verified 5/5 reliable in-cluster: real
codex completions, zero Cloudflare challenges. OAuth tokens were valid the whole
time — this is a LiteLLM endpoint-routing bug, not an auth/IP/OpenAI block.

Ref: BerriAI/litellm#27175 (workaround), openclaw#68033 (same issue, fixed there).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant