> ## 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) - Messages Quickstart

> - Call Kimi models through the Anthropic Messages protocol and select a model with `model`
- Only `model`, `max_tokens`, and `messages` are required (`max_tokens` is mandatory in the Anthropic protocol)
- All three models have a context window of 1,048,576 tokens
- Reasoning is always enabled for all three models; set its intensity with `output_config.effort`
- For tool calling, web search, image input, structured output, or cache settings, see the [full reference](/en/api-manual/language-series/kimi/messages/messages-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**. The response `content` usually includes `type="thinking"` blocks, which count toward output tokens. Avoid setting `max_tokens` too low: reasoning may exhaust the output budget before any answer text is produced.


## OpenAPI

````yaml en/api-manual/language-series/kimi/messages/messages-quickstart.json POST /v1/messages
openapi: 3.1.0
info:
  title: Kimi API (All Models) - Messages Quickstart
  description: >-
    Quickstart examples for calling Kimi text models through the Anthropic
    Messages protocol. Start a conversation with just `model`, `max_tokens` and
    `messages`; see the Full Reference page for tool calling, web search, 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: Messages
    description: Anthropic Messages-compatible API
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Quick Kimi chat (all models, Anthropic-compatible)
      description: >-
        - Call Kimi models through the Anthropic Messages protocol and select a
        model with `model`

        - Only `model`, `max_tokens`, and `messages` are required (`max_tokens`
        is mandatory in the Anthropic protocol)

        - All three models have a context window of 1,048,576 tokens

        - Reasoning is always enabled for all three models; set its intensity
        with `output_config.effort`

        - For tool calling, web search, image input, structured output, or cache
        settings, see the [full
        reference](/en/api-manual/language-series/kimi/messages/messages-reference)
      operationId: kimiMessagesQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageQuickRequest'
            examples:
              simple:
                summary: Minimal Pro request
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 2048
                  messages:
                    - role: user
                      content: Explain context caching in one sentence.
              highspeed:
                summary: Highspeed with low reasoning effort
                value:
                  model: kimi-k3.1-pro-highspeed
                  max_tokens: 2048
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: Explain context caching in one sentence.
              k3:
                summary: Minimal Kimi K3 request
                value:
                  model: kimi-k3
                  max_tokens: 2048
                  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
                  max_tokens: 2048
                  output_config:
                    effort: low
                  system: >-
                    You are a meticulous technical editor. Keep your answers
                    concise.
                  messages:
                    - 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?
              streaming:
                summary: Anthropic SSE streaming
                value:
                  model: kimi-k3.1-pro
                  max_tokens: 2048
                  output_config:
                    effort: low
                  stream: true
                  messages:
                    - role: user
                      content: Write a four-line poem about a summer night.
      responses:
        '200':
          description: >-
            Message response; streaming requests return an Anthropic SSE event
            stream
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  The event sequence typically includes message_start,
                  content_block_*, message_delta, and message_stop.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    CreateMessageQuickRequest:
      type: object
      required:
        - model
        - max_tokens
        - 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.
        max_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          description: >-
            Maximum tokens allowed for this generation, including thinking and
            final text. If too low, reasoning may exhaust the output budget
            before any answer text is produced. Use at least 1024 and increase
            it for more complex tasks.
        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'
        system:
          type: string
          description: >-
            System prompt. The Messages protocol uses a top-level system field
            instead of a system role.
        output_config:
          type: object
          description: Output 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: Whether to return an Anthropic SSE event stream.
    MessageResponse:
      type: object
      properties:
        id:
          type: string
          description: Response ID.
          example: chatcmpl-6adc72c2b5847b4b2ccb39fd
        type:
          type: string
          enum:
            - message
          example: message
        role:
          type: string
          enum:
            - assistant
          example: assistant
        model:
          type: string
          description: Model used for this call.
          example: kimi-k3.1-pro
        content:
          type: array
          description: Output content blocks, usually thinking followed by text.
          items:
            $ref: '#/components/schemas/OutputContentBlock'
        stop_reason:
          type:
            - string
            - 'null'
          enum:
            - end_turn
            - max_tokens
            - tool_use
            - null
          description: >-
            Stop reason: `end_turn` means a natural stop, `max_tokens` means the
            output limit was reached, and `tool_use` means the model is
            requesting a tool call.
          example: end_turn
        usage:
          $ref: '#/components/schemas/MessageUsage'
    MessageSimple:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: Message role. Only user and assistant are supported.
        content:
          type: string
          description: Message content (plain text).
          example: Explain context caching in one sentence.
    OutputContentBlock:
      type: object
      properties:
        type:
          type: string
          enum:
            - thinking
            - text
          example: text
        thinking:
          type: string
          description: >-
            Reasoning content when `type=thinking`. Return it unchanged together
            with signature in multi-turn conversations.
        signature:
          type: string
          description: >-
            Signature when `type=thinking`; return it unchanged in multi-turn
            conversations.
        text:
          type: string
          description: Answer text when `type=text`.
          example: >-
            Context caching stores repeated prefix content from requests so that
            later cache hits can be processed faster and at lower cost.
    MessageUsage:
      type: object
      properties:
        input_tokens:
          type: integer
          description: Regular input tokens, excluding cache reads and writes.
          example: 24
        cache_read_input_tokens:
          type: integer
          description: Input tokens served from cache.
          example: 0
        cache_creation_input_tokens:
          type: integer
          description: Input tokens written to cache.
          example: 0
        output_tokens:
          type: integer
          description: Output tokens, including thinking tokens.
          example: 96
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - error
        error:
          type: object
          properties:
            type:
              type: string
            message:
              type: string
        request_id:
          type: string
  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.