base_url to make requests through the HTTP API, Python SDK, or Node.js SDK.
Kimi K3 is now officially available — Kimi’s most capable model to date, with a 1M-token context window and native visual understanding. It is well suited for programming agent scenarios such as Codex, Claude Code, Cline, and RooCode, as well as knowledge work and deep reasoning.
Get started
1
Get an API Key
Visit the Kimi API Platform, sign in, then go to API Keys to create and copy an API Key.Keep your API Key secure. Do not share it with others or hard-code it directly in your application. We recommend storing it in an environment variable:
Kimi API Platform
Sign in to the platform to access the console, development workspace, and user center.
API Keys
Create, copy, and manage the keys used for API calls.
2
Choose a model
For a quickstart, we recommend starting with Kimi K3; you can also choose Kimi K2.7 Code or Kimi K2.6 for specific scenarios.
Kimi K3
Kimi K3 is our flagship model for long-horizon coding and end-to-end knowledge work — 2.8 trillion parameters, a 1M-token context window, and industry-leading intelligence.
Kimi K2.7 Code
A coding-focused model with a 256K context window, text/image/video input, and thinking mode. Choose
kimi-k2.7-code-highspeed when you need higher output speed.Kimi K2.6
A powerful general-purpose model with a 256K context window, text/image/video input, and both thinking and non-thinking modes. Use it for general chat, agent tasks, visual understanding, and complex reasoning.
3
Choose an integration method
Kimi API is compatible with the OpenAI API format, so you can choose the integration method that best fits your technology stack.
HTTP API
A standard REST API for any language or custom server-side integration.
OpenAI Python SDK
Use the OpenAI Python SDK to call Kimi from scripts, backend services, data workflows, and prototypes.
OpenAI Node.js SDK
Use the OpenAI Node.js SDK for web services, frontend engineering workflows, and Node.js applications.
Playground
Test prompts, model behavior, and business examples without writing code.
4
Make your first call
The following examples use the Kimi K3 model. Replace Before running the examples, prepare:Note: Because Kimi models are nondeterministic, the actual response may not exactly match the example above.
MOONSHOT_API_KEY with the API Key you created on the platform, or set an environment variable with the same name before running the examples.The examples on this page use the latest model
kimi-k3 by default. K3 uses the top-level reasoning_effort field (currently only "max"). To use another model such as kimi-k2.6 or kimi-k2.5, just replace the model field — parameter configurations differ across models. See the Model Parameter Reference.- python
- curl
- node.js
- Python 3.8 or later, or Node.js 18 or later.
- OpenAI SDK 1.0.0 or later. Kimi API is compatible with the OpenAI API format, so you can call Kimi directly with the OpenAI Python or Node.js SDK.
- An API Key. Create an API Key in the Kimi API Platform, then pass it to the
OpenAI Clientso the platform can identify your account.
Explore more features
Streaming output
Enable
stream to receive tokens as they are generated. Useful for chat, code generation, and long-form text output.Multi-turn chat
Maintain a
messages list to preserve context history, letting the model remember the conversation.Multimodal input
Kimi K3, Kimi K2.7 Code, and Kimi K2.6 all support text, image, and video input.
Tool calls
Let the model call external functions or APIs for Agent tasks, web search, and complex workflows.
JSON Mode
Force the model to output valid JSON for structured data extraction and downstream integration.
Thinking models
Use reasoning capabilities for complex tasks, multi-step tool use, and Agent workflows.
Streaming output
Multimodal input
Related resources
Kimi K3 model
View Kimi K3 capabilities, calling examples, and best practices.
Kimi K2.7 Code model
View Kimi K2.7 Code capabilities, calling examples, and best practices.
Kimi K2.6 model
View Kimi K2.6 capabilities, image/video understanding examples, and tool calling guidance.
Model list
View currently available model names and descriptions.
Join the Kimi Developer Community
Ask questions, share feedback, and showcase what you are building with Kimi.