cc-switch GLM Coding Plan failures usually come from mixing protocol, billing route, and path mode.
If cc-switch shows /v4/v1/models, Codex returns 404/422, or GLM quota query fails while chat still works, separate the provider profile before changing keys. GLM standard API, BigModel CN Coding Plan, Z.ai international Coding Plan, Claude-style Anthropic routes, and Codex /responses conversion are different surfaces.
Use this only when direct GLM/Zhipu/Z.ai onboarding, payment, account region, or client routing is blocking a tiny first test. Pay $5, create an account, send the receipt, and get manually credited for one real request.
Do not paste real API keys into issue threads. Share only the app, route family, endpoint host, final upstream path, model id, and whether the account is BigModel CN or Z.ai international.
1. Use separate provider profiles
| Profile | Base URL | Path mode | Use when |
|---|---|---|---|
bigmodel-cn-openai-compatible |
https://open.bigmodel.cn/api/paas/v4 |
append /models or /chat/completions; never append /v1 |
Regular BigModel/Zhipu OpenAI-compatible API billing route. |
bigmodel-cn-coding-plan |
https://open.bigmodel.cn/api/coding/paas/v4 |
append operation path only | BigModel CN account with GLM Coding Plan quota. |
zai-intl-coding-plan |
https://api.z.ai/api/coding/paas/v4 |
append operation path only | Z.ai international account with Coding Plan quota. |
bigmodel-cn-anthropic |
https://open.bigmodel.cn/api/anthropic |
Anthropic-compatible message path | Claude Code style clients that are not using OpenAI chat/completions directly. |
2. Fix the /v4/v1 class of errors
If the final URL looks like this, the client is treating a v4 route root as a generic OpenAI root:
https://open.bigmodel.cn/api/coding/paas/v4/v1/models
https://open.bigmodel.cn/api/coding/paas/v4/v1/chat/completions
The intended operation paths are usually:
https://open.bigmodel.cn/api/coding/paas/v4/models
https://open.bigmodel.cn/api/coding/paas/v4/chat/completions
A cc-switch preset should carry an explicit flag rather than infer from the string suffix:
routeFamily = bigmodel-cn-coding-plan
pathMode = append-operation-only
modelsPath = /models
chatPath = /chat/completions
responsesAdapter = codex-responses-to-chat
3. Codex failures need one extra field
Codex calls a /responses style interface. If cc-switch adapts that to chat completions, log both the client protocol and the final upstream path. A model test button can pass while Codex still fails if the adapter path is wrong.
client_protocol: codex-responses | claude-anthropic | openai-chat
provider_profile: bigmodel-cn-coding-plan
base_url_host: open.bigmodel.cn
final_upstream_path: /api/coding/paas/v4/chat/completions
upstream_model_id: glm-5.1
4. Quota query failures are not always model failures
Some users can chat successfully but see usage or quota query failures. Treat quota endpoint selection as its own observable route.
usage_endpoint_attempted: api.z.ai | open.bigmodel.cn
usage_endpoint_selected: api.z.ai | open.bigmodel.cn
account_region_hint: zai-intl | bigmodel-cn | unknown
quota_payload_level: pro | max | unknown
failure_kind: tls_error | http_error | parse_error | quota_not_found
5. When to use a relay test
If you already have working direct BigModel or Z.ai access, direct provider usage is cleaner. A small independent OpenAI-compatible relay helps only when you need a control route while fixing account-region, payment, phone verification, or client path-mode issues.
Black Eagle AI is independent and is not an official Z.ai, BigModel, Zhipu, Alibaba, Qwen, Kimi, or GLM partner. The starter flow is for teams that want one prepaid control request before committing more setup time.
curl https://api.blackeaglecambodia.com/v1/chat/completions \
-H "Authorization: Bearer sk-your-black-eagle-token" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-flash",
"messages": [{"role": "user", "content": "Say hello in one sentence."}]
}'