> ## 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

> 两个模型使用相同的 Chat Completions 请求，支持 1,048,576 token 上下文、推理、多模态输入、流式输出、结构化输出和函数工具。

Kimi K3.1 Pro 和 Kimi K3.1 Pro Highspeed 使用相同的 OpenAI 兼容 Chat Completions 请求。两个模型均提供 1,048,576 token 上下文、始终开启的推理、多模态输入、流式输出、结构化输出、Partial Mode 和函数工具。

> [!NOTE]
>
> 在顶层设置 `reasoning_effort`，可选 `low`、`high` 或 `max`。K3.1 系列不使用 K2.x 的 `thinking` 对象。采样参数为固定值，请省略 `temperature`、`top_p`、`n`、`presence_penalty` 和 `frequency_penalty`。


## OpenAPI

````yaml zh/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 和 Kimi K3.1 Pro Highspeed 的 AnyFast OpenAI 兼容接口。
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: 创建 Kimi K3.1 对话补全
      description: >-
        两个模型使用相同的 Chat Completions 请求，支持 1,048,576 token
        上下文、推理、多模态输入、流式输出、结构化输出和函数工具。
      operationId: createChatCompletionKimiK31Pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              standard:
                summary: 标准版
                value:
                  model: kimi-k3.1-pro
                  reasoning_effort: high
                  messages:
                    - role: user
                      content: 请说明如何安全审查一个大型代码库。
              highspeed:
                summary: 高速版
                value:
                  model: kimi-k3.1-pro-highspeed
                  reasoning_effort: high
                  messages:
                    - role: user
                      content: 请说明如何安全审查一个大型代码库。
      responses:
        '200':
          description: 对话补全成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: 请求参数无效或参数不受支持。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: API Key 无效或缺失。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 超出限速或配额。
          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
        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: AnyFast 返回的推理内容；多轮对话时请原样保留。
        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.