Kimi K3 API: How to Call It (and What It Really Costs)
Moonshot AI shipped Kimi K3 on July 16, 2026, and it landed near the top of the leaderboards on day one. It is also frontier-priced at 3 dollars in and 15 dollars out per million tokens. This guide covers exactly how to call it, the model ids that differ by gateway, and a worked cost picture from our own launch-day run, so you can decide whether K3 belongs in your stack or a cheaper coder does the job.
What Kimi K3 is
Kimi K3 is Moonshot AI's flagship model, released on July 16, 2026 and live the same day on Kimi.com, Kimi Work, Kimi Code, and the API. Under the hood it is a 2.8-trillion-parameter sparse mixture-of-experts model, but only 16 of its 896 experts fire per token, roughly 1.8 percent, so a forward pass activates around 50 billion parameters. That sparse design is what lets a model this large stay affordable enough to serve at frontier speed.
Two architectural details matter for API users. First, K3 uses Kimi Delta Attention, a hybrid linear attention mechanism that Moonshot reports gives up to 6.3x faster decoding in million-token contexts. Second, the context window is a full 1,048,576 tokens, so long-document and whole-repository prompts are on the table. At launch, third-party reporting placed K3 around No. 3 on the Artificial Analysis leaderboard, behind Claude Fable 5 and GPT-5.6 Sol, and noted it beat Claude Fable 5 on a frontend web-development Code Arena benchmark. Treat those rankings as day-one secondary reporting, not settled fact. For a capability-focused take, see our Kimi K3 review.
The 3 dollar / 15 dollar math
Kimi K3 is priced like a frontier model: 3.00 dollars per million input tokens and 15.00 dollars per million output tokens. On a cache hit, input drops to about 0.30 dollars per million. That cache discount is real and useful for repeated system prompts, but it applies only to input. Output is always 15 dollars, cache hit or not.
The line that catches people is reasoning. K3 has always-on thinking, and reasoning tokens are billed as output at 15 dollars per million. A long reasoning trace can cost more than the visible answer it produces, so any budget estimate that ignores reasoning tokens will understate your real bill. This is also a steep jump from the prior generation: Kimi K2.6 ran roughly 0.95 dollars input and 4 dollars output per million. K3 roughly triples input and nearly quadruples output. For the full Kimi price ladder across generations, see our Kimi API pricing breakdown.
| Meter | Cache miss | Cache hit |
|---|---|---|
| Input tokens | 3.00 dollars / 1M | 0.30 dollars / 1M |
| Output tokens | 15.00 dollars / 1M | 15.00 dollars / 1M |
| Reasoning tokens | billed as output, 15 dollars / 1M | 15.00 dollars / 1M |
| Context window | 1,048,576 tokens | |
How to call it
K3 is OpenAI-compatible, so you do not rewrite your client. You swap the base URL and the model id. The one trap is that the id differs by gateway. On OpenRouter the model is moonshotai/kimi-k3. On Moonshot's own API you point at https://api.moonshot.ai/v1 and use kimi-k3. Mixing those up is the most common day-one error. If the OpenAI-compatible pattern is new to you, our guide to OpenAI-compatible APIs walks through the base-URL swap.
Calling K3 through Moonshot directly:
from openai import OpenAI
client = OpenAI(
base_url="https://api.moonshot.ai/v1",
api_key="YOUR_MOONSHOT_KEY",
)
resp = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Refactor this function for readability."}],
)
print(resp.choices[0].message.content)
The same code against OpenRouter needs only two edits, the base URL and the id:
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="YOUR_OPENROUTER_KEY",
)
resp = client.chat.completions.create(
model="moonshotai/kimi-k3",
messages=[...],
)
A note on parameters: on Moonshot's platform, K3 currently accepts only the max level for reasoning_effort, and temperature, top_p, and n are fixed and should be omitted. max_completion_tokens defaults to 131072 and can go up to 1048576. If you would rather keep one key and one base URL across K3 and 300-plus other models, you can route through the DataLLM Lab gateway at https://www.datallmlab.com/v1; that is the whole point of an LLM gateway.
Point your existing OpenAI code at 300+ models
One key, one base URL, K3 and its cheaper alternatives side by side so you can A/B on real cost. Swap providers without touching your code.
A worked cost example
Numbers make the reasoning-token issue concrete. Say a single coding request sends 2,000 input tokens and gets back 500 visible output tokens plus 150 reasoning tokens. K3 was notably token-lean in our run, around 150 reasoning tokens per task, so this is a realistic trace, not a worst case.
Illustrative math, cache miss: input is 2,000 / 1,000,000 x 3.00 = 0.0060 dollars. Output is the visible plus reasoning tokens, 650 / 1,000,000 x 15.00 = 0.00975 dollars. Total about 0.0158 dollars per call. On a cache hit the input piece falls to 0.0006 dollars and the call lands near 0.0104 dollars. The output half dominates either way, which is exactly why the always-on reasoning matters more than the input price.
K3 vs cheaper coders
This is where our first-party data earns its place. In our July 2026 executed coding benchmark, we ran 13 models plus a launch-day K3 run through 9 tasks that generate code and then run it against hidden tests. Cost is token usage times list price per 1,000 tasks. The headline that reframes the whole decision: 10 of the 13 models scored a perfect 9 of 9. Single-shot correctness on standard tasks is table stakes. The real axis is cost, and the spread was about 88x.
K3 ran on launch day, July 16, 2026, via OpenRouter. It passed all 8 tasks we could execute; the 9th, parse_csv_line, never completed because of repeated upstream 429 rate-limiting, a launch-day capacity signal rather than a capability miss. Its real cost came in around 4 dollars per 1,000 tasks, squarely in Claude Opus 4.8 territory, and it was impressively token-lean at roughly 150 reasoning tokens per task.
| Model | Cost / 1k tasks | Score | Note |
|---|---|---|---|
| Qwen3 Coder Next | 0.10 dollars | 9 / 9 | cheapest, 7.0s |
| DeepSeek V4-Flash | 0.13 dollars | 9 / 9 | near-free |
| Mistral Medium 3.5 | 0.87 dollars | 9 / 9 | fastest, 2.9s |
| Kimi K2.7-Code | 1.34 dollars | 9 / 9 | 272 reasoning tok/task |
| GLM 5.2 | 1.99 dollars | 9 / 9 | 12.3s |
| Kimi K3 | ~4.00 dollars | 8 of 8 executed | launch-day, 429 on task 9 |
| Claude Opus 4.8 | 4.05 dollars | 9 / 9 | frontier |
| GPT-5.5 | 8.83 dollars | 9 / 9 | most expensive |
Both K2.7-Code and GLM 5.2 are the two open models LM Studio Bionic explicitly recommends for its Code projects, and both cleared 9 of 9. The comparison to draw is not that K3 is bad; it is fast, token-lean, and frontier-capable. It is that for routine, well-specified coding, you are paying 30x to 40x over a coder that passes the identical tests.
Open weights: promised, not out
K3 is described as an open-weight model, and that shapes a lot of coverage. Be precise here: as of July 2026 the open weights are promised but not released. Simon Willison confirmed the target of availability by July 27, 2026. Until Moonshot actually publishes them, K3 is an API-only model. If you are planning around self-hosting, do not assume a download exists yet, and re-verify the real release before you build on it. For models you can run today, see our roundup of the best open-source LLMs of 2026.
When to actually use K3
Here is the decision rule our data supports. Since 10 of 13 models already pass single-shot coding tasks, correctness is not your differentiator; cost and hard-problem depth are. Use the cheapest passing coder for routine generation, refactors, and boilerplate; a 0.10-to-1.34-dollar option does that work. Reserve Kimi K3 for what its 1M-context Kimi Delta Attention and always-on reasoning are actually good at: long-context analysis over whole repositories or documents, and genuinely hard reasoning where a weaker model would fail outright. Paying frontier prices makes sense when the task is frontier-hard, not when it is table stakes. The honest launch-day footnote, that K3 hit 429 rate limits on our 9th task, is also worth remembering: a brand-new frontier model can be capacity-constrained in its first days, so build in retries.
FAQ
What is the Kimi K3 API model id?
It depends on the gateway. On OpenRouter the model is moonshotai/kimi-k3. On Moonshot's own API you set base_url to https://api.moonshot.ai/v1 and the model to kimi-k3. Both are OpenAI-compatible, so existing SDK code works once you swap the base URL and id.
How much does the Kimi K3 API cost?
3.00 dollars per million input tokens and 15.00 dollars per million output tokens. A cache hit drops input to about 0.30 dollars per million, but output stays at 15 dollars. Reasoning tokens bill as output and K3 always thinks, so include them in any estimate.
Are the Kimi K3 open weights available?
Not yet. As of July 2026 the weights are promised by Moonshot for July 27, 2026 but have not been released. Treat K3 as API-only for now, and re-verify actual availability before claiming the weights are downloadable.
How do I call Kimi K3 with the OpenAI SDK?
Install the OpenAI SDK, point base_url at your gateway, pass your key, and set the correct model id. On Moonshot use https://api.moonshot.ai/v1 with kimi-k3; on OpenRouter use their base URL with moonshotai/kimi-k3. The chat.completions call is otherwise standard.
Is Kimi K3 worth it for routine coding?
Often not. In our July 2026 benchmark, 10 of 13 models scored a perfect 9 of 9, so correctness is table stakes. K3 costs roughly 4 dollars per 1,000 tasks while Qwen3 Coder Next did the same work at 0.10 dollars and Kimi K2.7-Code at 1.34 dollars. Save K3 for hard, long-context problems.
Does Kimi K3 support temperature and reasoning_effort settings?
On Moonshot's platform, K3 currently supports only the max level for reasoning_effort, and temperature, top_p, and n are fixed and should be omitted. max_completion_tokens defaults to 131072 and can reach 1048576. Behavior can vary between OpenRouter and Moonshot's own API, so check your gateway docs.
DataLLM Lab