I pay for Claude and I pay for Kimi Code, and I want both available from the same terminal without choosing one in the morning. Kimi publishes a guide for pointing Claude Code at their endpoint. It tells you to export a handful of environment variables in your shell profile, which works, and which also routes every Claude Code session on the machine to Kimi from then on. Your Anthropic subscription sits there unused while you wonder why Opus got worse.
The fix is boring: a second settings file and a shell function that loads it. Ten minutes. The part worth writing down is that the headline model ID in Kimi's guide is rejected by Kimi's own endpoint, and it's rejected with a 401 that says your credentials are bad. I lost time auditing a key that was never the problem. Then I found a second version of the same lie living in ~/.claude.json, and that one is better disguised.
TL;DR. Put the Kimi config in ~/.claude/kimi-settings.json rather than ~/.claude/settings.json, then add a claude-kimi() function that runs claude --settings "$HOME/.claude/kimi-settings.json" "$@". Base URL is https://api.kimi.com/coding/ with the key in ANTHROPIC_API_KEY. The model is k3, not k3[1m], whatever the docs say. Set CLAUDE_CODE_MAX_CONTEXT_TOKENS to 1048576 because a bare k3 gives Claude Code no window to infer. If interactive mode 401s while curl and claude -p both work, your key is in the rejected list in ~/.claude.json and no amount of key rotation will fix it.






