Claude Opus 5.5 is live on SeedRouter

Kimi K3 API: how to get a key and make your first call

How to access the Kimi K3 API: get a key, call kimi-k3 with the OpenAI SDK, set reasoning effort, stream, send images and fix the errors new users hit first.

Read as Markdown

To call Kimi K3, you need an API key from a platform that serves it and a request with model set to kimi-k3. Moonshot AI serves it on its own Kimi API Platform, where the model unlocks after a first top-up. SeedRouter serves it with one key, pay-as-you-go, in the official request format: point the OpenAI SDK at https://api.seedrouter.ai/v1 and keep your code.

This guide uses SeedRouter; the request bodies are the same as Kimi's own API.

How do I get a Kimi K3 API key?

  1. Sign in to SeedRouter and open API keys.
  2. Create a key and copy it; it is shown once.
  3. Add credit when you need it. New accounts start with a small free balance, and there is no subscription.

Keep the key in an environment variable such as SEEDROUTER_API_KEY, and only use it from server-side code.

How do I call Kimi K3 from Python?

Kimi K3 speaks the Chat Completions format, so the official openai package works as is:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["SEEDROUTER_API_KEY"],
    base_url="https://api.seedrouter.ai/v1",
)

completion = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Explain context caching in one sentence."}],
)
print(completion.choices[0].message.content)

The answer is in content. Kimi K3 reasons before it answers, and that reasoning comes back in reasoning_content on the same message.

How do I call it from Node.js or cURL?

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.SEEDROUTER_API_KEY,
  baseURL: "https://api.seedrouter.ai/v1",
});

const completion = await client.chat.completions.create({
  model: "kimi-k3",
  messages: [{ role: "user", content: "Explain context caching in one sentence." }],
});
console.log(completion.choices[0].message.content);
curl https://api.seedrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "kimi-k3", "messages": [{"role": "user", "content": "Explain context caching in one sentence."}]}'

The same key also answers the Responses API (/v1/responses) and the Anthropic Messages format (/v1/messages) for kimi-k3.

How do I set reasoning effort?

Kimi K3 always reasons; you cannot turn it off. reasoning_effort sets how much it thinks before answering:

completion = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Find the bug: def avg(xs): return sum(xs) / len(xs)"}],
    reasoning_effort="high",
)
ValueUse it for
lowQuick, simple steps
highMost coding and analysis
max (default)The hardest problems

Reasoning tokens are billed as output and count toward max_completion_tokens, which defaults to 131,072 and goes up to 1,048,576. In our test on the same question, low used 25 output tokens and max used 146.

How do I stream the answer?

Add stream=True. Reasoning arrives first in delta.reasoning_content, then the answer in delta.content. Ask for stream_options={"include_usage": True} to get the token counts in the last chunk:

stream = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Write a haiku about latency."}],
    stream=True,
    stream_options={"include_usage": True},
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

Can I send images?

Yes, as base64 data URIs. Kimi K3 does not accept public image URLs; its quickstart says "Vision input does not support public image URLs":

import base64

with open("chart.png", "rb") as f:
    image = base64.b64encode(f.read()).decode()

completion = client.chat.completions.create(
    model="kimi-k3",
    messages=[{
        "role": "user",
        "content": [
            {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
            {"type": "text", "text": "What does this chart show?"},
        ],
    }],
)

What errors should I expect?

ErrorCauseFix
400 on temperature, top_p, n or a penaltyKimi K3 fixes them (1.0, 0.95, 1, 0)Leave them out
400 on reasoning_effortA value other than low, high or maxUse one of the three
400 on an imageA public URL instead of a data URISend the image as base64
401Missing or wrong keyCheck the Authorization header

Errors return {"error": {"code": ..., "message": "..."}}, and a request that fails is not charged.

Frequently asked questions

Is the Kimi K3 API OpenAI-compatible?

Yes. Kimi K3 takes the Chat Completions and Responses formats, so the OpenAI SDK works with only the base URL and model changed. It also takes the Anthropic Messages format.

Do I need a Moonshot account to use Kimi K3?

Not on SeedRouter. You sign in to SeedRouter, create a key there and pay from your SeedRouter balance.

How much does a Kimi K3 request cost?

It is billed per input and output token. The Kimi K3 pricing guide has the live rates and worked examples.

Where is the full parameter list?

The Kimi K3 API reference lists every field, with the Kimi K3 page for a playground and live prices.

Related guides