Skip to main content
AnyAIGC

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
Pricing

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
Kimi prices per 1M tokens (USD), AnyAIGC vs Moonshot official
ItemAnyAIGCMoonshot officialSavings
kimi-k3.1-pro · Kimi K3.1 Pro
Inputper 1M tokens$0.8100$2.0060%
Outputper 1M tokens, incl. thinking$4.0500$10.0060%
Cache hitper 1M tokens$0.0810$0.2060%
kimi-k3 · Kimi K3
Inputper 1M tokens$1.2150$3.0060%
Outputper 1M tokens, incl. thinking$6.0750$15.0060%
Cache hitper 1M tokens$0.1215$0.3060%
kimi-k2.7-code · Kimi K2.7 Code
Inputper 1M tokens$0.3847$0.9560%
Outputper 1M tokens, incl. thinking$1.5980$4.0060%
Cache hitper 1M tokens$0.0770$0.1959%
kimi-k2.6 · Kimi K2.6
Inputper 1M tokens$0.3847$0.9560%
Outputper 1M tokens, incl. thinking$1.5980$4.0060%
Cache hitper 1M tokens$0.0651$0.1659%

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

Compare

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.

Kimi K3.1 Pro, K3, K2.7 Code and K2.6 compared; prices are AnyAIGC USD per 1M tokens
SpecK3.1 ProK3K2.7 CodeK2.6
RoleLatest flagshipPrevious flagshipCoding agentGeneral multimodal agent
Total parameters3T-class2.8T1T1T
Context1M1M256K256K
ThinkingAlways onAlways onAlways onOn 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.

Use cases

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.

Quickstart

Connect to the Kimi API in three steps

  1. Sign up and add credit: create an account at anyaigc.ai. Top up from $1; your balance works across every model on the platform.
  2. Create an API key: create a key in the console, copy the value that starts with sk-, and store it in the ANYAIGC_API_KEY environment variable.
  3. Send a request: call POST https://anyaigc.ai/v1/chat/completions with model set to kimi-k3.1-pro and an Authorization: Bearer header. With the OpenAI SDK, just set base_url to https://anyaigc.ai/v1.
POST /v1/chat/completions
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."}
    ]
  }'
Python · openai SDK
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)
Python · stream=True
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.

Claude Code

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.

  1. Install Claude Code: use the official installer (for example npm install -g @anthropic-ai/claude-code).
  2. Add the config: edit ~/.claude/settings.json, add the env block below, and replace ANTHROPIC_AUTH_TOKEN with the key you created on AnyAIGC.
  3. Start coding: run claude in your project folder. Type /model to confirm the current model is kimi-k3.1-pro.
~/.claude/settings.json
{
  "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.

Enterprise

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.

Payment methods
  • 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.

FAQ

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.