Kimi K2 is a pretty interesting model, I'm getting good results when compared to Sonnet 4 and paying 80% less by using it through OpenRouter. So here it goes a small guide if you want to give it a try!
Create an account at https://openrouter.ai/ and grab your API key
Run: npm install -g u/anthropic-ai/claude-code
Run: npm install -g u/musistudio/claude-code-router
Add the content of this gist to your ~/.claude-code-router/config.json (update it with your OpenRouter API key)
Run: ccr code
And that's it!
Cool thing is that you can edit the config.json file and add any other LLM available in openrouter.ai !
If you want more tips and tricks about AI coding like that, check https://aicode.guide !
Videos
Which model has the best tool calling with Claude code router?
Been experimenting with claude code router seen seen here: https://github.com/musistudio/claude-code-router
I got Kimi-K2 to work with Groq, but the tool calling seems to cause issues.
Is anyone else having luck with Kimi-k2 or any other models for claude code router (which is of course quite reliant on tool calling). Ive tried trouble shooting it quite abit but wondering if this is a config issue.
I tested Kimi K2 again, against Claude 4 Sonnet (Sonnet 4) this time, here are my findings (vid in comments):
- K2 isn't only less reliable in VSCode tool calling, it's considerably less in Cline as well, vs Claude 4 Sonnet
- I integrated K2 via OpenRouter inference into my own application LIVE and it did the same thing: instead of calling tools, it outputs the tool calls as text, mostly malformed and consolidated
- Ref: https://youtu.be/p2LKJo3EK7w
- Tip for AI coding agent authors: write a parser or a specialized prompt for Kimi K2 - even if it sounds like coupling, the value for money is well worth it
- The "Agent Benchmarks" are definitely not accurate, Sonnet 4 is NATIVELY much better in almost every AI Coding tool
- I'm still going to test K2 in Qwen Coder and maybe a custom coding tool, but it's a very good coder
- K2 is better than Gemini 2.5 Pro in tool calling, according to me
- Currently, the best implementation of K2 I found is in Windsurf (I tested VSCode, Cline, Windsurf and RooCode)
Just wondering if anyone here has tried Kimi K2 or Claude Code for real-world coding tasks. What was your experience like—especially compared to each other? Interested in code quality, speed, tool integration, things like that.
Thanks!
Kimi K2 Thinking model has been released recently with an impressive benchmark.
They got some affordable coding plans from $19 to $199.
And I've found this open-source plugin so we can use their models with Claude Code: Claude Code Switch (CCS)
Web: https://ccs.kaitran.ca/
Github: https://github.com/kaitranntt/ccs
It helps you switch between Claude, GLM and Kimi models with just a simple command:
# use Claude models ccs # switch to GLM models ccs glm # switch to Kimi models ccs kimi
So far when I tried, it isn't as smart as Claude models, and quite slower sometime. But I think it's great for those who use Pro plan: you can try planning with Claude and then give that plan to Kimi for implementing.
Have a great weekend guys!
Been heavily builidng with claude-sonnet-4@20250514, but threw $5 into OpenRouter and gave K2-0905 and WOW.
Not sure if its a “better” model, but seems to chew through tasks in a “better” way.
Is it much better than using the recently nerfed opus/claude?
Just followed Gary Svenson’s Medium guide — it works perfectly. You only need to set two environment variables, and Claude Code will start routing requests through the Kimi K2 model.
Here’s what to set:
export ANTHROPIC_AUTH_TOKEN=your Moonshot API key export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
Then launch Claude Code as usual. It automatically redirects API calls to the new endpoint — no code changes, no extra tools.
The whole setup takes seconds. Claude Code behaves the same as always, but under the hood it’s now powered by K2. It’s a super clean switch, and easy to undo — just clear the variables or revert the URL.
I just hope it helps me get through this rough patch with Claude Code lately.
Which model has the best tool calling with Claude code router?
Been experimenting with claude code router seen seen here: https://github.com/musistudio/claude-code-router
I got Kimi-K2 to work with Groq, but the tool calling seems to cause issues.
Is anyone else having luck with Kimi-k2 or any other models for claude code router (which is of course quite reliant on tool calling). Ive tried trouble shooting it quite abit but wondering if this is a config issue.
Kimi-K2 from Moonshot AI is a 1T parameter, non-reasoning, open weights model. I've seen glowing reports recently from all the "influencers" (i.e.: affiliate marketers). Naturally, I put it in Roo to give it a go. My first impressions:
-
The price is good, at Input: $2/MTok, Output: $5/MTok (vs. Sonnet's $3/$15).
-
The 128k context is small, but it's workable using Orchestrator mode.
-
Problem is, the model inevitably fails at coding tasks.
I love open weight models and this model is quite an accomplishment. But sadly, after just a couple hours of usage, I had to go back to Sonnet. It's not a Sonnet replacement, by any stretch.