Skip to content

Model does not support text/event-stream, Codex

Quick fix

Upgrade to cc-switch v3.16.4 and override the Accept request header in Codex advanced settings with a value accepted by the upstream.

Error output
LLM 本地部署模型:不支持请求头带有'Accept: text/event-stream' 
使用curl访问157721的代理,请求头不带上,就可以正常上游响应,带上,就会报上游406错误。
English translation

Locally deployed LLM model: does not support requests with the 'Accept: text/event-stream' header. When using curl to access the 157721 proxy, the upstream responds normally if this header is omitted; including it results in an upstream 406 error.

This locally deployed model does not accept the `Accept: text/event-stream` request header. Sending it through the proxy causes the upstream to return 406; omitting it allows a normal response.

The maintainer noted that cc-switch v3.16.4 adds local proxy request overrides. In the Codex provider form's advanced settings, you can customize request headers forwarded upstream. `Accept` is not on the protected-header allowlist and can be overridden. If streaming still fails after the override, the original post recommends providing a curl reproduction and the upstream response for further investigation.

  1. Upgrade cc-switch from v3.16.2 to v3.16.4.

  2. In the Codex provider form's advanced settings, use “local proxy request override (custom request headers/request body)” to override the `Accept` request header forwarded upstream.

  3. Change `Accept: text/event-stream` to a value accepted by the local model, such as `application/json` or `*/*`, then verify the upstream response.

ToolCodex
Version受影响:cc-switch v3.16.2;修复功能:v3.16.4
PlatformsUnknown

This page is distilled from 1 real issues

How should this be handled?
After upgrading to v3.16.4, override the `Accept` request header in Codex provider advanced settings with a value accepted by the local model. If streaming still fails, provide a curl reproduction and the upstream response for further investigation.

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.