AIWave API

Kimi API Guide for International Developers (2026)

Kimi — built by Moonshot AI — is one of China's top large language models, known for its 200K context window and exceptional long-form reasoning. If you're a developer outside China, this guide covers everything: how to access it, pricing, model selection, and code examples.

⚡ Use Kimi API in 5 Minutes — No Chinese Phone Number

OpenAI-compatible endpoint. $0.20 starter credit. Start building immediately.

Get Started →

Kimi and Moonshot models on AIWave (USD per 1M tokens)

ModelInputOutputCache hit (input)Best for
kimi-k2.5$0.660$3.300$0.122Long-context reasoning, agents, coding
kimi-k3$4.500$22.500$0.900Hardest agentic + long-doc work only
moonshot-v1-8k$0.300$2.200Short prompts, most cost-effective entry point
moonshot-v1-32k$0.950$2.850Medium context, drafting, summaries

Rates read from AIWave's live pricing endpoint; check it before budgeting since providers revise rates.

Read the output column before you commit

The input prices make Kimi look cheap. The output prices are where it bites. kimi-k2.5's $3.300/1M output is 9x deepseek-chat's $0.364 for the same generated token, and kimi-k3 at $22.500/1M output is a genuinely expensive model — 6.8x kimi-k2.5 and roughly 62x deepseek-chat. Kimi earns those numbers on one axis: context. If your task does not actually need a very long window, you are paying a long-context premium for nothing, and a DeepSeek or GLM model does the same job for a fraction of the output cost.

The practical rule: reach for Kimi when the prompt genuinely spans an entire codebase, a long PDF, or a multi-document research set. For short chat, classification, or extraction, moonshot-v1-8k at $0.300/$2.200 is the cheap entry point, and models outside the Kimi family are usually cheaper still.

The cache discount changes the math on repeated prompts

kimi-k2.5 bills cached input at $0.122/1M against a $0.660 base — an 81% cut on any prefix the platform has already processed. For long-context work this matters more than for anyone else, because the expensive part of a long-context call is the input you resend every turn. Pin the big document as a stable prefix, keep the variable question last, and repeated turns over the same document are billed at the cache rate. Break the prefix — inject a turn counter, reorder the context — and every token reverts to full price.

Python Quickstart

import openai

client = openai.OpenAI(
    base_url="https://aiwave.live/v1",
    api_key="sk-your-aiwave-key"
)

response = client.chat.completions.create(
    model="kimi-k2",
    messages=[{"role": "user", "content": "Explain quantum computing in one paragraph"}]
)

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

Node.js Quickstart

import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://aiwave.live/v1',
  apiKey: 'sk-your-aiwave-key'
});

const response = await client.chat.completions.create({
  model: 'kimi-k2',
  messages: [{ role: 'user', content: 'Write a haiku about AI' }]
});

console.log(response.choices[0].message.content);

curl Quickstart

Same endpoint, same JSON contract as OpenAI — handy for a shell smoke test:

curl https://aiwave.live/v1/chat/completions \
  -H "Authorization: Bearer sk-your-aiwave-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kimi-k2.5",
    "messages": [{"role": "user", "content": "Summarize the attached RFC in 5 bullets: ..."}],
    "max_tokens": 600
  }'

Long-context in practice

Kimi's reason for existing is the long window, so here is the shape that actually uses it: load a large document once as a system-level prefix, then ask questions against it. Keep the document first and stable so the cache can catch it on later turns.

from openai import OpenAI

client = OpenAI(base_url="https://aiwave.live/v1", api_key="sk-your-aiwave-key")

with open("spec.md") as f:
    doc = f.read()          # a long document: an RFC, a codebase dump, a paper

resp = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[
        {"role": "system", "content": "Answer only from the document below.\n\n" + doc},
        {"role": "user", "content": "List every backwards-incompatible change."},
    ],
)
u = resp.usage
print(u.prompt_tokens, "input tokens")   # long docs make input the dominant cost
print(resp.choices[0].message.content)

Watch prompt_tokens: on a long-context call the input dwarfs the output, which is exactly why the $0.122 cache rate on kimi-k2.5 is the number that decides whether the workload is affordable.

Which Kimi model to pick

Why Use Kimi via AIWave Instead of Directly?

FeatureDirect Moonshot APIVia AIWave
Chinese phone number required❌ Yes✅ No
Payment methodsAlipay/WeChat onlyUSD, card payments, Stripe
API formatCustom Moonshot formatOpenAI-compatible
Multi-model accessKimi onlyKimi + DeepSeek + GLM + 50+
prepaid creditsVaries$1 (1.5M+ input tokens)
Rate limitingPer-accountAggregated, higher limits

When to Choose Kimi Over Other Models

💡 Pro tip: For maximum cost savings, use kimi-k1.5 for bulk processing tasks and kimi-k2 for quality-critical operations. Combine with DeepSeek-Reasoner for math-heavy workloads.

Function calling with Kimi

kimi-k2.5 supports OpenAI-style tool calling, which is what turns it into an agent rather than a chatbot. You declare tools, the model returns a structured call, you execute it and feed the result back — the same schema you already use with OpenAI:

from openai import OpenAI

client = OpenAI(base_url="https://aiwave.live/v1", api_key="sk-your-aiwave-key")

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Current weather for a city",
        "parameters": {
            "type": "object",
            "properties": {"city": {"type": "string"}},
            "required": ["city"],
        },
    },
}]

resp = client.chat.completions.create(
    model="kimi-k2.5",
    messages=[{"role": "user", "content": "What should I pack for Shanghai today?"}],
    tools=tools,
)
call = resp.choices[0].message.tool_calls[0]
print(call.function.name, call.function.arguments)   # get_weather {"city": "Shanghai"}

For agent loops the output rate is the thing to watch: every reasoning step is billable output at $3.300/1M, so a chatty ten-step agent on kimi-k2.5 can cost more than the single task it is automating. Cap the step count and set max_tokens.

Pairing Kimi with a cheaper fallback

The pattern that keeps long-context costs sane: default to a cheap model and escalate to Kimi only when the input is actually long. One base_url, so the switch is a string:

def choose_model(prompt_tokens):
    if prompt_tokens > 60_000:
        return "kimi-k2.5"       # long context earns Kimi's premium
    return "deepseek-chat"        # 9x cheaper output for everything else

model = choose_model(count_tokens(prompt))
resp = client.chat.completions.create(model=model, messages=messages)

Route by the one variable that justifies Kimi — input length — and most of your traffic never touches the expensive path.

Kimi vs DeepSeek vs GLM for the same task

Kimi is not the most cost-effective model on AIWave and it is not trying to be. It occupies one niche — long context — and the pricing reflects that. The honest trade, output rate side by side:

ModelOutput $/1MPick it when
deepseek-chat$0.364General chat, extraction, most work — 9x cheaper output
glm-4.7$3.410Balanced reasoning, agent loops, tool use
kimi-k2.5$3.300The prompt genuinely spans a long document or codebase
kimi-k3$22.500Only the hardest long-context agentic tasks

kimi-k2.5 and glm-4.7 output cost almost the same ($3.30 vs $3.41). At that point the deciding question is context: if you need to reason across 128K+ of input, Kimi's window and its $0.122 cache rate win. If you do not, glm-4.7 is the safer generalist and deepseek-chat is far cheaper.

Getting a key and your first call

The reason to go through AIWave rather than Moonshot directly is that there is no Chinese phone number and no Alipay. Sign in with email or GitHub at the console, create a key, and the code above works immediately — the $0.20 starter credit runs a few million tokens of moonshot-v1-8k while you evaluate. Set the key as an environment variable rather than hard-coding it:

export AIWAVE_KEY="sk-your-aiwave-key"
# read os.environ["AIWAVE_KEY"] (Python) or process.env.AIWAVE_KEY (Node)

Rotating a leaked key then becomes a config change, not a code deploy.

Long-context gotchas worth knowing

Common errors and how to read them

Why long context is priced the way it is

It helps to know what you are paying for. Attention cost grows with sequence length, so a 128K-token prompt is genuinely more expensive to serve than a 4K one — the provider spends more compute per request. That is why kimi-k3 output sits at $22.500/1M, and why the cache rate exists at all: reprocessing the same long prefix every turn is the expensive part, so billing it once at $0.900 (k3) or $0.122 (k2.5) and reusing it is how long-context work stays viable. Design around that and Kimi is a scalpel; ignore it and the bill balloons.

Streaming and timeouts on long prompts

A 128K-token call can take tens of seconds to first token, and the default HTTP timeout in most SDKs fires before a large completion finishes. Two fixes: stream, so you render tokens as they arrive instead of blocking on the whole response, and raise the client timeout explicitly for long-context work.

client = OpenAI(base_url="https://aiwave.live/v1",
                api_key="sk-your-aiwave-key",
                timeout=120.0)   # seconds; the default is too low for 128K prompts

stream = client.chat.completions.create(
    model="kimi-k2.5", stream=True, messages=messages)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

Streaming also improves perceived latency, which on a slow long-context model is the difference between "thinking" and "hung".

The short version

Kimi is a long-context specialist priced like one. moonshot-v1-8k ($0.300/$2.200) is the cheap entry, kimi-k2.5 ($0.660/$3.300, cache $0.122) is the workhorse for documents and agents, and kimi-k3 ($4.500/$22.500) is the break-glass model for the hardest long-context jobs. The output price decides everything: at $3.300/1M, kimi-k2.5 is 9x deepseek-chat, so use Kimi when the window is the point and route ordinary generation to a cheaper model. Build a length-based switch, lean on the cache rate for repeated prefixes, and the long context becomes an asset instead of a line item.

Related Guides

\n

References

Terms of ServicePrivacy PolicyContact © 2026 AIWave

128K context. Vision. Reasoning. Kimi K2.5 on AIWave — $0.20 starter credits.

Explore Models →