Invalid messages.content.type parameter; allowed value ['text']: Codex
Quick fix
Update to v3.20.2 and re-import the Zhipu GLM preset; to send images in Codex, choose a vision-capable model.
Symptom
Section titled “Symptom”CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Zhipu GLM; model: glm-5.1; upstream_status: HTTP 400; cause: messages.content.type 参数非法,取值范围 ['text']CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Zhipu GLM; model: glm-5.1; upstream_status: HTTP 400; cause: Invalid messages.content.type parameter; allowed value ['text']
When Codex sends images through `/responses`, the Zhipu Chat endpoint receives an image content part it does not accept and returns a `messages.content.type` 400 error. GLM text-only models (including glm-5.1, glm-5.2, and glm-5.3 mentioned in the issues) cannot process images directly. Early issue fixes included selecting the Chat Completions upstream format and enabling the image rectifier; maintainers later explained that v3.17.0 added glm-5.2 text-only capability detection and an image-stripping fallback. For glm-5.3, v3.20.2 changed the preset to the official Responses endpoint and marked it as text-only; after re-importing the preset, attaching an image should prompt that the model does not support images instead of failing with a 400 midway.
Update CC Switch to v3.20.2 or later and re-import the “Zhipu GLM” preset; existing cards do not automatically update their endpoint.
If you still use an older configuration, set “Upstream Format” to Chat Completions in the Zhipu GLM provider settings in Codex; for glm-5.2 image errors, maintainers also recommend enabling the rectifier in settings.
To send images in Codex, switch to a vision-capable model. Maintainers note that you can manually add a vision model in the provider card and enable image modality; the preset itself does not include glm-5.3v.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 6 real issues
- #4107在codex中,使用CCswitch切换国内模型(使用本地路由),重启后,如果发送的内容中含有图片,则报错
- #4173[Bug] Codex 走 Responses API 时图片未转换,第三方 provider(智谱等)报 content.type 非法
- #4554[Bug] Zhipu GLM provider returns HTTP 400 on Codex /responses endpoint — messages.content.type
- #4792CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Zhipu GLM5.2; model: glm-5.2; upstream_status: HTTP 400; cause: messages.content.type 参数非法,取值范围 ['text']
- #6151CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Zhipu GLM; model: glm-5.2; upstream_status: HTTP 400; cause: messages.content.type 参数非法,取值范围 ['text']
- #7142CC Switch local proxy failed while handling Codex endpoint /responses. Provider: Zhipu GLM; model: glm-5.3; upstream_status: HTTP 400; cause: messages.content.type 参数非法,取值范围 ['text']
- What should I do if the error persists after upgrading?
- Confirm that you re-imported the updated Zhipu GLM preset; old cards do not automatically update their endpoint. If the issue still reproduces, the issue maintainers recommend attaching a redacted request log.
- What should I do if the error persists after enabling the rectifier?
- Some users reported that the error persisted after enabling the rectifier; maintainers later explained that v3.17.0 added glm-5.2 to the text-only model capability table and completed image stripping and media failure fallback. If the original image scenario still reproduces after upgrading, attach a redacted request log.
- Can Zhipu GLM process images in Codex?
- Maintainers described glm-5.1, glm-5.2, and glm-5.3 mentioned in the issues as text-only models. To send images, choose a vision-capable model; maintainers note that you can manually add a model and enable image modality.
Related problems
Section titled “Related problems”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.