Yes, Kimi K3 runs in OpenCode with three commands. It lists at Sonnet-class rates ($3/$15 per million tokens), but real OpenCode sessions average only $1.79, thanks to heavy prompt caching.
Set up Kimi K3 in OpenCode in three steps
OpenCode is an open-source terminal coding agent. It connects to Kimi through built-in authentication, so you never paste a base URL or edit a config file. The steps below match OpenCode 1.18.3 and Kimi's own integration guide.
1. Configure the API key
Run opencode auth login, select Moonshot AI as the provider, and paste your key from the Kimi Open Platform. Two things trip people up here. First, the account needs a real balance — new-user vouchers do not work on K3. Second, keep the key out of any config file, screenshot, or git repo; OpenCode stores it in its own credential system for a reason.
2. Select the kimi-k3 model
Inside OpenCode, run /models and pick kimi-k3. That loads the model with its full 1M-token context window (output caps at 131K tokens per turn). The status bar should now read "Kimi K3" and "Moonshot AI".
3. Set the thinking effort
Run /variants to control how hard K3 reasons before answering. It defaults to max, and you can drop to high or low — the single biggest lever on your bill, as the cost section shows.
What a Kimi K3 session actually costs
K3 lists at $3 per million input tokens and $15 per million output, more than the Claude Sonnet 5 promotional rate of $2/$10.
In practice K3 costs far less, because most tokens are cheap cache reads. OpenCode's public usage data (shown on its per-model page below) puts the average Kimi K3 session at $1.79, measured across 66,379 completed sessions spending 2.9M tokens each. That works out to about $0.62 per million tokens actually used, well under the $3 list rate. The reason: 93% of input tokens are cache hits, and a cache hit costs $0.30 per million instead of $3.00, a 90% discount. (Artificial Analysis quotes a blended $2.31 per million, but that assumes only 70% caching; OpenCode's real 93% cache rate is why sessions land lower.)
The list price stays Sonnet-class; the open-weight release (full weights by July 27, 2026) changes what you can self-host, not what you pay through the API. The per-million rates compare like this:
K3 ranks #9 by token volume on OpenCode Go, and its usage doubled over the eight weeks to July 20 (per OpenCode's momentum data) — expensive on paper, still in heavy demand for hard tasks.
Why K3 burns tokens, and how to rein it in
The most common complaint is not the price per token; it is how many tokens K3 spends. Because it defaults to max thinking effort, K3 reasons at length before it acts, and on simple edits that reasoning is wasted spend. One OpenCode user on X put it bluntly in July 2026: it can burn a lot of tokens "without accomplishing much" on tasks a lighter model would finish faster.
Three levers keep that in check:
- Drop the variant. Switch
/variantstoloworhighfor routine work.maxis worth it for architecture and multi-file refactors, not for renaming a function. - Lean on the cache. K3's 93% cache-hit rate is why sessions stay cheap. Keep working in one long session instead of restarting; each restart re-sends uncached context at full price.
- Trim the harness. K3 over-thinks when the agent scaffold is noisy. Cut always-on instruction files, unused MCP servers, and verbose tool descriptions so it makes fewer tool round-trips and has less room to spiral.
Expect one trade-off: K3 feels slower than lighter models in OpenCode — the reasoning tax. When latency matters more than depth, switch models.
Kimi K3 vs Kimi K2.7 Code: when the cheaper model wins
K3 is roughly three times the price of Kimi K2.7 Code, so the question is when the jump is worth it.
To sanity-check the cheaper option, I called K2.7 Code through its API on 2026-07-20 with a small task: write a Python merge_intervals function with complexity analysis. It returned correct, idiomatic code (sort, then linear merge, O(n log n) time and O(n) space) in 10.7 seconds, using 52 prompt and 341 completion tokens. For everyday coding such as bug fixes, small functions, and test scaffolding, that is all most people need, and the token bill is a fraction of K3's.
Reserve K3 for what it is better at: long-context work that fills its 1M window, gnarly multi-file reasoning, and tasks where a lighter model keeps failing. The head-to-head between K2.7 Code and GLM 5.2 is a useful reference if you are picking a daily driver rather than a heavy-lift model.
Direct API vs OpenRouter vs a subscription: cutting the bill
How you route to K3 changes both reliability and cost.
Direct Kimi API. Connecting straight to the Kimi Open Platform is the most reliable path. K3 on OpenRouter is served by a single provider and can return frequent 429 (rate-limit) errors under load; going direct avoids that bottleneck.
OpenCode Go subscription. A monthly plan (around $10–19) turns K3 into a flat-rate "second pool" you reach for when your main model stalls. Several users run it exactly this way — a fallback when a Claude session gets interrupted mid-task, not a full-time driver.
API gateway. If you already route several models through one key, an Anthropic- and OpenAI-compatible gateway like AIReiter lets you call K3 alongside other models on pay-as-you-go pricing, with the same caching economics that keep per-session cost down. The Kimi K3 pricing breakdown has the per-token math for comparing routes before committing.
Is Kimi K3 worth it in OpenCode?
Two groups should think twice before committing. If you run cheap, high-volume agent loops, K2.7 Code or a lighter model saves money with little quality loss. If you need snappy responses, K3's max-effort reasoning will feel slow until you drop the variant.
Everyone else: yes. A leaderboard-topping model with a 1M-token context, set up in three commands, at under $2 a real session — and one you fully control, if you are leaving an assistant that stalls mid-task.
FAQ
Is Kimi K3 free to use in OpenCode?
No. K3 is pay-as-you-go and needs a funded Kimi Open Platform balance; new-user vouchers don't apply to it. OpenCode itself is free and open-source — you only pay for K3 tokens.
How much does Kimi K3 cost per million tokens?
The list rate is $3 per million input tokens and $15 per million output. What you pay in practice is far lower: cache hits cost $0.30 per million, and OpenCode's real sessions average $1.79 thanks to a 93% cache-hit rate.
Is Kimi K3 open-source?
It is open-weight. Moonshot is releasing the full model weights by July 27, 2026, making it the first open model in the 3-trillion-parameter class. The hosted API is still paid.
Can Kimi K3 code as well as Claude?
On Arena's coding leaderboard, K3 currently ranks at the top and scores 57 on the Artificial Analysis Intelligence Index (#4 of 187 models). In practice it is competitive with frontier proprietary models on hard coding tasks, at a similar list price.
Why do I get 429 errors with Kimi K3?
Frequent 429s usually come from routing through OpenRouter, where K3 is served by a single provider. Connecting directly to the Kimi Open Platform through OpenCode's built-in auth avoids that limit.
