diff --git a/docs.json b/docs.json index da60be34..263c151c 100644 --- a/docs.json +++ b/docs.json @@ -657,6 +657,7 @@ "group": "Text models", "pages": [ "public-endpoints/models/granite-4", + "public-endpoints/models/moonshot-kimi", "public-endpoints/models/qwen3-32b" ] }, diff --git a/public-endpoints/models/moonshot-kimi.mdx b/public-endpoints/models/moonshot-kimi.mdx new file mode 100644 index 00000000..9a62675d --- /dev/null +++ b/public-endpoints/models/moonshot-kimi.mdx @@ -0,0 +1,293 @@ +--- +title: "Moonshot Kimi" +sidebarTitle: "Moonshot Kimi" +description: "Moonshot's Kimi family of models handles advanced reasoning, chat, and coding, with extended thinking and a visible reasoning trace. See model inputs and outputs on Runpod Public Endpoints." +--- + +Moonshot's Kimi family of models handles advanced reasoning and chat. It supports extended thinking with a visible reasoning trace before the final answer. A single endpoint serves three variants, each selected by setting the `model` field in the request body. + + + Test Moonshot Kimi in the Runpod Hub playground. + + +| | | +|---|---| +| **Endpoint** | `https://api.runpod.ai/v2/moonshot-kimi/runsync` | +| **Pricing** | \$4.00–\$15.00 per 1M tokens | +| **Type** | Text generation | + + +This endpoint is fully compatible with the OpenAI API. See the [OpenAI compatibility examples](#openai-api-compatibility) below. + + +## Model variants + +Choose a variant by setting the `model` field in the request body (default `kimi-k2.6`). The endpoint slug stays `moonshot-kimi` for every variant. + +| `model` value | Description | Context window | Price | +|---|---|---|---| +| `kimi-k2.6` (default) | General-purpose model with thinking and non-thinking modes, agentic capabilities, and multimodal input. | 256K (262,144 tokens) | \$4.00 per 1M tokens | +| `kimi-k2.7-code` | Coding-focused model with thinking mode and agentic capabilities. | 256K (262,144 tokens) | \$4.00 per 1M tokens | +| `kimi-k3` | Flagship model with always-on reasoning and configurable reasoning effort for long-horizon coding and knowledge work. | 1M (1,048,576 tokens) | \$15.00 per 1M tokens | + +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 the `input` object in the request body. + + + Array of message objects with role and content. + + + + The role of the message author. Use `system`, `user`, or `assistant`. + + + + The content of the message. + + + + The Kimi variant to use. One of `kimi-k2.6`, `kimi-k2.7-code`, or `kimi-k3`. + + + + Maximum number of tokens to generate. + + + + Controls randomness in generation. Lower values make output more deterministic. + + + + Seed for reproducible results. + + + + Restricts sampling to the top K most probable tokens. + + + + Nucleus sampling threshold. Range: 0.0-1.0. + + + +```bash cURL +curl -X POST "https://api.runpod.ai/v2/moonshot-kimi/runsync" \ + -H "Authorization: Bearer $RUNPOD_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "input": { + "messages": [ + { + "role": "system", + "content": "You are Kimi." + }, + { + "role": "user", + "content": "What is Runpod?" + } + ], + "sampling_params": { + "max_tokens": 2048, + "temperature": 1 + }, + "model": "kimi-k2.6" + } + }' +``` + +```python Python +import requests + +response = requests.post( + "https://api.runpod.ai/v2/moonshot-kimi/runsync", + headers={ + "Authorization": f"Bearer {RUNPOD_API_KEY}", + "Content-Type": "application/json", + }, + json={ + "input": { + "messages": [ + {"role": "system", "content": "You are Kimi."}, + {"role": "user", "content": "What is Runpod?"}, + ], + "sampling_params": { + "max_tokens": 2048, + "temperature": 1, + }, + "model": "kimi-k2.6", + } + }, +) + +result = response.json() +print(result["output"]) +``` + +```javascript JavaScript +const response = await fetch( + "https://api.runpod.ai/v2/moonshot-kimi/runsync", + { + method: "POST", + headers: { + Authorization: `Bearer ${RUNPOD_API_KEY}`, + "Content-Type": "application/json", + }, + body: JSON.stringify({ + input: { + messages: [ + { role: "system", content: "You are Kimi." }, + { role: "user", content: "What is Runpod?" }, + ], + sampling_params: { + max_tokens: 2048, + temperature: 1, + }, + model: "kimi-k2.6", + }, + }), + } +); + +const result = await response.json(); +console.log(result.output); +``` + + +## Response + + + Unique identifier for the request. + + + + Request status. Returns `COMPLETED` on success, `FAILED` on error. + + + + Time in milliseconds the request spent in queue before processing began. + + + + Time in milliseconds the model took to generate the response. + + + + Identifier of the worker that processed the request. + + + + The generation result containing the text and usage information. + + + Array containing the generated text. + + + + Cost of the generation in USD. + + + + Token usage information. + + + + +```json 200 +{ + "id": "sync-a1b2c3d4-e5f6-7890-abcd-ef1234567890-u1", + "status": "COMPLETED", + "delayTime": 15, + "executionTime": 2345, + "workerId": "oqk7ao1uomckye", + "output": { + "choices": [ + { + "tokens": [ + "Runpod is a cloud computing platform that provides GPU resources for AI and machine learning workloads..." + ] + } + ], + "cost": 0.00074, + "usage": { + "input": 35, + "output": 150 + } + } +} +``` + +```json 400 +{ + "id": "sync-a1b2c3d4-e5f6-7890-abcd-ef1234567890-u1", + "status": "FAILED", + "error": "Invalid messages format" +} +``` + + +## 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 set `model` to any of the three variant IDs. + +```python Python (OpenAI SDK) +from openai import OpenAI + +client = OpenAI( + api_key=RUNPOD_API_KEY, + base_url="https://api.runpod.ai/v2/moonshot-kimi/openai/v1", +) + +response = client.chat.completions.create( + model="kimi-k2.6", + messages=[ + { + "role": "system", + "content": "You are Kimi.", + }, + { + "role": "user", + "content": "What is Runpod?", + }, + ], + max_tokens=2048, + temperature=1, + reasoning_effort="max", # set for adding reasoning + top_p=0.9, +) + +print(response.choices[0].message.content) +``` + +For streaming responses, add `stream=True`: + +```python Python (Streaming) +response = client.chat.completions.create( + model="kimi-k2.6", + messages=[ + {"role": "system", "content": "You are Kimi."}, + {"role": "user", "content": "Explain quantum computing in simple terms."} + ], + max_tokens=2048, + stream=True, +) + +for chunk in response: + if chunk.choices[0].delta.content: + print(chunk.choices[0].delta.content, end="") +``` + +For more details, see [Send vLLM requests](/serverless/vllm/vllm-requests) and the [OpenAI API compatibility guide](/serverless/vllm/openai-compatibility). + +## Cost calculation + +Moonshot Kimi uses tiered pricing based on the variant. Kimi K2.6 and Kimi K2.7 Code charge \$4.00 per 1M tokens, while Kimi K3 charges \$15.00 per 1M tokens. Example costs: + +| Tokens | Kimi K2.6 & K2.7 Code (\$4.00/1M) | Kimi K3 (\$15.00/1M) | +|--------|-----------------------------------|----------------------| +| 1,000 tokens | \$0.004 | \$0.015 | +| 10,000 tokens | \$0.04 | \$0.15 | +| 100,000 tokens | \$0.40 | \$1.50 | +| 1,000,000 tokens | \$4.00 | \$15.00 | diff --git a/public-endpoints/overview.mdx b/public-endpoints/overview.mdx index 6e2e2683..b6578669 100644 --- a/public-endpoints/overview.mdx +++ b/public-endpoints/overview.mdx @@ -90,7 +90,7 @@ Public Endpoints offer models across four categories: | **Image** | [Flux Dev](/public-endpoints/models/flux-dev), [Flux Schnell](/public-endpoints/models/flux-schnell), [Qwen Image](/public-endpoints/models/qwen-image), [Seedream](/public-endpoints/models/seedream-4-t2i) | Text-to-image generation, image editing | | **Video** | [WAN 2.5](/public-endpoints/models/wan-2-5), [Kling](/public-endpoints/models/kling-v2-1), [Seedance](/public-endpoints/models/seedance-1-5-pro), [SORA 2](/public-endpoints/models/sora-2) | Image-to-video, text-to-video generation | | **Audio** | [Minimax Speech](/public-endpoints/models/minimax-speech), [Chatterbox Turbo](/public-endpoints/models/chatterbox-turbo) | Text-to-speech, voice cloning | -| **Text** | [Qwen3 32B](/public-endpoints/models/qwen3-32b), [IBM Granite](/public-endpoints/models/granite-4) | Chat, code generation, text completion | +| **Text** | [Qwen3 32B](/public-endpoints/models/qwen3-32b), [IBM Granite](/public-endpoints/models/granite-4), [Moonshot Kimi](/public-endpoints/models/moonshot-kimi) | Chat, code generation, text completion | For a complete list of models with endpoint URLs and parameters, see the [model reference](/public-endpoints/reference). diff --git a/public-endpoints/reference.mdx b/public-endpoints/reference.mdx index fb251ec9..d34f4443 100644 --- a/public-endpoints/reference.mdx +++ b/public-endpoints/reference.mdx @@ -63,6 +63,7 @@ Generate text with large language models. | Model | Description | Price | |-------|-------------|-------| | [IBM Granite 4.0](/public-endpoints/models/granite-4) | 32B parameter long-context instruct model. | \$10.00/1M tokens | +| [Moonshot Kimi](/public-endpoints/models/moonshot-kimi) | Kimi family for reasoning, chat, and coding with extended thinking. | \$4.00–\$15.00/1M tokens | | [Qwen3 32B AWQ](/public-endpoints/models/qwen3-32b) | Advanced reasoning and multilingual support. OpenAI-compatible. | \$10.00/1M tokens | ## Audio models