Coding Plan endpoints are not always normal OpenAI-compatible APIs.
If Qwen, Kimi, GLM, Z.ai, or another Chinese coding-plan route returns 401, 405, or "only available for Coding Agents", first separate the account plan, endpoint family, protocol, and model id. The same model label can behave differently on a regular API, a coding-plan API, and a gateway.
Use this only if provider signup, payment, region, or coding-plan protocol support is blocking your 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 public issues. Share only the provider profile, endpoint host, model id, region, and whether the key is from a coding plan or a regular model studio account.
1. Identify the route family
| Provider family | Coding-plan style route | Regular OpenAI-compatible route | Common failure |
|---|---|---|---|
| Qwen / Alibaba | coding.dashscope.aliyuncs.com or coding-intl.dashscope.aliyuncs.com |
dashscope.aliyuncs.com/compatible-mode/v1 or dashscope-intl.aliyuncs.com/compatible-mode/v1 |
Coding Plan key sent to compatible-mode, or standard DashScope key sent to Coding Plan. |
| Kimi / Moonshot | Kimi for Coding / Coding Plan routes | Moonshot/Kimi chat completions routes | "Kimi For Coding is currently only available for Coding Agents" when treated as a generic chat endpoint. |
| GLM / Z.ai | api.z.ai/api/coding/paas/... |
Regular Z.ai API routes | Model metadata, context length, pricing, or auth mapped to the regular provider instead of zai-coding-plan. |
2. Log the final request tuple
Most bugs become obvious once the application prints the final values that actually reach the network layer.
selected_provider_profile
final_base_url_host
final_request_path
upstream_model_id
key_or_account_region
protocol_style: chat-completions | responses | coding-agent
Do not debug from the visible model label alone. A label like glm-5.2, qwen3.7-max, or kimi is not enough to know the auth, context length, endpoint, or billing behavior.
3. Keep provider identity separate from protocol
A clean client configuration usually needs two dimensions:
- Provider/account route: Alibaba China, Alibaba International, Kimi regular API, Kimi Coding Plan, Z.ai regular API, Z.ai Coding Plan.
- Wire protocol: standard chat completions, Responses API, Anthropic-like messages, or provider-specific coding-agent route.
If a client stores only one "OpenAI-compatible" switch, it can accidentally send a coding-plan key to the wrong protocol or read model metadata from the wrong registry.
4. Use explicit provider profiles
custom_providers:
- name: zai-coding-plan
base_url: https://api.z.ai/api/coding/paas/v4
models_dev_provider: zai-coding-plan
models:
glm-5.2:
context_length: 1000000
- name: dashscope-intl-compatible
base_url: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
api_key_env: DASHSCOPE_API_KEY
Explicit profiles make support easier: users can paste redacted config, maintainers can see the intended route, and cost/context metadata can stay attached to the actual upstream path.
5. If the official route is blocked
If the blocker is provider onboarding, payment, region availability, or a client that cannot yet speak the provider-specific coding-plan route, use a tiny independent OpenAI-compatible test before spending more time on migration.
Black Eagle AI is an independent gateway, not an official Alibaba, Moonshot, Z.ai, Qwen, Kimi, or GLM partner. Use direct provider access when your account, payment, and client support already work.
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."}]
}'