model field in the request body.
Try in playground
Test Moonshot Kimi in the Runpod Hub playground.
This endpoint is fully compatible with the OpenAI API. See the OpenAI compatibility examples below.
Model variants
Choose a variant by setting themodel field in the request body (default kimi-k2.6). The endpoint slug stays moonshot-kimi for every variant.
To target a variant other than the default, set the
model field to its ID. For example, to use the flagship model, set "model": "kimi-k3" in the request body (or model="kimi-k3" with the OpenAI SDK).
Request
All parameters are passed within theinput object in the request body.
The Kimi variant to use. One of
kimi-k2.6, kimi-k2.7-code, kimi-k3, kimi-k3.1-pro, or kimi-k3.1-pro-highspeed.Maximum number of tokens to generate. On the native route (
/run and /runsync), this must be set at the top level of input. This cap counts reasoning tokens as well as visible output tokens. Kimi K3.1 models reason before they answer, so for coding tasks with kimi-k3.1-pro or kimi-k3.1-pro-highspeed, set it to 8,192 or higher so the model has room to finish its answer.Controls how much reasoning the model performs before answering. One of
low, high, or max. Specific to the kimi-k3 variant.Sampling parameters such as
max_tokens must sit at the top level of the input object on the native route. Nesting them inside a sampling_params object has no effect: the values are ignored, and generation continues until the model stops on its own. Check finish_reason in the response ("length" means the max_tokens cap was reached, "stop" means the model finished on its own) to confirm the cap took effect.Response
Array of result objects. Each element contains the cost and the generated chat completion.
The chat completion. Contains
choices, usage, and metadata (id, object, model, created).Generated choices. Each has an
index, a finish_reason ("stop" or "length"), and a message with role, content, and, for reasoning variants such as kimi-k3, reasoning_content.OpenAI API compatibility
Moonshot Kimi is fully compatible with the OpenAI API format. You can use the OpenAI Python client to interact with this endpoint. You can setmodel to any of the five variant IDs.
Python (OpenAI SDK)
stream=True:
Python (Streaming)