API Error: 400 {"error":{"type":"invalid_request_error","message":"Invalid request Error"},"type":"error"}
What version of Kimi Code CLI is running?
kimi, version 1.14.0
Which open platform/subscription were you using?
Kimi Code
Which model were you using?
kimi-for-coding
What platform is your computer?
Darwin 25.2.0 arm64 arm
What issue are you seeing?
What steps can reproduce the bug?
with kimi-cli, current every works smoothly, but when switching to claude code (endpoint set to kimi), it only works for daily chats. When toolcall are involved, it returns API-400 err
➜ v2-dev git:(main) claude -p "how are you"
I'm doing well, thanks for asking. Ready to help you with whatever you're working on. How can I assist you today?
➜ v2-dev git:(main) claude -p "list the files"
API Error: 400 {"error":{"type":"invalid_request_error","message":"Invalid request Error"},"type":"error"}
What is the expected behavior?
No response
Additional information
No response
Solution
Thx for @carl10086 clues. Here is the workaround
in your ~/.zshrc or ~/.bashrc
export ANTHROPIC_AUTH_TOKEN=<token>
export ANTHROPIC_BASE_URL=https://api.kimi.com/coding/
export ANTHROPIC_MODEL=claude-haiku-4-5-20251001
export ANTHROPIC_DEFAULT_HAIKU_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_SONNET_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_OPUS_MODEL=kimi-k2.5
alias ccd="claude --dangerously-skip-permissions"
similar issue has also been observed in https://github.com/MoonshotAI/kimi-cli/issues/778
I tested opencode and it works as usual, so this should be specific bug related to claude and https://api.kimi.com/coding/
I have the same problem when using cluade code It occurs from this morning.
I restart vscode for its aotoupdate, and then i have same problem.
+1
the error occurs as soon as a SKILL is loaded, seemed to be an issue with Claude Code's agent ability.
I suspect the CC client switched to the latest model, which is causing the 400 error. When I use /model to switch back to the older 4.5 version, it seems to work fine.
/model to try Opus 4.6
❯ /model
⎿ Set model to Default (claude-sonnet-4-6)
❯ /gc
⎿ API Error: 400 {"error":{"type":"invalid_request_error","message":"Invalid request Error"},"type":"error"}
❯ /model
⎿ Set model to haiku (claude-haiku-4-5-20251001)
❯ /gc
⏺ Bash(git status)
⎿ On branch main
Your branch is up to date with 'origin/main'.
… +17 lines (ctrl+o to expand)
⏺ Bash(git diff --stat HEAD)
⎿ pyproject.toml | 1 +
src/dm_cc/agent.py | 38 ++++++++++++++++++++-----------
src/dm_cc/cli.py | 22 ++++++++++++++----
… +2 lines (ctrl+o to expand)
⎿ Interrupted · What should Claude do instead?
I suspect the CC client switched to the latest model, which is causing the 400 error. When I use /model to switch back to the older 4.5 version, it seems to work fine.
/model to try Opus 4.6
❯ /model ⎿ Set model to Default (claude-sonnet-4-6)
❯ /gc ⎿ API Error: 400 {"error":{"type":"invalid_request_error","message":"Invalid request Error"},"type":"error"}
❯ /model ⎿ Set model to haiku (claude-haiku-4-5-20251001)
❯ /gc
⏺ Bash(git status) ⎿ On branch main Your branch is up to date with 'origin/main'. … +17 lines (ctrl+o to expand)
⏺ Bash(git diff --stat HEAD) ⎿ pyproject.toml | 1 + src/dm_cc/agent.py | 38 ++++++++++++++++++++----------- src/dm_cc/cli.py | 22 ++++++++++++++---- … +2 lines (ctrl+o to expand) ⎿ Interrupted · What should Claude do instead?
Thanks I can confirm the issue and this could temperarily resolve the issue
the same error
I suspect the CC client switched to the latest model, which is causing the 400 error. When I use /model to switch back to the older 4.5 version, it seems to work fine. /model to try Opus 4.6 ❯ /model ⎿ Set model to Default (claude-sonnet-4-6) ❯ /gc ⎿ API Error: 400 {"error":{"type":"invalid_request_error","message":"Invalid request Error"},"type":"error"} ❯ /model ⎿ Set model to haiku (claude-haiku-4-5-20251001) ❯ /gc ⏺ Bash(git status) ⎿ On branch main Your branch is up to date with 'origin/main'. … +17 lines (ctrl+o to expand) ⏺ Bash(git diff --stat HEAD) ⎿ pyproject.toml | 1 + src/dm_cc/agent.py | 38 ++++++++++++++++++++----------- src/dm_cc/cli.py | 22 ++++++++++++++---- … +2 lines (ctrl+o to expand) ⎿ Interrupted · What should Claude do instead?
Thanks I can confirm the issue and this could temperarily resolve the issue
Switch to haiku do not solve this issue for me. claude code v2.1.69, Fedora 43
Downgrading to Claude Code v2.1.68 works
Downgrading to Claude Code v2.1.68 works
Indeed useful
The same error,switch to haiku fixed.
Downgrading to Claude Code v2.1.68 works
Indeed useful
It works
Thx for @carl10086 clues. Here is the more general workaround
in your ~/.zshrc or ~/.bashrc
export ANTHROPIC_AUTH_TOKEN=<token>
export ANTHROPIC_BASE_URL=https://api.kimi.com/coding/
export ANTHROPIC_MODEL=claude-haiku-4-5-20251001
export ANTHROPIC_DEFAULT_HAIKU_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_SONNET_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_OPUS_MODEL=kimi-k2.5
alias ccd="claude --dangerously-skip-permissions"
meanwhile, let's wait kimi team to fix their inference endpoint.
The same error,switch to haiku fixed.
The same error,switch to haiku fixed.
I tried claude code v2.1.70 this morning and it seems to be fixed without the need of changing model settings
Can confirm, let Claude update (run once -> then close run again - issue gone)
I have the same problem when using cluade code on Vs Code I use it for reading PDF