You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Console Go: Anthropic-route tool calls fail with 400 'function name is invalid' for Kimi models (kimi-k3, kimi-k2.7-code) #41120
Requests to https://opencode.ai/zen/go/v1/messages (Anthropic route) with any tool that carries an input_schema fail with HTTP 400 for the Kimi models (kimi-k3, kimi-k2.7-code). Other models on the same route accept the identical request.
Error
400 invalid_request_error
"Error from provider (Console Go): Upstream request failed: [invalid_request_error] Invalid request: function name is invalid, must start with a letter and can contain letters, numbers, underscores, and dashes"
The error is misleading: the tool names are all valid (Bash, Edit, mcp__codegraph__codegraph_explore, ...). Bisection shows the trigger is the presence of the input_schema key, not its content and not the name.
Reproduction
Build an Anthropic /v1/messages request with model: "kimi-k3" and any single tool, e.g.:
POST to https://opencode.ai/zen/go/v1/messages with an opencode-go key.
Result: 400 with the error above.
Bisection results (same body, only the tool definition varied, model kimi-k3):
tool definition
result
name only
OK
name + description
OK
name + description + input_schema (any content, even {})
400
same with deepseek-v4-flash / qwen3.8-max / minimax-m3 / gpt-5.6-luna
OK
same with kimi-k2.7-code
400
same with glm-5.2
422
grok-4.5
401 "Model grok-4.5 is not supported for format anthropic"
Additional data
The OpenAI route works for the same models: POST /v1/chat/completions with tools: [{type: "function", ...}] on kimi-k3 succeeds. So this is specific to the Anthropic-route tool-schema conversion for the Kimi upstream.
Affects every Claude Code session pointed at ANTHROPIC_BASE_URL=https://opencode.ai/zen/go with a Kimi model — the very first request fails because Claude Code always sends tool schemas.
Workaround today: use a non-Kimi model (qwen3.8-max, minimax-m3, deepseek-v4-flash, gpt-5.6-luna) on the Anthropic route. Claude Code's native OpenAI env route is not an alternative in v2.1.220 (it rejects models not in its own list).
Kimi Code API Invalid Moonshot flavoured json schema #37496: Kimi Code API tool schema validation failures on both OpenAI and Anthropic endpoints (different error message but same root cause area — Kimi's restricted JSON Schema validator rejecting OpenCode-generated tool schemas)
Update as of 2026-08-15 (from #42616, closing as dup):
Kimi appears to be fixed on this route.kimi-k3 with a tool carrying input_schema (the exact repro shape above) now returns 200 with a clean tool_use block:
The GLM branch is still broken, and the failure now spans the whole GLM family. Same request, same key, same endpoint:
model
result with 1 minimal tool
glm-5.3 (newly listed ~08-14)
400 [1210] Invalid API parameter
glm-5.2
422 tools.0.function-after[_domain_filters(), WebSearchTool].type — Input should be 'web_search'
glm-5.1
422, identical to glm-5.2
kimi-k3
✅ 200
qwen3.7-plus
✅ 200
glm-5.3 via OpenAI route /v1/chat/completions
✅ 200, correct tool_calls
glm-5.2 via Zhipu native open.bigmodel.cn/api/anthropic
✅ 200, clean tool_use
The glm-5.2/5.1 422 param path is the most interesting clue — it looks like the Anthropic→GLM translation emits something in Zhipu's web_search tool format (WebSearchTool, _domain_filters()) instead of a plain function tool. glm-5.3 is presumably routed to a different upstream (it fails with [1210] instead), but the trigger is the same: any non-empty tools on the Anthropic route, regardless of tool shape.
Also reproduced across 3 independent Go-plan keys, so it's not account-specific.
Side note: Zhipu's native Anthropic endpoint now returns "model": "glm-5.3" when you request glm-5.2 — the alias seems repointed upstream, in case that matters for how the gateway routes GLM traffic.
Activity
github-actions commentedon Aug 7, 2026
This issue might be a duplicate of existing issues. Please check:
kimi-k2.7-code+ Anthropic/v1/messages+ tools → 400 "function name is invalid" symptom on the zen/go gatewaygoldyard2022 commentedon Aug 14, 2026
Update as of 2026-08-15 (from #42616, closing as dup):
Kimi appears to be fixed on this route.
kimi-k3with a tool carryinginput_schema(the exact repro shape above) now returns 200 with a cleantool_useblock:{"type":"tool_use","id":"get_weather_0","name":"get_weather","input":{"city":"北京"}}The GLM branch is still broken, and the failure now spans the whole GLM family. Same request, same key, same endpoint:
glm-5.3(newly listed ~08-14)[1210] Invalid API parameterglm-5.2tools.0.function-after[_domain_filters(), WebSearchTool].type—Input should be 'web_search'glm-5.1kimi-k3qwen3.7-plusglm-5.3via OpenAI route/v1/chat/completionstool_callsglm-5.2via Zhipu nativeopen.bigmodel.cn/api/anthropictool_useThe glm-5.2/5.1 422 param path is the most interesting clue — it looks like the Anthropic→GLM translation emits something in Zhipu's web_search tool format (
WebSearchTool,_domain_filters()) instead of a plain function tool. glm-5.3 is presumably routed to a different upstream (it fails with[1210]instead), but the trigger is the same: any non-emptytoolson the Anthropic route, regardless of tool shape.Also reproduced across 3 independent Go-plan keys, so it's not account-specific.
Side note: Zhipu's native Anthropic endpoint now returns
"model": "glm-5.3"when you requestglm-5.2— the alias seems repointed upstream, in case that matters for how the gateway routes GLM traffic.github-actions commentedon Oct 15, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.