Skip to content

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.

Error output
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']
English translation

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.

  1. Update CC Switch to v3.20.2 or later and re-import the “Zhipu GLM” preset; existing cards do not automatically update their endpoint.

  2. 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.

  3. 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.

ToolCodex
Version3.16.2、3.16.3、3.16.4、3.19.1、3.20.1(报告版本)
PlatformsUnknown
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.

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.