> ## 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（全モデル）- Chat Completions 完全リファレンス

> OpenAI Chat Completions 形式で Kimi モデルを呼び出し、通常の JSON または SSE ストリーミングで応答を受け取れます。複数ターンでは assistant メッセージの reasoning_content と tool_calls を完全に保持してください。

Web 検索が tool_calls を返した場合、各呼び出しの function.arguments を同じ tool_call_id の tool メッセージの内容として再送し、リクエストを続けて最終回答を生成してください。

> [!NOTE]
>
> **BaseURL**: デフォルトの BaseURL は `https://direct.evolink.ai` で、テキストモデルと長時間接続をより適切にサポートします。`https://api.evolink.ai` はマルチモーダルサービスの主要エンドポイントで、テキストモデルの代替アドレスとして使用されます。


## OpenAPI

````yaml ja/api-manual/language-series/kimi/chat-completions/chat-completions-reference.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi API（全モデル）- Chat Completions 完全リファレンス
  description: >-
    OpenAI Chat Completions プロトコルで Kimi テキストモデルを呼び出します。`model` で
    `kimi-k3.1-pro`、`kimi-k3.1-pro-highspeed`、`kimi-k3` を選択します。いずれもコンテキストウィンドウは
    1,048,576 tokens で、複数ターンの会話、ストリーミング、ツール呼び出し、Web 検索、構造化出力、画像・動画入力に対応します。


    3 モデルとも推論は常に有効で、内容は `reasoning_content` に返されます。推論強度とキャッシュ書き込み TTL
    はモデルにより異なります。`model` の説明をご覧ください。複数ターンでは推論とツール呼び出しの履歴を完全に保持してください。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 本番環境（推奨）
  - url: https://api.evolink.ai
    description: 代替 URL
security:
  - bearerAuth: []
tags:
  - name: Chat Completions
    description: OpenAI Chat Completions 互換 API
paths:
  /v1/chat/completions:
    post:
      tags:
        - Chat Completions
      summary: Kimi チャット API（全モデル、OpenAI 互換）
      description: >-
        OpenAI Chat Completions 形式で Kimi モデルを呼び出し、通常の JSON または SSE
        ストリーミングで応答を受け取れます。複数ターンでは assistant メッセージの reasoning_content と
        tool_calls を完全に保持してください。


        Web 検索が tool_calls を返した場合、各呼び出しの function.arguments を同じ tool_call_id の
        tool メッセージの内容として再送し、リクエストを続けて最終回答を生成してください。
      operationId: createChatCompletionKimi
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionRequest'
            examples:
              simple:
                summary: Pro の最小リクエスト
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              highspeed:
                summary: Highspeed の最小リクエスト
                value:
                  model: kimi-k3.1-pro-highspeed
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
              k3:
                summary: Kimi K3 の最小リクエスト
                value:
                  model: kimi-k3
                  messages:
                    - role: user
                      content: Reply with OK.
                  max_completion_tokens: 1024
              streaming:
                summary: SSE ストリーミング出力
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  stream: true
              multimodal:
                summary: 画像入力
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content:
                        - type: image_url
                          image_url:
                            url: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA...
                        - type: text
                          text: この画像を説明してください。
                  reasoning_effort: low
                  max_completion_tokens: 1024
              function_calling:
                summary: Function Calling
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: 北京の今日の天気を調べてください。
                  tools:
                    - type: function
                      function:
                        name: get_weather
                        description: 指定した都市の天気を取得
                        parameters:
                          type: object
                          properties:
                            city:
                              type: string
                              description: 都市名
                          required:
                            - city
                  tool_choice: auto
              web_search:
                summary: Web 検索（統一形式）
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Use web search to find the official Kimi homepage URL.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  tools:
                    - type: web_search
              structured_output:
                summary: 厳密な JSON Schema
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Return a JSON object with result equal to OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  response_format:
                    type: json_schema
                    json_schema:
                      name: result
                      strict: true
                      schema:
                        type: object
                        properties:
                          result:
                            type: string
                        required:
                          - result
                        additionalProperties: false
              cache_1h:
                summary: 1h キャッシュへの自動書き込み（K3.1 シリーズのみ）
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: Reply with OK.
                  reasoning_effort: low
                  max_completion_tokens: 1024
                  prompt_cache_options:
                    mode: implicit
                    ttl: 1h
      responses:
        '200':
          description: Chat Completion 応答。ストリーミングリクエストでは SSE イベントストリームを返します
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
            text/event-stream:
              schema:
                type: string
                description: 'OpenAI Chat Completions 形式の SSE データ。`data: [DONE]` で終了します。'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    ChatCompletionRequest:
      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: >-
            呼び出すモデル：


            | モデル ID | 位置付け | 推論強度 |

            |---|---|---|

            | `kimi-k3.1-pro` | 最新世代モデル（推奨） | `low` / `high` / `max`, デフォルト
            `max` |

            | `kimi-k3.1-pro-highspeed` | Pro と同じパラメータで、より高速に生成 |
            `kimi-k3.1-pro` と同じ |

            | `kimi-k3` | 前世代モデル | `max` のみ |


            3 モデルともコンテキストウィンドウは 1,048,576 tokens で、推論は常に有効です。


            キャッシュ書き込み TTL（`prompt_cache_options`）は K3.1 シリーズのみ対応し、`kimi-k3`
            はこのパラメータに対応しません。
        messages:
          type: array
          minItems: 1
          description: 会話メッセージ。複数ターンの会話では、過去の完全な assistant メッセージを含めてください。
          items:
            $ref: '#/components/schemas/ChatMessage'
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: 推論と最終回答を含む最大生成トークン数。デフォルトは 131072、最大は 1048576 で、残りのコンテキストにも制限されます。
        reasoning_effort:
          type: string
          enum:
            - low
            - high
            - max
            - medium
            - xhigh
            - minimal
            - none
          default: max
          description: >-
            推論強度。推論は常に有効です。


            - `kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`：`low` / `high` / `max`
            を推奨し、デフォルトは `max` です。汎用クライアントとの互換性のため、`medium` は `high`、`xhigh` は
            `max`、`minimal` / `none` は `low` として扱います。`none` でも推論は無効になりません。

            - `kimi-k3`：`max` のみ対応します（デフォルト）。


            強度を上げると通常は推論トークンとレイテンシーが増えます。推論トークンは出力に含まれます。
        stream:
          type: boolean
          default: false
          description: 応答を SSE ストリームで返すかどうか。
        tools:
          type: array
          maxItems: 128
          description: 関数ツールまたは Web 検索。検索は {"type":"web_search"} で指定します。
          items:
            oneOf:
              - $ref: '#/components/schemas/FunctionTool'
              - $ref: '#/components/schemas/WebSearchTool'
        tool_choice:
          oneOf:
            - type: string
              enum:
                - auto
                - none
                - required
            - $ref: '#/components/schemas/NamedToolChoice'
          description: モデルがツールを呼び出すか、特定の関数を強制するかを制御します。
        prompt_cache_options:
          type: object
          description: >-
            コンテキストキャッシュの書き込み設定。`kimi-k3.1-pro` / `kimi-k3.1-pro-highspeed`
            のみ対応し、`kimi-k3` はこのパラメータに対応しません。省略時はデフォルトで 5m
            キャッシュへ自動書き込みされます。書き込みと読み取りは別々に課金されます。
          properties:
            mode:
              type: string
              enum:
                - implicit
              default: implicit
            ttl:
              type: string
              enum:
                - 5m
                - 1h
              default: 5m
              description: キャッシュ有効期間。5m または 1h。デフォルトは 5m。
        response_format:
          type: object
          description: >-
            出力形式。text はプレーンテキスト、json_object は JSON オブジェクト、json_schema は指定した JSON
            Schema に従う構造化出力です。
          properties:
            type:
              type: string
              enum:
                - text
                - json_object
                - json_schema
              description: >-
                出力形式。text：デフォルトのプレーンテキスト。json_object：有効な JSON
                オブジェクト。json_schema：指定した Schema に従う出力（推奨。json_schema も指定）。
            json_schema:
              type: object
              description: type が json_schema の場合に出力が従う JSON Schema。
              properties:
                name:
                  type: string
                  description: 識別用の Schema 名。
                strict:
                  type: boolean
                  default: true
                  description: 指定した JSON Schema を厳密に適用するかどうか。デフォルトは true。
                schema:
                  type: object
                  description: 出力構造を定義する JSON Schema。
                  additionalProperties: true
              required:
                - name
                - schema
        max_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          deprecated: true
          description: >-
            旧クライアント用の出力上限の別名。新規リクエストでは max_completion_tokens
            を使い、両方の同時指定は避けてください。
        temperature:
          type: number
          default: 1
          description: >-
            サンプリング温度。モデル側で `1` に固定されているため、指定は不要です。`kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed` はこのフィールドを自動的に無視し、`kimi-k3`
            は未対応の値に対してエラーを返します。
        top_p:
          type: number
          default: 0.95
          description: >-
            核サンプリングの閾値。モデル側で `0.95` に固定されているため、指定は不要です。`kimi-k3.1-pro` /
            `kimi-k3.1-pro-highspeed` はこのフィールドを自動的に無視し、`kimi-k3`
            は未対応の値に対してエラーを返します。
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          example: chat.completion
        created:
          type: integer
        model:
          type: string
          example: kimi-k3.1-pro
        choices:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              message:
                $ref: '#/components/schemas/ChatMessage'
              finish_reason:
                type: string
                enum:
                  - stop
                  - length
                  - tool_calls
        usage:
          $ref: '#/components/schemas/ChatUsage'
    ChatMessage:
      type: object
      required:
        - role
      properties:
        role:
          type: string
          description: メッセージのロール：system、user、assistant、tool。
          enum:
            - system
            - user
            - assistant
            - tool
        content:
          description: >-
            メッセージ内容。プレーンテキストの場合は文字列を渡します；マルチモーダル入力の場合は内容ブロック配列（テキスト + 画像 +
            動画）を渡します。ツール呼び出しの場合、assistant の content は null にできます。
          oneOf:
            - type: string
              description: プレーンテキストのメッセージ内容。
            - type: array
              description: マルチモーダル内容ブロックの配列。
              items:
                $ref: '#/components/schemas/ContentPart'
            - type: 'null'
        reasoning_content:
          type: string
          description: assistant の推論内容。複数ターンの会話では、完全な assistant メッセージの一部として変更せず返してください。
        tool_calls:
          type: array
          description: assistant が返したツール呼び出し。後続のツール利用ターンで変更せず返してください。
          items:
            $ref: '#/components/schemas/ToolCall'
        tool_call_id:
          type: string
          description: '`role=tool` のときに対応するツール呼び出し ID。'
    FunctionTool:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: ツールの種類。現在は function 固定です。
          enum:
            - function
        function:
          type: object
          description: モデルが利用できる関数定義。
          required:
            - name
            - parameters
          properties:
            name:
              type: string
              description: 関数名。
            description:
              type: string
              description: モデルが関数を呼び出すタイミングを判断するための説明。
            parameters:
              type: object
              additionalProperties: true
              description: JSON Schema 形式の関数パラメータ定義。
            strict:
              type: boolean
              description: 関数引数が parameters の JSON Schema に厳密に従う必要があるかどうか。
    WebSearchTool:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - web_search
          description: Web 検索ツール。
    NamedToolChoice:
      type: object
      required:
        - type
        - function
      properties:
        type:
          type: string
          description: 名前付きツール選択の種類。function 固定です。
          enum:
            - function
        function:
          type: object
          description: モデルが必ず呼び出す関数。
          required:
            - name
          properties:
            name:
              type: string
              description: モデルが必ず呼び出す関数名。
    ChatUsage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: >-
            通常入力、キャッシュ読み取り、キャッシュ書き込みを含む総入力トークン。K3.1 シリーズの通常入力 =
            prompt_tokens-cached_tokens-cache_write_tokens、`kimi-k3` の通常入力 =
            prompt_tokens-cached_tokens。
        completion_tokens:
          type: integer
          description: 推論 tokens を含みます。
        total_tokens:
          type: integer
          description: 入力と出力の合計 tokens。
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: キャッシュから提供された入力 tokens。
            cache_write_tokens:
              type: integer
              minimum: 0
              description: >-
                今回のリクエストでのキャッシュ書き込みトークン総数。5m / 1h の書き込みを含みます。K3.1
                シリーズでは別途課金され、通常入力料金は重複しません。`kimi-k3` は別扱いせず通常入力として課金します。
        completion_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: 推論 tokens。completion_tokens に含まれています。
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
    ContentPart:
      description: マルチモーダル内容ブロック。`type` でどのフィールドを使用するかが決まります。
      oneOf:
        - type: object
          required:
            - type
            - text
          properties:
            type:
              type: string
              enum:
                - text
            text:
              type: string
              description: '`type=text` のときのテキスト内容。'
        - type: object
          required:
            - type
            - image_url
          properties:
            type:
              type: string
              enum:
                - image_url
            image_url:
              description: '`type=image_url` のときの画像；URL 文字列を直接渡すこともできます。'
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: Base64 Data URL 形式の画像内容（data:image/png;base64,...）。
        - type: object
          required:
            - type
            - video_url
          properties:
            type:
              type: string
              enum:
                - video_url
            video_url:
              description: '`type=video_url` のときの動画；URL 文字列を直接渡すこともできます。'
              oneOf:
                - type: string
                - type: object
                  required:
                    - url
                  properties:
                    url:
                      type: string
                      description: Base64 Data URL 形式の動画内容（data:video/mp4;base64,...）。
    ToolCall:
      type: object
      required:
        - id
        - type
        - function
      properties:
        id:
          type: string
          description: 後続の tool メッセージを tool_call_id で関連付けるツール呼び出し ID。
        type:
          type: string
          description: >-
            ツール呼び出しの種類。クライアント関数は `function`、組み込みの `$web_search` は
            `builtin_function`。
          enum:
            - function
            - builtin_function
        function:
          type: object
          description: モデルが要求した関数と引数。
          properties:
            name:
              type: string
              description: 関数名。
            arguments:
              type: string
              description: JSON 文字列としてエンコードされた関数引数。
      description: 複数ターンでは ID、型、関数名、引数、推論内容を含むツール呼び出しを完全に保持してください。
  responses:
    BadRequest:
      description: リクエストパラメータが無効です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API キーがないか、無効です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: レート制限超過またはクォータ不足
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 内部サービスエラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##すべての API で Bearer Token 認証が必要です##

        **API キーの取得：**

        [API キー管理ページ](https://evolink.ai/dashboard/keys)で API キーを取得してください

        **リクエストヘッダーに追加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````

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