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

# kimi-k3.1-pro / kimi-k3.1-pro-highspeed

> Creates a response for either Kimi K3.1 Pro or Kimi K3.1 Pro Highspeed.

Kimi K3.1 Pro and Kimi K3.1 Pro Highspeed use the same OpenAI-compatible Chat Completions request. Both models provide a 1,048,576-token context window, always-on reasoning, multimodal input, streaming, structured output, Partial Mode, and function tools.

> [!NOTE]
>
> Set `reasoning_effort` at the top level to `low`, `high`, or `max`. K3.1 models do not use the K2.x `thinking` object. Sampling parameters are fixed; omit `temperature`, `top_p`, `n`, `presence_penalty`, and `frequency_penalty`.


## OpenAPI

````yaml api-reference/model-api/moonshot/openapi/kimi-k3-1-pro/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi K3.1 Pro
  description: >-
    Kimi K3.1 Pro and Kimi K3.1 Pro Highspeed through the AnyFast
    OpenAI-compatible API.
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: Create a Kimi K3.1 chat completion
      description: Creates a response for either Kimi K3.1 Pro or Kimi K3.1 Pro Highspeed.
      operationId: createChatCompletionKimiK31Pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              standard:
                summary: Standard model
                value:
                  model: kimi-k3.1-pro
                  reasoning_effort: high
                  messages:
                    - role: user
                      content: Explain how to review a large codebase safely.
              highspeed:
                summary: Highspeed model
                value:
                  model: kimi-k3.1-pro-highspeed
                  reasoning_effort: high
                  messages:
                    - role: user
                      content: Explain how to review a large codebase safely.
      responses:
        '200':
          description: Chat completion generated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: Invalid request or unsupported parameter value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit or quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ChatCompletionRequest:
      type: object
      required:
        - model
        - messages
      properties:
        model:
          type: string
          enum:
            - kimi-k3.1-pro
            - kimi-k3.1-pro-highspeed
          description: Kimi K3.1 model ID.
        messages:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Message'
        reasoning_effort:
          type: string
          enum:
            - low
            - high
            - max
          default: max
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
        stream:
          type: boolean
          default: false
        stream_options:
          type: object
          properties:
            include_usage:
              type: boolean
              default: false
        response_format:
          $ref: '#/components/schemas/ResponseFormat'
        stop:
          oneOf:
            - type: string
            - type: array
              maxItems: 5
              items:
                type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolDefinition'
        tool_choice:
          type: string
          enum:
            - auto
            - none
            - required
          default: auto
        prompt_cache_key:
          type: string
        safety_identifier:
          type: string
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - model
        - choices
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - chat.completion
        created:
          type: integer
        model:
          type: string
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/Message'
              finish_reason:
                type: string
        usage:
          type: object
          additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          additionalProperties: true
    Message:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          oneOf:
            - type: string
            - type: 'null'
            - type: array
              items:
                $ref: '#/components/schemas/ContentPart'
        name:
          type: string
        partial:
          type: boolean
        reasoning_content:
          type: string
          description: Reasoning returned by AnyFast; preserve it in multi-turn history.
        tool_calls:
          type: array
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
    ResponseFormat:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
            - json_object
            - json_schema
        json_schema:
          type: object
          additionalProperties: true
    ToolDefinition:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          enum:
            - function
        function:
          type: object
          required:
            - name
            - parameters
          properties:
            name:
              type: string
            description:
              type: string
            parameters:
              type: object
            strict:
              type: boolean
    ContentPart:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - text
            - image_url
            - video_url
        text:
          type: string
        image_url:
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
        video_url:
          oneOf:
            - type: string
            - type: object
              required:
                - url
              properties:
                url:
                  type: string
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - function
        function:
          type: object
          required:
            - name
            - arguments
          properties:
            name:
              type: string
            arguments:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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