Moonshot AI · Kimi
Kimi API
Kimi K3.1 Pro, K3, K2.7 Code and K2.6: four models on one API key, at about 40% of Moonshot's official prices.
OpenAI-compatible /v1/chat/completions that also plugs into Claude Code. kimi-k2.7-code and kimi-k2.6 start at $0.3847 per 1M input tokens, with unlimited concurrency.
- Models K3.1 Pro · K3 · K2.7 Code · K2.6
- Context Up to 1M
- Input From $0.3847 / 1M
- Concurrency Unlimited
- Business Self-service invoices
Four Kimi models
Same key, same endpoint. Change the model ID to match the task.
- Latestkimi-k3.1-pro
Kimi K3.1 Pro
The first K3.1 series model. Moonshot gave K3 much more post-training, with clear gains in coding, 3D creation, financial research and long-horizon agents.
- 1,048,576-token context
- Hallucination rate down from 23.4% to 8.3%
- About a third cheaper than K3
- kimi-k3
Kimi K3
The previous-generation flagship: Moonshot's open-weight 2.8T-parameter model for long-horizon coding, knowledge work and deep reasoning.
- 1,048,576-token context
- Always thinks, adjustable reasoning_effort
- Native vision
- Codingkimi-k2.7-code
Kimi K2.7 Code
A coding agent model built on K2.6. Follows instructions more reliably over long context and uses fewer thinking tokens.
- 256K context
- Thinking always on, interleaved tool calls
- Kimi Code Bench v2 62.0
- kimi-k2.6
Kimi K2.6
An open native multimodal agent model with thinking and non-thinking modes, for coding and general chat.
- 256K context
- Thinking on or off
- SWE-Bench Verified 80.2
Kimi API pricing
Pay per token at fixed rates, with no subscription or monthly fee. All four models cost about 40% of Moonshot's official USD prices.
- Per tokenInput, output and cache priced separately
- About 60% offvs Moonshot official USD prices
- Unlimited concurrencyOn by default for every user
- USDOne balance for 300+ models
| Item | AnyAIGC | Moonshot official | Savings |
|---|---|---|---|
kimi-k3.1-pro · Kimi K3.1 Pro | |||
| Inputper 1M tokens | $0.8100 | $2.00 | 60% |
| Outputper 1M tokens, incl. thinking | $4.0500 | $10.00 | 60% |
| Cache hitper 1M tokens | $0.0810 | $0.20 | 60% |
kimi-k3 · Kimi K3 | |||
| Inputper 1M tokens | $1.2150 | $3.00 | 60% |
| Outputper 1M tokens, incl. thinking | $6.0750 | $15.00 | 60% |
| Cache hitper 1M tokens | $0.1215 | $0.30 | 60% |
kimi-k2.7-code · Kimi K2.7 Code | |||
| Inputper 1M tokens | $0.3847 | $0.95 | 60% |
| Outputper 1M tokens, incl. thinking | $1.5980 | $4.00 | 60% |
| Cache hitper 1M tokens | $0.0770 | $0.19 | 59% |
kimi-k2.6 · Kimi K2.6 | |||
| Inputper 1M tokens | $0.3847 | $0.95 | 60% |
| Outputper 1M tokens, incl. thinking | $1.5980 | $4.00 | 60% |
| Cache hitper 1M tokens | $0.0651 | $0.16 | 59% |
Prices are in USD and billed on the tokens you actually use. Output includes thinking tokens, and repeated prompt prefixes are billed at the cache-hit rate automatically. Official prices come from the Kimi platform pricing page (USD). The table shows the lowest price in the model catalog; see the AnyAIGC model catalog for live pricing.
Cost examples
Estimates for common workloads. The struck-through figure is the same usage at Moonshot official prices.
-
K3.1 Pro · 20 agent coding turns
Each turn: 50K cache-hit tokens + 5,000 input + 3,000 output
$0.405
Official
$1.00 -
K2.7 Code · review 100 PRs
Each PR: 20K input tokens + 2,000 output
$1.09
Official
$2.70 -
K2.6 · classify 10,000 tickets
Each ticket: 2,000 input tokens + 300 output
$12.49
Official
$31.00
Kimi K3.1 Pro vs K3 vs K2.7 Code vs K2.6
Send the hardest work to K3.1 Pro, everyday coding to K2.7 Code, and use K2.6 for fast replies or when thinking should be off.
| Spec | K3.1 Pro | K3 | K2.7 Code | K2.6 |
|---|---|---|---|---|
| Role | Latest flagship | Previous flagship | Coding agent | General multimodal agent |
| Total parameters | 3T-class | 2.8T | 1T | 1T |
| Context | 1M | 1M | 256K | 256K |
| Thinking | Always on | Always on | Always on | On or off |
| AnyAIGC inputper 1M tokens | $0.8100 | $1.2150 | $0.3847 | $0.3847 |
| AnyAIGC outputper 1M tokens | $4.0500 | $6.0750 | $1.5980 | $1.5980 |
| Cache hitper 1M tokens | $0.0810 | $0.1215 | $0.0770 | $0.0651 |
Specs come from Moonshot AI's Hugging Face and Kimi platform materials. Prices are current AnyAIGC prices; see the model catalog for live pricing.
What teams build with the Kimi API
- 01 · Long-horizon coding
Large refactors and cross-file changes
K3.1 Pro's 1M context holds a whole codebase and works through terminal tools step by step. On a tighter budget, switch to K2.7 Code at about half the price of K3.1 Pro.
- 02 · Coding agents
Claude Code, CI and auto-fix
Plug Kimi into Claude Code or your own agent framework to run tests, read errors and patch code. AnyAIGC does not cap concurrency, so many agents can run at once.
- 03 · Front end and design
Screenshots to shippable UI
All four models read images. Hand over a design file or page screenshot and get HTML, CSS or component code back.
- 04 · Knowledge work
Financial research and long documents
Load whole financial reports, contracts or research packs into context to extract fields, build financial models and draft reports. Moonshot reports 64.4 on OfficeQA Pro v2 for K3.1 Pro.
Connect to the Kimi API in three steps
- Sign up and add credit: create an account at anyaigc.ai. Top up from $1; your balance works across every model on the platform.
- Create an API key: create a key in the console, copy the value that starts with
sk-, and store it in theANYAIGC_API_KEYenvironment variable. - Send a request: call
POST https://anyaigc.ai/v1/chat/completionswithmodelset tokimi-k3.1-proand anAuthorization: Bearerheader. With the OpenAI SDK, just setbase_urltohttps://anyaigc.ai/v1.
curl https://anyaigc.ai/v1/chat/completions \
-H "Authorization: Bearer $ANYAIGC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k3.1-pro",
"messages": [
{"role": "user", "content": "Explain what a MoE model is in three sentences."}
]
}'
import os
from openai import OpenAI
client = OpenAI(
base_url="https://anyaigc.ai/v1",
api_key=os.environ["ANYAIGC_API_KEY"],
)
resp = client.chat.completions.create(
model="kimi-k2.7-code",
messages=[
{"role": "system", "content": "You are a senior backend engineer. Answer with runnable code."},
{"role": "user", "content": "Write an HTTP client in Go with timeouts and retries."},
],
)
msg = resp.choices[0].message
print(getattr(msg, "reasoning_content", None)) # reasoning trace, if any
print(msg.content)
print(resp.usage)
import os
from openai import OpenAI
client = OpenAI(base_url="https://anyaigc.ai/v1", api_key=os.environ["ANYAIGC_API_KEY"])
stream = client.chat.completions.create(
model="kimi-k2.6",
messages=[{"role": "user", "content": "Write 5 changelog entries for a SaaS product."}],
stream=True,
)
for chunk in stream:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
# reasoning_content deltas arrive first, then the final answer in content
reasoning = getattr(delta, "reasoning_content", None)
if reasoning:
print(reasoning, end="", flush=True)
if delta.content:
print(delta.content, end="", flush=True)
print()
Tip: Kimi returns its reasoning in the reasoning_content field. When streaming, reasoning deltas arrive first, then the final answer. In multi-turn chats and tool calls, send the full assistant message from the API (including reasoning_content and tool_calls) back in the next request unchanged.
See the Chat Completions reference for every parameter. Replace the model name in the docs examples with the Kimi model ID you want.
Use Kimi in Claude Code
Switch Claude Code to Kimi by editing one config file, and the coding agent in your terminal runs on Kimi.
- Install Claude Code: use the official installer (for example
npm install -g @anthropic-ai/claude-code). - Add the config: edit
~/.claude/settings.json, add the env block below, and replaceANTHROPIC_AUTH_TOKENwith the key you created on AnyAIGC. - Start coding: run
claudein your project folder. Type/modelto confirm the current model iskimi-k3.1-pro.
{
"env": {
"ANTHROPIC_BASE_URL": "https://anyaigc.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-your-API-key",
"ANTHROPIC_MODEL": "kimi-k3.1-pro",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "kimi-k3.1-pro",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "kimi-k3.1-pro",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "kimi-k3.1-pro",
"API_TIMEOUT_MS": "300000"
}
}
Switching models: for a cheaper coding model, replace every kimi-k3.1-pro in the config with kimi-k2.7-code. K3.1 Pro has 1M context for large repos; K2.7 Code costs about half as much.
For the full walkthrough and common errors, see the Claude Code setup guide. Swap the model name in the guide for kimi-k3.1-pro.
Kimi API for teams and enterprises
Teams can top up, issue invoices themselves, and work with a dedicated support and technical contact.
- Invoices
Issue them yourself
Issue an invoice in the console for the amount you actually topped up, whenever you need one.
- Dedicated support
Account and technical contacts
Work with a dedicated support contact and technical engineer for onboarding, migration and troubleshooting.
- WeChat Pay
- Alipay
- USDT
- Credit card
Why teams trust AnyAIGC
Trial credit, top-ups, refunds, data handling and billing, spelled out up front.
5M free tokens to start
New accounts get trial credit, so you can test before you top up.
Top up from $1, refundable
Top up from $1. Unused balance can be refunded with no fee.
Official channels, real models
Requests go to official model channels, never cheaper or reverse-engineered substitutes.
No retention, no training
Unless the law requires it, your prompts and outputs are not persistently stored or used for training. See the privacy policy.
Transparent billing, spend caps
See tokens and cost for every request in the console, and set a quota on each API key.
24/7 support
Contact support any time about integration, billing or incidents.
All Kimi models
One API key calls every Kimi model below. Pick by task difficulty and budget.
- Kimi overviewK3.1 Pro, K3, K2.7 Code and K2.6 pricing compared
- LatestKimi K3.1 ProFirst K3.1 series model, 1M context · input $0.8100 / 1M
- Kimi K32.8T-parameter open weights, 1M context · input $1.2150 / 1M
- CodingKimi K2.7 CodeCoding-tuned K2.6, always thinks · input $0.3847 / 1M
- Kimi K2.6General multimodal agent, thinking optional · input $0.3847 / 1M
Kimi API FAQ
How much does the Kimi API cost?
Kimi models on AnyAIGC are billed per token. Per 1M tokens: kimi-k3.1-pro input $0.8100, output $4.0500, cache hit $0.0810; kimi-k3 input $1.2150, output $6.0750, cache hit $0.1215; kimi-k2.7-code input $0.3847, output $1.5980, cache hit $0.0770; kimi-k2.6 input $0.3847, output $1.5980, cache hit $0.0651. That is about 40% of Moonshot's official USD prices. See the model catalog for live pricing.
Which Kimi models are on AnyAIGC, and what are the model IDs?
This page covers four: kimi-k3.1-pro (the first K3.1 series model, with 1M context), kimi-k3 (the previous-generation flagship, a 2.8T-parameter open-weight model), kimi-k2.7-code (a coding agent model) and kimi-k2.6 (a general multimodal agent model). Put the model ID in the model field of the request body. Switching models only means changing that one field.
Kimi K3.1 Pro, K3, K2.7 Code or K2.6: which should I use?
Pick Kimi K3.1 Pro when you need 1M context, the hardest long-horizon coding, 3D creation or financial research. It is the newest generation and costs about a third less than K3. Workloads already on K3 can stay there. Pick K2.7 Code for everyday coding and coding agents; Moonshot says it scores 21.8% higher than K2.6 on Kimi Code Bench v2. Pick K2.6 when you want non-thinking mode, fast responses or general chat. K2.7 Code and K2.6 cost the same, about half the price of K3.1 Pro.
Is the Kimi API OpenAI compatible?
Yes. All four models use POST https://anyaigc.ai/v1/chat/completions with the same request and response format as OpenAI Chat Completions. With the official OpenAI SDK, set base_url to https://anyaigc.ai/v1. The reasoning trace comes back in the reasoning_content field.
Can I use Kimi in Claude Code?
Yes. In the env block of ~/.claude/settings.json, set ANTHROPIC_BASE_URL to https://anyaigc.ai, ANTHROPIC_AUTH_TOKEN to your API key, and ANTHROPIC_MODEL to kimi-k3.1-pro. Then run claude.
How large is the context window?
According to Moonshot, Kimi K3.1 Pro and K3 support a 1,048,576-token context; K2.7 Code and K2.6 support 262,144 tokens (256K). All four accept image input and support tool calls.
Are Kimi models open source? Can I use them commercially?
Moonshot AI has published the weights for Kimi K3, K2.7 Code and K2.6 on Hugging Face, and Moonshot says the full K3.1 Pro weights will be released by November 4, 2026. Calling the API through AnyAIGC means you do not have to host them yourself. Model licenses and commercial use are governed by Moonshot AI's official terms.
Are there concurrency or rate limits?
AnyAIGC does not cap concurrency for Kimi models, and every user gets this by default. That suits batch jobs, CI pipelines and parallel agents. Moonshot's own platform limits concurrency, RPM, TPM and TPD by top-up tier; those tiers do not apply when you call through AnyAIGC.
How do I get a Kimi API key?
Sign up at anyaigc.ai, add credit, and create a key in the console. The same key works for every Kimi model and 300+ other models on the platform, so you do not need a separate Moonshot platform account.
Can I get an invoice from AnyAIGC?
Yes. You can issue invoices yourself in the console, for the amount you actually topped up.
Which payment methods are supported?
You can top up with WeChat Pay, Alipay, USDT or a credit card. Your balance is in USD and works across every model on the platform. Invoices can be issued in the console for the amount you topped up.
Is there free trial credit for new users?
Yes. New accounts get 5 million tokens of trial credit, so you can test before deciding to top up. Top-ups start at $1.
Can I get a refund on my balance?
Yes. Unused balance can be refunded with no fee. Contact support to start a refund.
Are these the real models? Is my data safe?
Requests go to official model channels, never cheaper or reverse-engineered substitutes. Unless the law requires it, we do not persistently store your prompts or outputs or use them for training, and the console shows tokens and cost for every request.
Will my data be used for training?
No. Except where required by law, AnyAIGC does not persistently store your prompts or outputs and does not use them to train models. Requests are encrypted over HTTPS. See the AnyAIGC Privacy Policy. The model's own data policy is governed by Moonshot AI's official terms.
Run Kimi at about 40% of the official price
Sign up, create an API key, and you can use Kimi K3.1 Pro, K3, K2.7 Code and K2.6 in your code or Claude Code within minutes.