> ## 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) - Chat Completions Quickstart

> - Call Kimi models through the OpenAI Chat Completions protocol and select a model with `model`
- Only `model` and `messages` are required
- All three models have a context window of 1,048,576 tokens and a default maximum output of 131,072 tokens
- Reasoning is always enabled for all three models and returned in `reasoning_content`; reasoning tokens count toward output
- For tool calling, web search, structured output, image input, or cache settings, see the [full reference](/en/api-manual/language-series/kimi/chat-completions/chat-completions-reference)

> [!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.

> [!NOTE]
>
> **Reasoning is always enabled for Kimi models** and returned in `reasoning_content`. Reasoning tokens count toward output. Avoid setting `max_completion_tokens` too low: reasoning may exhaust the output budget before any answer text is produced.


## OpenAPI

````yaml en/api-manual/language-series/kimi/chat-completions/chat-completions-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi API (All Models) - Chat Completions Quickstart
  description: >-
    Quickstart examples for calling Kimi text models through the
    OpenAI-compatible Chat Completions protocol. Start a conversation with just
    `model` and `messages`; see the Full Reference page for tool calling, web
    search, structured output, image input and more.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: Production (Recommended)
  - url: https://api.evolink.ai
    description: Alternative URL
security:
  - bearerAuth: []
tags:
  - name: Chat Completions
    description: OpenAI Chat Completions-compatible API
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completions
      summary: Quick Kimi chat (all models)
      description: >-
        - Call Kimi models through the OpenAI Chat Completions protocol and
        select a model with `model`

        - Only `model` and `messages` are required

        - All three models have a context window of 1,048,576 tokens and a
        default maximum output of 131,072 tokens

        - Reasoning is always enabled for all three models and returned in
        `reasoning_content`; reasoning tokens count toward output

        - For tool calling, web search, structured output, image input, or cache
        settings, see the [full
        reference](/en/api-manual/language-series/kimi/chat-completions/chat-completions-reference)
      operationId: kimiChatCompletionsQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
            examples:
              simple:
                summary: Minimal Pro request
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Explain context caching in one sentence.
              highspeed:
                summary: Highspeed with low reasoning effort
                value:
                  model: kimi-k3.1-pro-highspeed
                  messages:
                    - role: user
                      content: Explain context caching in one sentence.
                  reasoning_effort: low
              k3:
                summary: Minimal Kimi K3 request
                value:
                  model: kimi-k3
                  messages:
                    - role: user
                      content: Explain context caching in one sentence.
              multi_turn:
                summary: System prompts and multi-turn conversations
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: system
                      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
              streaming:
                summary: SSE streaming output
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Write a four-line poem about a summer night.
                  reasoning_effort: low
                  max_completion_tokens: 2048
                  stream: true
      responses:
        '200':
          description: >-
            Conversation generated successfully; streaming requests return an
            SSE event stream
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  SSE data in OpenAI Chat Completions format, ending with `data:
                  [DONE]`.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ChatCompletionQuickRequest:
      type: object
      required:
        - model
        - messages
      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.
        messages:
          type: array
          minItems: 1
          description: >-
            Conversation messages. Include historical messages in order for
            multi-turn conversations; see the full reference for how to return
            reasoning and tool-call history.
          items:
            $ref: '#/components/schemas/MessageSimple'
        reasoning_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.
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: >-
            Maximum generated tokens, including reasoning and the final answer;
            default 131072, maximum 1048576.
        stream:
          type: boolean
          default: false
          description: Whether to return the response as an SSE stream.
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: Response ID.
          example: chatcmpl-6adc72a2823cc13b156bf863
        object:
          type: string
          enum:
            - chat.completion
          example: chat.completion
        created:
          type: integer
          description: Creation time as a Unix timestamp in seconds.
          example: 1792832163
        model:
          type: string
          description: Model used for this call.
          example: kimi-k3.1-pro
        choices:
          type: array
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    MessageSimple:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          description: >-
            Message role: `system` for system prompts, `user` for user input,
            and `assistant` for historical replies.
        content:
          type: string
          description: Message content (plain text).
          example: Explain context caching in one sentence.
    Choice:
      type: object
      properties:
        index:
          type: integer
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          enum:
            - stop
            - length
            - tool_calls
          description: >-
            Finish reason: `stop` means a natural stop, `length` means the
            output limit was reached, and `tool_calls` means the model is
            requesting a tool call.
          example: stop
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: Total input tokens, including cache hits.
          example: 24
        completion_tokens:
          type: integer
          description: Output tokens, including reasoning tokens.
          example: 96
        total_tokens:
          type: integer
          description: Total input and output tokens.
          example: 120
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: Input tokens served from cache.
              example: 0
        completion_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: Reasoning tokens, already included in completion_tokens.
              example: 62
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: Final answer.
          example: >-
            Context caching stores repeated prefix content from requests so that
            later cache hits can be processed faster and at lower cost.
        reasoning_content:
          type: string
          description: >-
            Reasoning content. Return it together with the complete assistant
            message in multi-turn conversations.
          example: >-
            The user wants a one-sentence explanation of context caching,
            including what it stores and its benefits.
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API key is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded or insufficient quota
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal service error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  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.