How to use Kimi K3 with Claude Code (subscription, not API)

Moonshot AI shipped Kimi K3 today — a 2.8-trillion-parameter open-weight model that, on the benchmarks, is trading blows with the frontier: Claude Fable 5 and GPT-5.6 Sol. On one frontend-coding arena it actually took the top spot, a notch above Fable 5.

Benchmarks are one thing. Whether a model is good for you is another — and the only honest way to settle that is to point it at your own code and watch it work for an afternoon. Claude Code is where a lot of us already do that work, so the fastest way to give K3 a go is to run it inside Claude Code: same cockpit you already know, different engine under the hood.

Here's the whole setup. It takes about two minutes.

Why this works at all

Claude Code is a client. A very good one — the agent loop, the tool use, the diffs, the terminal UX — but underneath, it just speaks the Anthropic API protocol to some backend. Point it at Anthropic's servers and you get Claude. Point it somewhere else that speaks the same protocol and you get whatever's there.

Kimi's coding endpoint speaks that protocol. So you keep the cockpit you already like and swap the engine — no new tool to learn, no workflow to rebuild. And because you're bringing your own backend, you don't need an Anthropic subscription or a Claude API key at all. The only account in play is on the Kimi side.

What you'll need

One thing: a paid Kimi Code plan that includes K3 — the subscription, not pay-as-you-go API credits, which of course are more expensive.

Step 1 — generate a Kimi API key

Log in to the Kimi coding console:

TEXT
https://www.kimi.com/code/console

Open the API Keys page, create a new key, and copy it — it's shown to you exactly once, so paste it somewhere safe. It'll look like sk-kimi-….

(Yes, it's called an "API key" even though you're on a subscription. That's just how you authenticate; your usage still counts against your plan, not a metered bill. More on that further down.)

Step 2 — set the environment variables

Claude Code reads its backend from environment variables. Open your shell's startup file — ~/.zshrc, ~/.bashrc, or whatever your shell uses — and add:

BASH
export ANTHROPIC_BASE_URL=https://api.kimi.com/coding/
export ANTHROPIC_AUTH_TOKEN=sk-kimi-…            # the key from step 1
export ANTHROPIC_DEFAULT_HAIKU_MODEL=kimi-k3
export ANTHROPIC_DEFAULT_OPUS_MODEL=kimi-k3
export ANTHROPIC_DEFAULT_SONNET_MODEL=kimi-k3
export ANTHROPIC_MODEL=kimi-k3
export CLAUDE_CODE_SUBAGENT_MODEL=kimi-k3
export ENABLE_TOOL_SEARCH=false

What each one is doing:

  • ANTHROPIC_BASE_URL — where Claude Code sends its requests. This is the actual switch: Kimi's coding endpoint instead of Anthropic's.

  • ANTHROPIC_AUTH_TOKEN — your Kimi key. If you've ever logged into Claude Code the normal way, this stands in for that.

  • ANTHROPIC_MODEL — the main model for the session.

  • ANTHROPIC_DEFAULT_{HAIKU,SONNET,OPUS}_MODEL — Claude Code reaches for different Claude tiers for different jobs: a small fast one for background chores, the mid one for the main work, the big one for heavy reasoning. Kimi's endpoint only serves kimi-k3, so you map all three onto it — otherwise Claude Code tries to call a Claude model that isn't there, and that request fails.

  • CLAUDE_CODE_SUBAGENT_MODEL — the subagents Claude Code spawns for sub-tasks run on kimi-k3 too, instead of defaulting back to a Claude tier.

  • ENABLE_TOOL_SEARCH=false — Tool Search is a newer Claude Code feature that loads tool definitions on demand. It leans on Anthropic-specific behaviour, so it's the first thing to misbehave against a third-party backend. Turn it off for a clean run.

Step 3 — reload and launch

Pick up the new variables — either reload the file:

BASH
source ~/.zshrc      # or ~/.bashrc, or your shell's equivalent

…or just open a fresh terminal. Then start Claude Code as usual:

BASH
claude

That's it. You're driving Kimi K3 through Claude Code.

How to check which model you're actually running

Two reliable ways, and one that lies to you.

The welcome screen. When Claude Code starts, it prints the active model bottom-left. On a working setup it reads kimi-k3:

Claude Code's welcome screen showing kimi-k3 as the active model

You'll notice it says API Usage Billing right next to it. Don't let that spook you — it doesn't mean you're being metered. Claude Code labels any token-based auth that way (as opposed to a subscription login); on Kimi's side your usage still draws from your flat plan. Essentially it's a label about how you authenticated, not how you pay.

/status. Inside a session, type /status. If the Base URL reads https://api.kimi.com/coding/, the switch took.

Asking the agent — don't. You'd think you could just ask it "which model are you?" — but this is the one check that misleads you. Claude Code injects a system prompt telling the model it is Claude, so K3, being an obedient junior, will often cheerfully answer "I'm Claude." It isn't lying to you on purpose; it's doing exactly what its instructions told it to. Which is the whole thing in miniature: a model's output is a product of the conditions you put it in, not some fixed truth you can interrogate out of it. Trust the UI, not the confession.

Is it worth it?

For the price of finding out — two minutes and a subscription you can cancel — yes, run the experiment. But run the right one. A leaderboard tells you a model can be good in the aggregate; it can't tell you whether it's good at your stack, your patterns, the specific mess in your repo. That's not something you read off a benchmark — it's something you feel after an afternoon of real work.

So point it at a real task, not a toy. Watch where it's sharp and where it flails. That's the only comparison that decides anything, and now it costs you almost nothing to run.

The bigger point sits one level up: the model is the interchangeable part. Being able to swap the engine under your tools — Claude this week, Kimi the next, whatever's ahead of the pack after that — is worth more than any single model being "the best," because "best" now has a shelf life measured in weeks. The skill that lasts isn't picking the winner; it's knowing how to put whichever model you're holding to work.

That's the same instinct behind everything we build: the model is the fast, tireless junior — the judgement about what actually ships is yours. If you've got an AI-built app that dazzles in a demo and then buckles the moment real users touch it, taking it the last mile to production is exactly what we do.

FAQ

Do I need a Claude or Anthropic subscription to use Kimi K3 in Claude Code?

No. Claude Code is just a client that speaks the Anthropic API protocol; pointing it at Kimi's coding endpoint means you authenticate entirely with a Kimi key. All you need is a paid Kimi Code plan that includes K3 — no Anthropic account, no Claude API key.

Is a Kimi subscription cheaper than API usage for Claude Code?

For agent-style coding, yes. A single Claude Code session can burn millions of tokens, and metered API pricing scales with every one of them. A flat monthly Kimi Code membership fixes the cost no matter how hard you drive it — the same reason heavy Claude Code users pick a Claude subscription over the raw API.

Is Kimi K3 as good as Claude for coding?

On its launch benchmarks it's frontier-level — Kimi K3 topped one frontend-coding arena ahead of Claude Fable 5, and it ships a 1M-token context window. But a leaderboard isn't your codebase. The only comparison that settles it is running it on your real projects for a few sessions and assessing the outcomes yourself.

Why does Claude Code show "API Usage Billing" if I'm on a Kimi subscription?

Because that label reflects how you authenticated (with a token), not how you're billed. Claude Code shows "API Usage Billing" for any token-based backend and "subscription" only for its own login flow. On Kimi's side, your usage still draws from your flat plan.

Can I trust the agent when I ask which model it is?

No — that's the one check that misleads you. Claude Code's system prompt tells the model it is Claude, so Kimi K3 will often answer "I'm Claude." Verify with the welcome screen or /status (Base URL should read https://api.kimi.com/coding/) instead.

How do I switch back to Claude?

Comment out or unset the environment variables in your shell profile — ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are the two that matter — then reload it or open a new terminal, and Claude Code talks to Anthropic again. If you flip back and forth a lot, keep the Kimi block behind a shell alias or a separate profile you can toggle instead of editing the file each time.