> ## Documentation Index
> Fetch the complete documentation index at: https://evolink.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Kimi API (All Models) - Responses Quickstart

> Call Kimi with `model` and `input`. Supported models are `kimi-k3.1-pro`, `kimi-k3.1-pro-highspeed`, and `kimi-k3`. When setting `max_output_tokens`, start at 1024 to allow room for reasoning and the answer.

See the [full reference](/en/api-manual/language-series/kimi/responses/responses-reference) for more examples and model differences.

> [!NOTE]
>
> **BaseURL**: The default BaseURL is `https://direct.evolink.ai`, which has better support for text models and long-lived connections. `https://api.evolink.ai` is the primary endpoint for multimodal services and serves as a fallback address for text models.

Use `POST /v1/responses` and select `kimi-k3.1-pro`, `kimi-k3.1-pro-highspeed`, or `kimi-k3` with `model`. Only `model` and `input` are required.

> [!WARNING]
>
> **Parameter names differ from Chat Completions**: use `input` for input, `max_output_tokens` for the output limit, and `reasoning.effort` for reasoning effort.

## Reading the answer text

The response `output` may include reasoning, answer text, and tool calls. Iterate over the `output_text` content blocks within `type="message"` items; do not assume the first item contains the answer.

Assuming the response JSON has been parsed into `response`, extract the text as follows:

```python theme={null}
text = "".join(
    part["text"]
    for item in response.get("output", [])
    if item.get("type") == "message"
    for part in item.get("content", [])
    if part.get("type") == "output_text"
)
print(text)
```

> [!NOTE]
>
> **Reserve output budget for reasoning**: `max_output_tokens` includes both reasoning and the answer. If `status="incomplete"` and `incomplete_details.reason="max_output_tokens"`, increase the limit. When the budget is exhausted, the response may contain only reasoning items without answer text.

For tool calling, web search, image input, and structured output, see the [full reference](https://evolink.ai/docs/en/api-manual/language-series/kimi/responses/responses-reference.md).


## OpenAPI

````yaml en/api-manual/language-series/kimi/responses/responses-quickstart.json POST /v1/responses
openapi: 3.1.0
info:
  title: Kimi API (All Models) - Responses Quickstart
  description: >-
    Quickstart examples for calling Kimi text models through the OpenAI
    Responses protocol. Start a conversation with just `model` and `input`; see
    the Full Reference page for tool calling, web search, structured output,
    image input and more.
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Production (Recommended)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
paths:
  /v1/responses:
    post:
      tags:
        - Responses
      summary: Kimi Responses quick call
      description: >-
        Call Kimi with `model` and `input`. Supported models are
        `kimi-k3.1-pro`, `kimi-k3.1-pro-highspeed`, and `kimi-k3`. When setting
        `max_output_tokens`, start at 1024 to allow room for reasoning and the
        answer.


        See the [full
        reference](/en/api-manual/language-series/kimi/responses/responses-reference)
        for more examples and model differences.
      operationId: kimiResponsesQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResponsesQuickRequest'
            examples:
              simple:
                summary: Minimal Pro request
                value:
                  model: kimi-k3.1-pro
                  input: Explain context caching in one sentence.
              highspeed:
                summary: Highspeed with low reasoning effort
                value:
                  model: kimi-k3.1-pro-highspeed
                  input: Explain context caching in one sentence.
                  reasoning:
                    effort: low
                  max_output_tokens: 1024
              k3:
                summary: Minimal Kimi K3 request
                value:
                  model: kimi-k3
                  input: Explain context caching in one sentence.
              multi_turn:
                summary: System prompts and multi-turn conversations
                value:
                  model: kimi-k3.1-pro
                  input:
                    - role: developer
                      content: >-
                        You are a meticulous technical editor. Keep your answers
                        concise.
                    - role: user
                      content: What is context caching?
                    - role: assistant
                      content: >-
                        Context caching stores repeated prefix content from
                        requests so that later cache hits can be processed
                        faster and at lower cost.
                    - role: user
                      content: What use cases is it suited for?
                  reasoning:
                    effort: low
                  max_output_tokens: 2048
              streaming:
                summary: SSE streaming output
                value:
                  model: kimi-k3.1-pro
                  input: Write a four-line poem about a summer night.
                  reasoning:
                    effort: low
                  max_output_tokens: 2048
                  stream: true
      responses:
        '200':
          description: >-
            Response created successfully; streaming requests return an SSE
            event stream
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponsesResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  Responses-format SSE event stream, ending with a
                  `response.completed`, `response.incomplete`, or
                  `response.failed` event.
        '400':
          description: Bad request - invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded or insufficient quota
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ResponsesQuickRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - kimi-k3.1-pro
            - kimi-k3.1-pro-highspeed
            - kimi-k3
          default: kimi-k3.1-pro
          description: >-
            Model to call:


            | Model ID | Positioning |

            |---|---|

            | `kimi-k3.1-pro` | Latest-generation model (recommended) |

            | `kimi-k3.1-pro-highspeed` | Same parameters as Pro, faster
            generation |

            | `kimi-k3` | Previous-generation model |


            All three models have a context window of 1,048,576 tokens and
            always have reasoning enabled.
        input:
          description: >-
            Input for this request. A string is equivalent to a single user
            message; an array supplies historical messages in order.
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/InputMessage'
        max_output_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: >-
            Maximum generated tokens, including reasoning and the final answer;
            default 131072, maximum 1048576.
        reasoning:
          type: object
          description: Reasoning configuration.
          properties:
            effort:
              type: string
              enum:
                - low
                - high
                - max
              default: max
              description: >-
                Reasoning effort, default `max`. `kimi-k3` supports only `max`;
                see the full reference for other compatible values.
        stream:
          type: boolean
          default: false
          description: When true, returns the response as an SSE stream.
    ResponsesResponse:
      type: object
      properties:
        id:
          type: string
          description: Response ID.
          example: resp_6adc72aab1f2eaaebe6b869e
        object:
          type: string
          enum:
            - response
          example: response
        created_at:
          type: integer
          description: Creation time as a Unix timestamp in seconds.
          example: 1792832171
        status:
          type: string
          enum:
            - completed
            - incomplete
            - failed
          description: >-
            Response status. `incomplete` usually means the `max_output_tokens`
            limit was reached.
          example: completed
        incomplete_details:
          type:
            - object
            - 'null'
          description: Reason provided when `status` is `incomplete`.
          properties:
            reason:
              type: string
              enum:
                - max_output_tokens
                - content_filter
        model:
          type: string
          description: Model used for this call.
          example: kimi-k3.1-pro
        output:
          type: array
          description: Output items, usually reasoning followed by message.
          items:
            $ref: '#/components/schemas/OutputItem'
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message explaining the cause.
            type:
              type: string
              description: Error type
            code:
              type: string
              description: Error code
          required:
            - message
      required:
        - error
    InputMessage:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
            - developer
          description: Message role. `developer` is treated as system instructions.
        content:
          type: string
          description: Message content (plain text).
          example: Explain context caching in one sentence.
    OutputItem:
      type: object
      properties:
        type:
          type: string
          enum:
            - reasoning
            - message
          description: >-
            `reasoning` contains reasoning content; `message` contains the final
            answer.
          example: message
        id:
          type: string
          example: msg_6adc72aab1f2eaaebe6b869f
        summary:
          type: array
          description: Reasoning content when `type=reasoning`.
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - summary_text
              text:
                type: string
        role:
          type: string
          enum:
            - assistant
          description: Returned when `type=message`.
        content:
          type: array
          description: Answer content when `type=message`.
          items:
            $ref: '#/components/schemas/OutputText'
        status:
          type: string
          enum:
            - completed
          example: completed
    Usage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: Input tokens, including cache hits.
          example: 24
        input_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: Input tokens served from cache.
              example: 0
        output_tokens:
          type: integer
          description: Output tokens, including reasoning tokens.
          example: 96
        output_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: Reasoning tokens, already included in output_tokens.
              example: 62
        total_tokens:
          type: integer
          description: Total input and output tokens.
          example: 120
    OutputText:
      type: object
      properties:
        type:
          type: string
          enum:
            - output_text
          example: output_text
        text:
          type: string
          example: >-
            Context caching stores repeated prefix content from requests so that
            later cache hits can be processed faster and at lower cost.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ##All APIs require Bearer Token authentication##


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.