// Models · API key guide
Kimi API key: how to get one
Create the key in the Kimi Open Platform console and call the OpenAI-compatible endpoint https://api.moonshot.cn/v1.
4 stepsofficial docs onlychecked 2026-10-26
01How to get a Kimi (Moonshot AI) API key
- Sign up / log in at platform.kimi.com.
- Open Console → API Keys and create a new key.
- Save it as MOONSHOT_API_KEY.
- Call https://api.moonshot.cn/v1 with model kimi-k3.1-pro (Chat Completions, Responses and Anthropic Messages formats are supported).
Official key page: https://platform.kimi.com/console/api-keys – console labels may change; follow what the official page shows.
02Real-name, phone and credit card requirements
| Real-name / ID verification | Required to receive the ¥15 trial voucher. |
|---|---|
| Phone number | The trial voucher is for new users registering with a mainland China phone number. |
| Credit card / payment | Not mentioned in the docs; top-up methods are on the platform’s billing page. |
03Base URL and a minimal call
https://api.moonshot.cn/v1MOONSHOT_API_KEY · Example model:kimi-k3.1-procurl
curl https://api.moonshot.cn/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MOONSHOT_API_KEY" \
-d '{
"model": "kimi-k3.1-pro",
"messages": [{"role": "user", "content": "你好"}]
}' Python
# pip install openai
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["MOONSHOT_API_KEY"], base_url="https://api.moonshot.cn/v1")
resp = client.chat.completions.create(
model="kimi-k3.1-pro",
messages=[{"role": "user", "content": "你好"}],
)
print(resp.choices[0].message.content) 04Free quota
All free AI APIs →¥15 voucher for new users (mainland phone), issued after real-name verification, valid 3 months, not usable for Kimi K3. With the voucher used up and a zero balance, requests return 403.
05Kimi (Moonshot AI) API prices
All model prices →| Model | Input / 1M tokens | Output / 1M tokens | Source |
|---|---|---|---|
Kimi K2.7 Codekimi-k2.7-code | ¥6.5 | ¥27 | official · 2026-10-10 |
Kimi K2.6kimi-k2.6 | ¥6.5 | ¥27 | official · 2026-10-10 |
Kimi K2.7 Code HighSpeedkimi-k2.7-code-highspeed | ¥13 | ¥54 | official · 2026-10-10 |
Kimi K3.1 Prokimi-k3.1-pro | ¥13 | ¥68 | official · 2026-10-24 |
Kimi K3kimi-k3 | ¥20 | ¥100 | official · 2026-10-10 |
Kimi K3.1 Pro Highspeedkimi-k3.1-pro-highspeed | ¥26 | ¥136 | official · 2026-10-24 |
Standard (non-batch) list prices from our price database; cheapest first, max 8 rows. Prices change – the official page wins.
06Keep your API key safe
- A 403 after the trial usually means the voucher is used up and the balance is 0 – top up rather than regenerating keys.
- Keep the key in an environment variable or a secrets manager – never hard-code it, never commit it to Git, never paste it into a screenshot, chat or issue.
- Never put a long-lived key in front-end, mobile or desktop client code – anyone can extract it. Call the API from your own server.
- One key per project or environment, so a leak can be revoked without breaking everything else.
- If a key leaks, delete it in the console immediately and create a new one, then check usage and billing.
- Do not buy keys from resellers or “API relays” and do not paste your key into websites you do not trust.
07FAQ
FAQ
Where do I get a Kimi API key?
platform.kimi.com/console/api-keys after logging in.
Is the Kimi API free?
Only the ¥15 trial voucher for new users (conditions above); otherwise pay-as-you-go.
What is the Kimi API base_url?
https://api.moonshot.cn/v1
08Official sources
- Kimi 开放平台 · 获取 API Key platform.kimi.com
- Kimi API 免费试用额度 www.kimi.com
All facts checked against these pages on 2026-10-26. If anything differs, the official page wins.