Skip to content

Cannot directly use /v1/responses - Codex

Quick fix

Extract access_token and account_id from .codex/auth.json, add them to the request headers, then call the API.

Error output
将codex供应商oauth登录,并对codex开启路由后无法直接使用/v1/responses或chat接口,**即便我的设备上没有claudecode,也只能使用/v1/message接口进行通信**。
English translation

After logging in to the Codex provider with OAuth and enabling routing for Codex, `/v1/responses` or the chat endpoint cannot be used directly. **Even though claudecode is not installed on my device, I can communicate only through `/v1/message`.**

In the cc-switch 3.20.4 Codex routing scenario, direct requests to the exposed `/v1/responses` or chat endpoint do not work. The report states that routing returns messages normally after Codex OAuth credentials are provided manually.

The reporter also noted that Codex parameters appear to differ from the standard Responses API; some generic fields may be rejected and cause a 400 error. The issue does not confirm whether this behavior is intended to expose only the Anthropic backend.

  1. Extract `access_token` and `account_id` from `.codex/auth.json`.

  2. When calling `/v1/responses` or the chat endpoint, add the extracted credentials to the request headers before sending the request.

ToolCodex
Version3.20.4(受影响)
PlatformsLinux

This page is distilled from 1 real issues

Is availability limited to the Anthropic backend an intentional project design?
The issue does not confirm that this is intentional; the reporter found that routing worked normally after passing the token from `.codex/auth.json`.

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.