Kimi icon

Kimi

Use Kimi (Moonshot) traditional REST API

Chat Completions

AI-generated

Summary

Send prompt messages to Kimi (Moonshot AI) chat completion models to generate conversational responses.

Inputs

  • model (required) — The Kimi model to use for inference, selected from a list or specified by ID (e.g. moonshot-v1-8k or kimi-k2.5).
  • composeMode — Select 'Simple' to supply system instructions and a user message, or 'Raw JSON' to supply a custom OpenAI-formatted messages array.
  • userMessage (required) — The prompt text from the user when using Simple compose mode.
  • system — System-level instructions to guide model behavior when using Simple compose mode.
  • messagesJson — A JSON array string containing full message history in OpenAI format when using Raw JSON compose mode.
  • options — Optional parameters including temperature, max tokens, response format (text/json_object), tools JSON, tool choice, top P, frequency/presence penalties, and instant mode toggle.

Output shape

a single record per input item

Returns an object containing model, content (the model response string), reasoning (reasoning_content for thinking models), usage, id, created, and raw (the complete API response).

Examples

Example 1: Simple text generation prompt

Set Model to 'moonshot-v1-8k', Compose Mode to 'Simple', and supply a User Message with optional System Instruction.

Example 2: Pass multi-turn conversation history using Raw JSON

Set Compose Mode to 'Raw JSON' and input an array of message objects with system, user, and assistant roles in Messages JSON.

Links

Discussion