Kimi Beginner

Kimi K3 API Guide: 2.8-Trillion-Parameter Open Model with 1M Context (2026)

Kimi K3 benchmarks, why it matters for China's AI industry, and price vs GPT-5.6 Sol & Claude Fable 5 — plus a full API setup guide.

KimiK3APIBeginnerOpen SourceLong ContextBenchmarksComparison
By Xingxing Yang · AI technology enthusiast & founder of China AI Tutorials

📌 Screenshots, pricing, and steps below were captured directly from platform.kimi.ai in July 2026. Moonshot ships fast — double-check platform.kimi.ai/docs/pricing before you commit a production budget to these numbers.

On July 16, 2026, Moonshot AI dropped a 2.8-trillion-parameter model and made a bold claim: it builds websites better than Claude and GPT, for a fraction of the price. That’s a big claim. Here’s what actually checks out, backed by independent benchmarks and official pricing — not vendor slides.

🔑 Kimi K3 in 3 numbers
  • #4 of 189 models on the independent Artificial Analysis Intelligence Index — a real frontier score, not marketing
  • #1 on Arena’s Frontend Code leaderboard — ahead of Claude Fable 5, a 17-spot jump from the previous Kimi model
  • $15 per million output tokens — half of GPT-5.6 Sol, less than a third of Claude Fable 5

Is Kimi K3 Actually Good? The Benchmark Scores

Short answer: yes, but not the best. K3 lands solidly in frontier territory — just not at the very top.

The cleanest number to trust is the Artificial Analysis Intelligence Index, a composite score built from nine independent evaluations, not vendor-supplied results. K3 scores 57, good for #4 out of 189 models — roughly tied with Claude Opus 4.8, but behind Claude Fable 5 and GPT-5.6 Sol. Even Moonshot’s own launch post admits as much, saying K3 “still trails the most powerful proprietary models.”

So where does K3 actually pull ahead? Browsing, terminal work, and — most notably — anything involving a web browser:

  • Arena’s Frontend Code leaderboard: K3 sits at #1 with 1,679 Elo, edging out Claude Fable 5. The previous Kimi model (K2.6) was ranked #18. That’s a 17-spot jump in one release.
  • Vercel’s nextjs.org/evals: K3 is the first open-weight model to beat every proprietary model on this real-world Next.js benchmark — actual App Router pages and server components, not toy problems. Vercel’s own CEO posted the results.

Here’s how K3 stacks up against the other two frontier models on Moonshot’s launch benchmarks. Fair warning: each model ran on a different test harness (K3 on KimiCode, Fable 5 on Claude Code, GPT-5.6 Sol on Codex), so read these as “in the same ballpark,” not a lab-controlled tie:

BenchmarkKimi K3Claude Fable 5GPT-5.6 Sol
Terminal-Bench 2.188.384.688.8
BrowseComp91.288.090.4
GPQA-Diamond93.592.694.1
DeepSWE (agentic coding)67.570.073.0
FrontierSWE (hardest SWE tasks)81.286.671.3
GDPval-AA v2 (Elo)1,668 (#3)1,760 (#1)1,748 (#2)

The takeaway is consistent no matter which source you check: K3 is genuinely strong at browsing, terminal tasks, and web/frontend work — but it still loses to Claude Fable 5 and GPT-5.6 Sol on the toughest, longest software-engineering benchmarks (DeepSWE, FrontierSWE).

⚠️ Nobody has an independent SWE-bench score for K3 yet. Every coding number above either comes from Moonshot's own test runs or from an aggregate index — not a neutral, third-party reproduction of the classic SWE-bench suite. Treat exact percentages as "roughly this good," not gospel, until an outside lab publishes its own number.

K3’s Real Edge: It’s the Best Model for Building Web Pages

This is the part that actually matters if you build products: K3 isn’t just competitive at frontend work — right now, it’s ranked #1 among every model tested.

Three things drive that lead:

  • It topped Arena’s Frontend Code Arena at 1,679 Elo, ahead of Claude Fable 5, and wins 6 of 7 sub-categories — marketing pages, dashboards, recreating a design from a screenshot, you name it.
  • It’s the first open model to beat every closed model on Vercel’s own Next.js benchmark. That’s not a synthetic test — it’s real App Router pages and server components, the stuff you’d actually ship.
  • It can see what it builds. Unlike the older K2.6 (which needed a separate model, kimi-k2.5, just to look at an image), K3 has vision built in. That means a coding agent can render a page, take a screenshot, spot what’s off, and fix the layout — in one continuous loop, without switching models.
📝 One catch worth knowing: Arena's ranking is human voters judging which page looks better — spacing, colors, polish. It says nothing about whether the code passes an accessibility check or has a broken button underneath a pretty layout. Treat a #1 frontend rank as "looks great," not "ready to ship" — run your own visual and accessibility tests before it goes to production.

The Price Difference Is Not Small

Here’s the part that makes K3 hard to ignore even if you don’t care about frontend leaderboards: it’s dramatically cheaper than every model it’s being compared to.

ModelInput ($/M tokens)Cached input ($/M tokens)Output ($/M tokens)Context window
Kimi K3$3.00$0.30$15.001,048,576
GPT-5.6 Sol$5.00$0.50$30.001,050,000
Claude Opus 4.8$5.00$0.50$25.001,000,000
Claude Fable 5$10.00$1.00$50.001,000,000

Prices from each company’s own pricing page: Moonshot, OpenAI, Anthropic. Verified July 2026.

Put it in real terms. Say your app burns through 50M input tokens and 10M output tokens in a month — a realistic load for an agent generating web pages all day:

ModelInput costOutput costTotal
Kimi K3$150$150$300
GPT-5.6 Sol$250$300$550
Claude Opus 4.8$250$250$500
Claude Fable 5$500$500$1,000

Same workload, more than 3× the bill on Claude Fable 5. And that’s before K3’s cache discount kicks in on repeated prompts, which would widen the gap further.

Put the three sections together and the pitch for K3 is simple: it’s the cheapest model here, and it happens to be ranked #1 on the exact benchmark that measures frontend and web-page quality. For the hardest long-horizon coding work, Claude Fable 5 and GPT-5.6 Sol still win — so the right model depends on the job, not just the price tag.

Why This Release Is a Big Deal for China’s AI Industry

K3 isn’t just a good model — it’s the largest open-weight model anyone has ever released. At 2.8 trillion parameters, once the weights drop on July 27, it becomes the first model in the 3-trillion-parameter class that anyone can download, run on their own hardware, and modify.

There’s a comeback story behind this. DeepSeek’s R1 release in January 2025 hit Moonshot hard — Kimi’s ranking among China’s chat apps reportedly fell from 3rd to 7th by active users. Moonshot’s answer was to go open: Kimi K2 in July 2025, K2.5 in January 2026, and now K3 — each one a bigger bet that developer adoption, not a closed subscription, is how you win back relevance.

The timing wasn’t an accident either. K3 launched right before the 2026 World AI Conference in Shanghai, and Chinese state media covered it as a national milestone. That framing tracks with a real, measurable shift: Mozilla’s State of Open Source AI report puts the average gap between open and closed frontier models at just 3.3 percentage points now, down sharply from a year ago. K3, alongside DeepSeek and Z.ai’s GLM-5.2, is a big part of why that gap keeps closing.

What this means if you’re building something, regardless of where you sit on the geopolitics:

  • You’re no longer locked into a foreign API for near-frontier performance. A model this capable that you can self-host matters a lot if you have data-residency rules or just don’t want to depend on one provider.
  • This is what’s pushing prices down everywhere. When an open model gets this close to the closed frontier on specific tasks, closed providers can’t keep charging premium prices for those same tasks. The price table above is the concrete proof of that pressure, not an abstract argument.

Ready to Try It? Here’s How to Get an API Key

Convinced K3 is worth a shot? Let’s get you an API key and a working call in the next five minutes.

Quick technical note first: under the hood, K3 runs on Kimi Delta Attention (KDA) — a hybrid linear attention setup — plus Attention Residuals, with vision built in and a 1M-token context window in the same model. No separate vision model to juggle, no manual chunking for most documents.

Check the official quickstart doc for the latest architecture details — Moonshot is still finalizing things ahead of the July 27 weight release.

Kimi API Platform homepage showing the Kimi K3 launch banner

Step 1: Register and Get an API Key

  1. Go to platform.kimi.ai and click Login in the top right.
  2. You’ll land on the Moonshot login page. There are two ways in:
    • Email + verification code — enter your email, click “Send code,” then enter the code.
    • Continue with Google — one-click OAuth, no Chinese phone number needed.

Kimi Open Platform login page with email/code login and Google OAuth

  1. Once logged in, go to Developer Console → API Keys (or navigate directly to platform.kimi.ai/console/api-keys).
  2. Click Create new key, name it, and copy the key immediately — like most platforms, Kimi only shows the full key once.
# macOS / Linux
export MOONSHOT_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Windows PowerShell
$env:MOONSHOT_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Step 2: Top Up Your Account

Kimi is prepaid, same as the other Chinese model APIs. At the time of writing there’s a launch promotion — the platform banner reads “Kimi K3 has launched! Top up now for up to 30% back in vouchers.” — but promo terms change, so check the current offer on the billing page before assuming it still applies.

If you’re paying from outside China and your card gets rejected on the Alipay checkout page, a virtual card service built for Chinese AI platforms is the usual workaround:

Step 3: Install the SDK

Kimi’s API is OpenAI SDK-compatible:

python3 -m pip install --upgrade "openai>=1.0"

Step 4: Your First API Call

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["MOONSHOT_API_KEY"],
    base_url="https://api.moonshot.cn/v1",  # China endpoint
    # base_url="https://api.moonshot.ai/v1",  # International endpoint
)

completion = client.chat.completions.create(
    model="kimi-k3",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Introduce Kimi K3 in one sentence."},
    ],
)

print(completion.choices[0].message.content)

cURL

curl https://api.moonshot.ai/v1/chat/completions \
  --header "Authorization: Bearer $MOONSHOT_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "kimi-k3",
    "messages": [{"role": "user", "content": "Introduce Kimi K3 in one sentence."}]
  }'
💡 China vs international endpoint: same request format, different server location. Mainland accounts typically use api.moonshot.cn; international accounts use api.moonshot.ai. Use whichever matches where you registered.

Step 5: Streaming

stream = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Explain KDA (Kimi Delta Attention) in simple terms."}],
    stream=True,
)

for chunk in stream:
    delta = chunk.choices[0].delta.content or ""
    print(delta, end="", flush=True)

The Cache Discount: How to Cut Your Bill by 10×

K3’s pricing has a trick built in — a cache discount that most people miss on their first few API calls:

ModelUnitInput (cache hit)Input (cache miss)OutputContext window
kimi-k31M tokens$0.30$3.00$15.001,048,576 tokens

Official Kimi K3 pricing table showing cache hit, cache miss, output price, and context window

Here’s the plain-English version. A cache hit happens when the start of your request — system prompt, a long document, a few examples — is byte-for-byte the same as something Moonshot processed for you recently. Those tokens cost $0.30 instead of $3.00. That’s a 10× discount, just for reusing the same prefix. A cache miss just means it’s the first time (or the cache expired), so you pay full price.

So if you’re hitting the API over and over with the same long system prompt or reference document, and only the last user message changes — keep that shared part identical every time, down to the whitespace. Reformat it, reorder it, add a stray space, and you break the cache and land back on $3.00/M.

⚠️ Heads up — output got pricier, not cheaper. K3's output price ($15.00/M) is nearly 4× what K2.6 charged ($4.00/M). It's a bigger, smarter model, and it costs more to run. The cache discount helps if your workload leans on long shared context — but if you're mostly generating long output with little reused context, K3 isn't automatically the cheaper pick. Match the model to the job, not the sticker price.

Should You Use K3 or Stick with K2.6?

FeatureKimi K3Kimi K2.6
Context window1,048,576 tokens262K tokens
Native vision✅ Built inNeeds kimi-k2.5
Input price$0.30/M (cached) · $3.00/M$0.95/M flat
Output price$15.00/M$4.00/M
Open weightsPromised July 27, 2026✅ Already released

Short version: K3 gets you 4× the context window and vision baked in, but you pay more per output token and the weights aren’t downloadable yet. If your documents already fit inside 262K tokens, K2.6 is cheaper and you can run it yourself today — no reason to pay more for headroom you don’t need.

Kimi K3 quickstart documentation page, describing KDA and the 1M-token context window

FAQ

Is Kimi K3 actually open source?

Not yet, in the sense of “downloadable weights.” Moonshot has committed to releasing the full weights by July 27, 2026, and describes K3 as designed to be the first open model in the 3-trillion-parameter class. Until the weights drop, you can only use K3 through the hosted API.

Do I still need kimi-k2.5 for image inputs?

No. Unlike K2.6 (which routes vision tasks to kimi-k2.5), K3 has native visual understanding built into the same model. Send image content in the same kimi-k3 call.

Which endpoint should I use — .cn or .ai?

Match it to where you registered. The request format is identical either way; only the server location differs.

My card was declined on the top-up page. Now what?

Try a different card first — some international banks block Alipay-routed charges outright. If that fails, a virtual card service built for this exact problem (see WildCard) is the common workaround for developers outside China.

Next Steps

📝 Tutorial version notes: Written against the Kimi K3 API and official pricing docs, verified July 2026. K3’s open-weight release is still pending at time of writing — re-check the model’s status before building around the “open-source” claim.