Skip to main content
Kimi API Platform provides access to Kimi K3.1 Pro and other models. You can call these models through Chat Completions API, Responses API, or Messages API. To get started, create an API Key, choose a model, and configure base_url. You can then send requests directly over HTTP or use the OpenAI or Anthropic SDK.
Kimi K3.1 Pro and Kimi K3.1 Pro Highspeed are now available. As Kimi’s most capable flagship model to date, K3.1 Pro supports a 1M-token context window and native visual understanding, with significant improvements in coding, 3D creation, financial research, and modeling. It is well suited for programming agents such as Kimi Code, Codex, and Claude Code, as well as knowledge work and deep reasoning. Join the Kimi developer community and let’s build with Kimi!

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.1 Pro; choose the Kimi K3.1 Pro high-speed variant when you need faster output.

Kimi K3.1 Pro

kimi-k3.1-pro is the first flagship of our new K3.1 series — a 3T-class model with a 1M-token context window and major gains in coding, 3D creation, and financial research and modeling.

Kimi K3.1 Pro Highspeed

kimi-k3.1-pro-highspeed is the high-speed variant of Kimi K3.1 Pro — same capabilities at about 2-3× the speed, for scenarios that need faster output.
3

Choose an integration method

Kimi API is compatible with both the OpenAI and Anthropic API formats, so you can choose the integration method that best fits your technology stack.

Chat Completions API

OpenAI-compatible format, with support for the OpenAI SDK and HTTP access from any language.

Responses API

OpenAI-compatible format for generating text/JSON output or calling function tools.

Messages API

Anthropic Messages API compatible, for integrating with the Anthropic SDK, Claude Code, and similar tools.

Playground

Test prompts, model behavior, and business examples without writing code.
4

Make your first call

Set MOONSHOT_API_KEY to the API Key you created in step 1; the examples read the key from this environment variable.Before running the examples, prepare:
  1. Python 3.9 or later, or Node.js 18 or later.
  2. 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.
If the code runs successfully without errors, you will see output similar to:
Note: Because Kimi models are nondeterministic, the actual response may not exactly match the example above.

Model parameter notes

The examples on this page use the latest model kimi-k3.1-pro by default. K3.1 Pro configures reasoning effort with the top-level reasoning_effort request field (supports "low" / "high" / "max", default "max"). To use another model such as kimi-k3.1-pro-highspeed, replace the model field and adjust the parameter configuration for that model. See the Model Parameter Reference.

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.1 Pro, 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.

Kimi K3.1 Pro model

View Kimi K3.1 Pro capabilities, calling examples, and best practices.

Kimi K3.1 Pro Highspeed

View pricing for Kimi K3.1 Pro Highspeed.

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.