Skip to content

unexpected status 502 Bad Gateway: Codex xAI OAuth

Quick fix

The original post shows CC Switch writes wire_api = "responses"; no verifiable fix is available.

Error output
unexpected status 502 Bad Gateway: Unknown error
url: http://127.0.0.1:15721/v1/responses

On Windows 11 with CC Switch 3.20.2, the reporter enabled a local proxy for Codex using `xAI (Grok) OAuth` and `grok-4.6`. Even after changing protocol / Wire API from Responses to Chat in the CC Switch Codex provider UI, saving, and switching again, `~/.codex/config.toml` still contained `wire_api = "responses"`. Codex then requested `/v1/responses` through the local proxy and received 502.

The reporter said manually editing `config.toml` did not work because the next CC Switch switch or takeover wrote back `wire_api = "responses"`. Claude Code worked through the same proxy, but this does not prove that the Codex Responses path is fixed. The issue remains open, and the original post provides no verifiable solution.

  1. There is currently no confirmed fix or persistent configuration workaround: manually changing `wire_api` is overwritten by the next CC Switch switch or takeover. Follow later maintainer replies and verification results in issue #7360.

ToolCodex
Version3.20.2
PlatformsWindows
Why does it still request `/v1/responses` after changing protocol / Wire API to Chat in the CC Switch UI?
The report shows that `~/.codex/config.toml` is still written as `wire_api = "responses"`, so the Chat option in the UI does not take effect in this scenario.
Can manually editing `config.toml` fix it?
Not persistently. The reporter said the next CC Switch switch or takeover writes `wire_api = "responses"` again.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.