How to get a Kimi API key (Moonshot AI)
Updated · 6 min read
A Kimi API key comes from Moonshot AI's Kimi API Platform at platform.kimi.ai (the old platform.moonshot.ai address now redirects there). You sign in, top up at least $1, create a key, and call the flagship kimi-k3.1-pro model for $2 per million input tokens and $10 per million output tokens. The API speaks both the OpenAI and the Anthropic format, so the key works in any app that accepts a custom OpenAI- or Anthropic-compatible endpoint. There is no free tier, but Moonshot adds a $5 voucher once your top-ups reach $5.
Step by step
- Sign in at platform.kimi.ai with an email code or your Google account.
- Top up at least $1. Moonshot requires this before your first call. Once your top-ups reach $5 in total, you get a $5 voucher.
- Create a key on the API Keys page, name it after the app and copy it.
- Add it to your app. Pick Moonshot or Kimi if the app lists it. Otherwise add a custom OpenAI-compatible provider with base URL
https://api.moonshot.ai/v1and modelkimi-k3.1-pro. - Set a daily budget in the project settings. When the project reaches it, Kimi rejects further requests. Because billing lags, the cap can take about 10 minutes to kick in.
International or China platform
Moonshot runs two separate platforms, and Kimi's docs tell everyone outside mainland China to use platform.kimi.ai.
| International | Mainland China | |
|---|---|---|
| Console | platform.kimi.ai (was platform.moonshot.ai) | platform.kimi.com (was platform.moonshot.cn) |
| OpenAI-compatible base URL | https://api.moonshot.ai/v1 |
https://api.moonshot.cn/v1 |
| Anthropic-compatible base URL | https://api.moonshot.ai/anthropic |
https://api.moonshot.cn/anthropic |
| Prices | US dollars | Yuan (kimi-k3.1-pro: ¥13 in, ¥68 out) |
Accounts, balances and keys are not shared between the two. A key from one platform sent to the other platform's URL returns 401 invalid_authentication_error, and Kimi's docs say to check this first when you see a 401.
Kimi API pricing
These are the prices per million tokens on the international platform on 2026-11-18 (taxes not included):
| Model | Input | Cached input | Output | Context |
|---|---|---|---|---|
| kimi-k3.1-pro | $2.00 | $0.20 | $10.00 | 1M tokens |
| kimi-k3.1-pro-highspeed | $4.00 | $0.20 | $20.00 | 1M tokens |
| kimi-k3 | $3.00 | $0.30 | $15.00 | 1M tokens |
kimi-k3.1-pro is the newest model, and it costs less than the older K3. The Highspeed variant has the same capabilities at about 2-3x the speed, for double the price. Both K3.1 Pro and K3 read images and video. Moonshot publishes the weights of both, so other hosts on OpenRouter serve them too.
Prompt caching is automatic. Writing a prefix to the default 5-minute cache costs the normal input price, so caching never costs extra. The optional 1-hour cache costs double on write ($4.00 for K3.1 Pro), and every cache hit is billed at the cached-input price. The Batch API runs at 60% of the standard price ($1.20 / $6.00 for K3.1 Pro).
K3.1 Pro always reasons, and its reasoning tokens are billed. Its reasoning_effort defaults to max; set it to low or high if your app exposes the option and the task is simple. A chat turn of 2,000 tokens in and 500 out (reasoning included) costs about $0.009 on K3.1 Pro before caching, so $5 covers roughly 550 such turns. Long agent sessions cost much more.
The older K2 models (kimi-k2.7-code at $0.95 / $4.00, kimi-k2.6 at $0.95 / $4.00) still work only for accounts registered before November 2026, and Moonshot plans to retire them by the end of December 2026.
Is there a free Kimi API key?
No. Every account needs a top-up of at least $1, and the only credit Kimi's docs mention is the $5 voucher at $5 of top-ups. Since September 2026 Kimi deducts usage half from your cash balance and half from vouchers, so $5 of top-ups plus the voucher pays for about $10 of usage. Vouchers can expire, and they do not count toward your rate-limit tier.
On 2026-11-18 OpenRouter had no free Kimi model either. Keys shared online as "free Kimi API keys" are leaked and stop working without notice. For real free tiers, see free AI API keys.
Rate limits by top-up tier
Kimi sets your limits by how much you have topped up in total:
| Tier | Total top-ups | Concurrent requests | Requests / min | Tokens / min | Tokens / day |
|---|---|---|---|---|---|
| Tier0 | $1 | 1 | 3 | 500,000 | 1,500,000 |
| Tier1 | $10 | 15 | 100 | 2,000,000 | Unlimited |
| Tier2 | $20 | 40 | 100 | 3,000,000 | Unlimited |
| Tier3 | $100 | 50 | 200 | 3,000,000 | Unlimited |
Tier4 and Tier5 need $1,000 and $3,000 of top-ups. Tier0's 3 requests per minute is too few for a coding agent, and Kimi warns that the OpenAI SDK's automatic retries can use up a Tier0 account's whole minute on one failed request. If you plan to use agents, top up $10 to reach Tier1.
Use the key in apps
- Chat apps and other OpenAI-compatible tools: base URL
https://api.moonshot.ai/v1, modelkimi-k3.1-pro. The same base URL also serves the Responses API, which Codex uses. - Claude Code and other Anthropic-compatible tools: set
ANTHROPIC_BASE_URLtohttps://api.moonshot.ai/anthropicandANTHROPIC_AUTH_TOKENto your Kimi key. Kimi's guide sets the model tokimi-k3[1m]for every tier (main, Opus, Sonnet, Haiku, Fable and subagent); a tier you leave unset fails quietly. See using other keys in Claude Code. - Kimi Code CLI: run
/loginand pick "Kimi Platform (API key · platform.kimi.ai)", then paste the key. - OpenRouter:
moonshotai/kimi-k3.1-proandmoonshotai/kimi-k3are on OpenRouter. There, Moonshot's own endpoint charges the same $2 / $10, and other hosts set their own prices. One OpenRouter key covers Kimi and hundreds of other models without a separate Moonshot account.
Kimi Code is a separate subscription
Kimi Code (desktop app, CLI and VS Code extension) is part of the Kimi membership, and under the current plans it starts at the Plus tier. Members create up to 5 keys in the Kimi Code Console. Those keys use https://api.kimi.ai/coding/v1 (OpenAI format) or https://api.kimi.ai/coding/ (Anthropic format) and model IDs such as k3.1-pro. Usage counts against the membership quota: a rolling 5-hour window plus a monthly total.
Kimi Code keys and platform keys are not interchangeable, and platform balance cannot pay for a membership. Pay per token on the platform if you use Kimi in several apps. Kimi Code suits daily coding in its own apps and in agents such as Claude Code, which its docs cover. Plan prices are on Kimi's membership page.
Limits and gotchas
- 401 errors mean the key comes from the other platform, from Kimi Code, or has no balance left. Call
GET /v1/modelswith the key to see which models it can use. - 429 errors come in three types.
engine_overloaded_errormeans Moonshot's servers are busy, and topping up does not help.rate_limit_reached_errormeans you hit your tier's limit.exceeded_current_quota_errormeans your balance or voucher ran out. Requests stopped by a 429 are not charged. - Apps that default to old model names (
kimi-k2.5,moonshot-v1-*) fail with "model not found", because those models are retired. Switch tokimi-k3.1-pro. - Coding tools retry and loop, which burns tokens quickly. Set a project budget and turn on balance alerts before you connect one.
- Your data goes to Moonshot AI, a Chinese company. Zero data retention exists only for enterprise customers on request, so keep confidential material out unless you have it.
Keep the key safe
- Use one key per app, so you can revoke one without breaking the others.
- Never put the key in a website's front-end code or a public repository.
- Set a daily project budget before you give the key to a new app.
Apps that work with your Kimi API key
Other options
For another Chinese model family with a free trial, see the Qwen API key guide. DeepSeek is cheaper per token, and OpenRouter puts Kimi, Qwen and DeepSeek behind a single key.
Questions
Is there a free Kimi API key?
No. New accounts must top up at least $1 before they can call the API. When your top-ups reach $5 in total, Moonshot adds a $5 voucher. On 2026-11-18 no Kimi model was free on OpenRouter either.
How much does the Kimi API cost?
kimi-k3.1-pro costs $2.00 per million input tokens and $10.00 per million output tokens, and cached input costs $0.20. The faster kimi-k3.1-pro-highspeed costs $4.00 / $20.00, and kimi-k3 $3.00 / $15.00. Batch jobs cost 60% of these prices.
Is a Moonshot API key the same as a Kimi API key?
Yes. Moonshot AI makes Kimi, and platform.moonshot.ai now redirects to platform.kimi.ai. The API host is still api.moonshot.ai, and Kimi's own examples keep the key in a MOONSHOT_API_KEY variable.
Can I still get a Kimi K2 API key?
Not on a new account. The K2 models (kimi-k2.7-code, kimi-k2.6) are off for accounts registered from the end of October 2026, and Moonshot plans to retire them by the end of December 2026. Use kimi-k3.1-pro instead.
Does my Kimi Code subscription include API access?
Kimi Code members can create their own keys in the Kimi Code Console. Those keys use https://api.kimi.ai/coding/v1, draw on the membership quota and do not work on the pay-as-you-go platform, and platform keys do not work on Kimi Code.
What base URL do I use for Kimi?
https://api.moonshot.ai/v1 for OpenAI-compatible apps and https://api.moonshot.ai/anthropic for Anthropic-compatible ones such as Claude Code. Keys from the China platform use https://api.moonshot.cn/v1 instead.
Sources
Checked against the providers' own documentation on 2026-11-18. Prices and limits change; the links below have the current figures.
- platform.kimi.ai/docs/get-your-api-key
- platform.kimi.ai/docs/pricing/chat
- platform.kimi.ai/docs/pricing/batch
- platform.kimi.ai/docs/pricing/limits
- platform.kimi.ai/docs/models
- platform.kimi.ai/docs/api/overview
- platform.kimi.ai/docs/guide/troubleshooting
- platform.kimi.ai/docs/guide/product-plans
- platform.kimi.ai/docs/guide/account-and-payments
- platform.kimi.ai/docs/guide/use-thinking-models
- platform.kimi.ai/docs/guide/claude-code-kimi
- platform.kimi.ai/docs/guide/kimi-code-cli
- platform.kimi.ai/docs/guide/zero-data-retention
- platform.kimi.ai/docs/platform-changelog
- platform.kimi.com/docs/pricing/chat
- www.kimi.com/code/docs/en/
- www.kimi.com/code/docs/en/kimi-code/membership.html
- openrouter.ai/moonshotai/kimi-k3.1-pro