> ## 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 モデルを呼び出し、`model` でモデルを選択します
- 必須パラメータは `model` と `messages` のみです
- 3 モデルともコンテキストウィンドウは 1,048,576 tokens、デフォルトの最大出力は 131,072 tokens です
- 3 モデルとも推論は常に有効で、内容は `reasoning_content` に返されます。推論トークンは出力に含まれます
- ツール呼び出し、Web 検索、構造化出力、画像入力、キャッシュ設定は[完全リファレンス](/ja/api-manual/language-series/kimi/chat-completions/chat-completions-reference)をご覧ください

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

> [!NOTE]
>
> **Kimi モデルでは推論が常に有効**で、内容は `reasoning_content` に返されます。推論トークンは出力に含まれます。`max_completion_tokens` を小さくしすぎると、推論中に出力枠を使い切り、回答本文が返らない場合があります。


## OpenAPI

````yaml ja/api-manual/language-series/kimi/chat-completions/chat-completions-quickstart.json POST /v1/chat/completions
openapi: 3.1.0
info:
  title: Kimi API（全モデル）- Chat Completions クイックスタート
  description: >-
    OpenAI 互換の Chat Completions プロトコルで Kimi テキストモデルを呼び出すクイックスタート例です。`model` と
    `messages` だけで会話を開始できます。ツール呼び出し、Web 検索、構造化出力、画像入力などは「完全リファレンス」ページをご覧ください。
  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 クイックチャット（全モデル）
      description: >-
        - OpenAI Chat Completions プロトコルで Kimi モデルを呼び出し、`model` でモデルを選択します

        - 必須パラメータは `model` と `messages` のみです

        - 3 モデルともコンテキストウィンドウは 1,048,576 tokens、デフォルトの最大出力は 131,072 tokens です

        - 3 モデルとも推論は常に有効で、内容は `reasoning_content` に返されます。推論トークンは出力に含まれます

        - ツール呼び出し、Web
        検索、構造化出力、画像入力、キャッシュ設定は[完全リファレンス](/ja/api-manual/language-series/kimi/chat-completions/chat-completions-reference)をご覧ください
      operationId: kimiChatCompletionsQuick
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatCompletionQuickRequest'
            examples:
              simple:
                summary: Pro の最小リクエスト
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: コンテキストキャッシュを一文で説明してください。
              highspeed:
                summary: Highspeed：低い推論強度
                value:
                  model: kimi-k3.1-pro-highspeed
                  messages:
                    - role: user
                      content: コンテキストキャッシュを一文で説明してください。
                  reasoning_effort: low
              k3:
                summary: Kimi K3 の最小リクエスト
                value:
                  model: kimi-k3
                  messages:
                    - role: user
                      content: コンテキストキャッシュを一文で説明してください。
              multi_turn:
                summary: システムプロンプトと複数ターンの会話
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: system
                      content: あなたは正確さを重視する技術編集者です。簡潔に回答してください。
                    - role: user
                      content: コンテキストキャッシュとは何ですか？
                    - role: assistant
                      content: >-
                        コンテキストキャッシュはリクエストで繰り返されるプレフィックスを保存し、後続のリクエストでヒットすると、より高速かつ低コストで処理できます。
                    - role: user
                      content: どのような用途に適していますか？
                  reasoning_effort: low
              streaming:
                summary: SSE ストリーミング出力
                value:
                  model: kimi-k3.1-pro
                  messages:
                    - role: user
                      content: 夏の夜について 4 行の短い詩を書いてください。
                  reasoning_effort: low
                  max_completion_tokens: 2048
                  stream: true
      responses:
        '200':
          description: 会話の生成に成功。ストリーミングでは 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:
    ChatCompletionQuickRequest:
      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` | 最新世代モデル（推奨） |
            | `kimi-k3.1-pro-highspeed` | Pro と同じパラメータで、より高速に生成 |
            | `kimi-k3` | 前世代モデル |

            3 モデルともコンテキストウィンドウは 1,048,576 tokens で、推論は常に有効です。
        messages:
          type: array
          minItems: 1
          description: 会話メッセージ。複数ターンでは履歴を順番に含めてください。推論とツール呼び出しの履歴を再送する方法は完全リファレンスをご覧ください。
          items:
            $ref: '#/components/schemas/MessageSimple'
        reasoning_effort:
          type: string
          enum:
            - low
            - high
            - max
          default: max
          description: 推論強度。デフォルトは `max`。`kimi-k3` は `max` のみ対応します。その他の互換値は完全リファレンスをご覧ください。
        max_completion_tokens:
          type: integer
          minimum: 1
          maximum: 1048576
          default: 131072
          description: 推論と最終回答を含む最大生成トークン数。デフォルト 131072、最大 1048576。
        stream:
          type: boolean
          default: false
          description: 応答を SSE ストリームで返すかどうか。
    ChatCompletionResponse:
      type: object
      properties:
        id:
          type: string
          description: レスポンス ID。
          example: chatcmpl-6adc72a2823cc13b156bf863
        object:
          type: string
          enum:
            - chat.completion
          example: chat.completion
        created:
          type: integer
          description: 作成日時。Unix タイムスタンプ（秒）。
          example: 1792832163
        model:
          type: string
          description: 今回の呼び出しで使用したモデル。
          example: kimi-k3.1-pro
        choices:
          type: array
          items:
            $ref: '#/components/schemas/Choice'
        usage:
          $ref: '#/components/schemas/Usage'
    MessageSimple:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - system
            - user
            - assistant
          description: メッセージのロール：`system` はシステムプロンプト、`user` はユーザー入力、`assistant` は過去の回答です。
        content:
          type: string
          description: メッセージ内容（プレーンテキスト）。
          example: コンテキストキャッシュを一文で説明してください。
    Choice:
      type: object
      properties:
        index:
          type: integer
          example: 0
        message:
          $ref: '#/components/schemas/AssistantMessage'
        finish_reason:
          type: string
          enum:
            - stop
            - length
            - tool_calls
          description: >-
            終了理由：`stop` は自然な終了、`length` は出力上限への到達、`tool_calls`
            はモデルによるツール呼び出し要求です。
          example: stop
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
          description: キャッシュヒット分を含む総入力トークン。
          example: 24
        completion_tokens:
          type: integer
          description: 推論トークンを含む出力トークン。
          example: 96
        total_tokens:
          type: integer
          description: 入力と出力の合計 tokens。
          example: 120
        prompt_tokens_details:
          type: object
          properties:
            cached_tokens:
              type: integer
              description: キャッシュから提供された入力 tokens。
              example: 0
        completion_tokens_details:
          type: object
          properties:
            reasoning_tokens:
              type: integer
              description: 推論 tokens。completion_tokens に含まれています。
              example: 62
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
                - string
                - 'null'
    AssistantMessage:
      type: object
      properties:
        role:
          type: string
          enum:
            - assistant
          example: assistant
        content:
          type:
            - string
            - 'null'
          description: 最終回答。
          example: >-
            コンテキストキャッシュはリクエストで繰り返されるプレフィックスを保存し、後続のリクエストでヒットすると、より高速かつ低コストで処理できます。
        reasoning_content:
          type: string
          description: 推論内容。複数ターンでは完全な assistant メッセージとともに再送してください。
          example: ユーザーはコンテキストキャッシュについて、保存する内容と利点を一文で知りたがっています。
  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.