> ## 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-k2.6

> 根据给定的对话历史生成模型响应。支持文本、图片与视频输入，思考与非思考模式，以及 Tool Use（函数调用）。

Kimi-K2.6 支持文本、图片与视频输入，思考与非思考模式，以及 Tool Use（函数调用）。


## OpenAPI

````yaml zh/api-reference/model-api/moonshot/openapi/kimi-k2-6/openapi.yaml POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi-K2.6
  description: 通过 Anyfast OpenAI 兼容接口调用 月之暗面 Kimi-K2.6 多模态对话模型
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/chat/completions:
    post:
      summary: 创建对话补全
      description: 根据给定的对话历史生成模型响应。支持文本、图片与视频输入，思考与非思考模式，以及 Tool Use（函数调用）。
      operationId: createChatCompletionKimiK26
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  enum:
                    - kimi-k2.6
                  description: 模型 ID
                  example: kimi-k2.6
                messages:
                  type: array
                  minItems: 1
                  description: 对话消息列表。
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum:
                          - system
                          - user
                          - assistant
                      content:
                        oneOf:
                          - type: string
                          - type: array
                            description: 多模态输入，每个元素通过 type 区分类型。
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - text
                                    - image_url
                                    - video_url
                                text:
                                  type: string
                                  description: 当 type 为 text 时填写。
                                image_url:
                                  type: object
                                  properties:
                                    url:
                                      type: string
                                      description: >-
                                        base64
                                        编码（data:image/png;base64,...）或文件引用（ms://<file_id>）。
                                video_url:
                                  type: object
                                  properties:
                                    url:
                                      type: string
                                      description: >-
                                        base64
                                        编码（data:video/mp4;base64,...）或文件引用（ms://<file_id>）。
                        description: 消息内容，可为纯文本字符串或多模态对象数组。
                  example:
                    - role: user
                      content: 你好！
                thinking:
                  type: object
                  description: >-
                    控制是否启用思考能力，以及是否保留多轮对话中的 reasoning_content。默认 {"type":
                    "enabled"}。
                  properties:
                    type:
                      type: string
                      enum:
                        - enabled
                        - disabled
                      description: 启用或禁用思考能力。
                    keep:
                      type:
                        - string
                        - 'null'
                      enum:
                        - all
                        - null
                      description: >-
                        设为 "all" 时保留历史轮次的 reasoning_content（Preserved
                        Thinking），默认 null 不保留。
                max_completion_tokens:
                  type: integer
                  minimum: 1
                  description: 最大生成 Token 数。（max_tokens 已弃用且不生效。）
                temperature:
                  type: number
                  minimum: 0
                  maximum: 2
                  default: 1
                  description: 采样温度，值越高输出越随机。
                  example: 1
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  description: 核采样阈值。
                frequency_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: 根据词频惩罚重复 Token。
                presence_penalty:
                  type: number
                  minimum: -2
                  maximum: 2
                  default: 0
                  description: 惩罚已出现过的 Token。
                response_format:
                  type: object
                  description: 指定输出格式，可设为 JSON Mode。
                  properties:
                    type:
                      type: string
                      enum:
                        - text
                        - json_object
                        - json_schema
                tools:
                  type: array
                  description: 模型可调用的工具列表（函数调用）。
                  items:
                    type: object
                stream:
                  type: boolean
                  default: false
                  description: 为 true 时通过 SSE 流式返回结果。
                stop:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: 触发停止生成的序列，最多 5 个，每个不超过 32 字节。
      responses:
        '200':
          description: 成功生成响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletion'
        '400':
          description: 请求参数有误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ChatCompletion:
      type: object
      required:
        - id
        - object
        - created
        - model
        - choices
      properties:
        id:
          type: string
          example: chatcmpl-abc123
        object:
          type: string
          example: chat.completion
        created:
          type: integer
          description: Unix 时间戳
        model:
          type: string
          example: kimi-k2.6
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                type: object
                properties:
                  role:
                    type: string
                    example: assistant
                  content:
                    type: string
                    example: 你好！有什么我可以帮助你的吗？
                  reasoning_content:
                    type: string
                    description: 思考模式下返回的推理过程内容。
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - content_filter
                  - tool_calls
                  - null
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            completion_tokens:
              type: integer
            total_tokens:
              type: integer
            prompt_tokens_details:
              type: object
              properties:
                cached_tokens:
                  type: integer
                  description: 命中上下文缓存的 Token 数。
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````