GLM 未找到可用模型 - Codex / CC Switch
Quick fix
Upgrade to cc-switch v3.20.4 and re-add the GLM provider from the preset with https://open.bigmodel.cn/api/v1 for Codex.
Symptom
Section titled “Symptom”增加GLM模型,官方推荐的地址就是https://open.bigmodel.cn/api/v1,但是获取模型时提示无法获取到模型,导致无法正常使用After adding a GLM model, the officially recommended address is https://open.bigmodel.cn/api/v1, but retrieving models reports that no models can be retrieved, preventing normal use.
This issue has two causes. First, the preset address is incorrect: earlier cc-switch versions configured the default GLM address for Codex as a Chat Completions endpoint, while native Codex support requires the dedicated OpenAI Responses endpoint https://open.bigmodel.cn/api/v1. The preset changed to the official Responses endpoint in v3.20.2, but existing providers still point to the old address and must be re-added from the preset.
Second, model-list parsing fails: with https://open.bigmodel.cn/api/v1 in Codex, the /models endpoint returns models[].slug rather than OpenAI-compatible data[].id. v3.20.3 and earlier only recognize data[].id, resulting in an empty list and the message 「未找到可用模型」. PR #7330 (commit f49c7d68a) reads models[].slug when no data field exists; the fix was released in v3.20.4. Note that coding plan uses https://open.bigmodel.cn/api/coding/paas/v4, and that endpoint cannot retrieve a model list. An invalid API Key may also return an empty result.
Upgrade cc-switch to v3.20.4 or later. This version includes PR #7330 and can parse the models[].slug model-list format returned by the GLM Responses endpoint.
Delete the old GLM provider and re-add it from the preset so Codex uses the official Responses endpoint https://open.bigmodel.cn/api/v1(v3.20.2 and earlier providers still point to the Chat endpoint and do not update automatically).
cc-switch 供应商配置中的 GLM 地址(Codex / OpenAI Responses 协议) base_url = "https://open.bigmodel.cn/api/v1"Paste a valid API Key and click 「获取模型」 again. The listed models depend on the actual response from the GLM API.
If you use a GLM coding plan with the Chat Completions upstream format, manually change the address to https://open.bigmodel.cn/api/coding/paas/v4. The coding plan endpoint cannot retrieve a model list, so enter the model name manually.
cc-switch 供应商配置中的 GLM 地址(coding plan,Chat Completions 上游) base_url = "https://open.bigmodel.cn/api/coding/paas/v4"If no models are found after upgrading, first verify that the API Key is valid. An invalid Key may also cause the GLM API to return an empty list.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- What if it is not a coding plan?
- For non-coding plan Codex usage, use the official Responses endpoint https://open.bigmodel.cn/api/v1(v3.20.2 preset default) and upgrade to v3.20.4 to retrieve the model list normally.
- Does 3.20.3 have this issue, and is there a solution?
- Yes. Upgrade to v3.20.4. It includes PR #7330 and supports models[].slug returned by the GLM /models endpoint; previously, only data[].id was recognized, producing an empty list.
- Why can I not retrieve models even though I already use the officially recommended https://open.bigmodel.cn/api/v1?
- Two common causes are a cc-switch version earlier than v3.20.4, which cannot parse models[].slug returned by this endpoint, or an invalid API Key, which may also cause the GLM API to return an empty result. Upgrade first, then check the Key.
- Can the coding plan address retrieve a model list?
- No. coding plan uses https://open.bigmodel.cn/api/coding/paas/v4, which does not support retrieving model lists; enter the model name manually. The non-coding plan https://open.bigmodel.cn/api/paas/v4 can retrieve models.
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.