The Kimi K3 API is deliberately unsurprising: it speaks OpenAI's shape, so most integrations are a two-line change. What follows is the short version of what actually differs — the four defaults and constraints worth knowing before you ship.
The essentials
| Base URL | https://api.moonshot.ai/v1 |
| Model ID | kimi-k3 |
| Endpoint | /chat/completions (OpenAI-shaped) |
| Context | 1,048,576 tokens tokens |
| Max output | max_completion_tokens, default 131,072 tokens, ceiling 1,048,576 tokens |
| SDKs | The OpenAI SDK works as-is; an Anthropic-compatible endpoint is also available |
Python 3.9+ with the standard OpenAI client is the documented path. There is no bespoke SDK to learn.
Four details that catch people out
- Reasoning is always on and cannot be disabled. There is no
thinking: off. Every request pays a reasoning pass, and those tokens bill as output. Size your token budgets accordingly. reasoning_effortdefaults tomax. Notmedium, nothigh— the most expensive setting is the default. If you deploy without setting it, you are paying top rate on every call. The levels arelow, high, max.- Vision input rejects public image URLs. Pass base64, or upload the file and reference
ms://<file-id>. This is the single most common first-integration failure. max_completion_tokensdefaults to 131,072 tokens. That is generous, and it means a runaway response can be expensive. Set it explicitly to something your use case actually needs.
Parameters worth setting deliberately
reasoning_effort—low, high, max, defaulting tomax. Your main quality-versus-cost dial, and the one to set on day one.max_completion_tokens— set it to your real ceiling. Stream anything large to avoid HTTP timeouts.tools/tool_choice— standard function calling, with dynamic tool loading so you can narrow the set per call.- Prompt ordering — not a parameter, but the highest-leverage decision you make. Stable content first for cache hits, variable content last.
A minimal first call
from openai import OpenAI
client = OpenAI(
api_key="...", # your Moonshot key
base_url="https://api.moonshot.ai/v1",
)
resp = client.chat.completions.create(
model="kimi-k3",
messages=[{"role": "user", "content": "Summarise this repo's test strategy."}],
reasoning_effort="high", # default is "max"
max_completion_tokens=4096, # default is 131072
)
print(resp.choices[0].finish_reason) # check this before reading content
print(resp.choices[0].message.content)
Reading finish_reason first is not ceremony. With a large default output ceiling and always-on reasoning, truncation is the failure mode that most often passes silently into production.
More on Kimi K3
Start with the complete Kimi K3 guide for the overview, or go deeper:
Ready to go deeper?
Read the full Kimi K3 guideFrequently Asked Questions
What is the model ID for Kimi K3?
`kimi-k3`, against the base URL https://api.moonshot.ai/v1. The K3 Max and K3 Swarm Max variants are serving modes rather than separate model ID strings — check Moonshot's current docs if you need to target Swarm Max specifically.
Can I use the OpenAI SDK with Kimi K3?
Yes — that is the documented path. Point the OpenAI client at https://api.moonshot.ai/v1 with your Moonshot key and set the model to `kimi-k3`. An Anthropic-compatible endpoint is available too if your code is written against that SDK instead.
Why is my Kimi K3 response cut off?
Almost always token truncation. Reasoning is always on and shares your output budget, so a tight `max_completion_tokens` can be consumed before the answer starts. Check `finish_reason` on every response, and note that the default ceiling is a generous 131,072 tokens — which can also make a runaway response expensive.


