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

# チャットメッセージを送信

> チャットアプリケーションにリクエストを送信します。



## OpenAPI

````yaml /ja/api-reference/openapi_chatflow.json post /chat-messages
openapi: 3.0.1
info:
  title: 高度なチャットアプリAPI (Chatflow API)
  description: >-
    Chatflow アプリケーションはセッションの永続化をサポートし、過去のチャット履歴をレスポンスのコンテキストとして使用できます。Chatflow
    アプリは `advanced-chat`
    モードを使用し、ノードの開始・完了、イテレーション、ワークフローのライフサイクルを含む詳細な実行追跡のためのワークフローレベルのストリーミングイベントを提供します。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: Chatflow アプリ API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - name: チャットフロー
    description: チャットフローアプリケーションの操作です（チャットメッセージ、ワークフロー実行詳細、イベントストリーミングを含む）。
  - name: ファイル操作
    description: ファイルのアップロードとプレビューの操作です。
  - name: エンドユーザー
    description: エンドユーザー情報に関連する操作です。
  - name: メッセージフィードバック
    description: ユーザーフィードバックの操作です。
  - name: 会話管理
    description: 会話管理に関連する操作です。
  - name: 音声・テキスト変換
    description: テキスト読み上げと音声認識の操作です。
  - name: アプリケーション設定
    description: アプリケーション設定と情報を取得する操作です。
  - name: アノテーション管理
    description: ダイレクト返信用のアノテーション管理に関連する操作です。
  - name: 人間の入力
    description: 人間の入力を要する一時停止中のワークフローの再開操作です。
paths:
  /chat-messages:
    post:
      tags:
        - チャットフロー
      summary: チャットメッセージを送信
      description: チャットアプリケーションにリクエストを送信します。
      operationId: sendChatflowMessageJp
      requestBody:
        description: チャットメッセージを送信するためのリクエストボディ。
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatRequest'
            examples:
              streaming_example:
                summary: リクエスト例 - ストリーミングモード
                value:
                  inputs:
                    city: San Francisco
                  query: What are the specs of the iPhone 13 Pro Max?
                  response_mode: streaming
                  conversation_id: ''
                  user: abc-123
                  files:
                    - type: image
                      transfer_method: remote_url
                      url: https://cloud.dify.ai/logo/logo-site.png
              blocking_example:
                summary: リクエスト例 - ブロッキングモード
                value:
                  inputs: {}
                  query: What are the specs of the iPhone 13 Pro Max?
                  response_mode: blocking
                  conversation_id: 45701982-8118-4bc5-8e9b-64562b4555f2
                  user: abc-123
      responses:
        '200':
          description: >-
            リクエスト成功。コンテンツタイプと構造はリクエストの `response_mode` パラメータに依存します。


            - `response_mode` が `blocking` の場合、 `application/json` で
            `ChatCompletionResponse` オブジェクトを返します。

            - `response_mode` が `streaming` の場合、`text/event-stream`
            でサーバー送信イベントのストリームを返します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionResponse'
              examples:
                blockingResponse:
                  summary: レスポンス例 - ブロッキングモード
                  value:
                    event: message
                    task_id: c3800678-a077-43df-a102-53f23ed20b88
                    id: b01a39de-3480-4f3e-9f1e-4841a80f8e5e
                    message_id: 9da23599-e713-473b-982c-4328d4f5c78a
                    conversation_id: 45701982-8118-4bc5-8e9b-64562b4555f2
                    mode: advanced-chat
                    answer: iPhone 13 Pro Max specs are listed here:...
                    metadata:
                      usage:
                        prompt_tokens: 1033
                        prompt_unit_price: '0.001'
                        prompt_price_unit: '0.001'
                        prompt_price: '0.0010330'
                        completion_tokens: 128
                        completion_unit_price: '0.002'
                        completion_price_unit: '0.001'
                        completion_price: '0.0002560'
                        total_tokens: 1161
                        total_price: '0.0012890'
                        currency: USD
                        latency: 0.7682376249867957
                      retriever_resources:
                        - position: 1
                          dataset_id: 101b4c97-fc2e-463c-90b1-5261a4cdcafb
                          dataset_name: iPhone
                          document_id: 8dd1ad74-0b5f-4175-b735-7d98bbbb4e00
                          document_name: iPhone List
                          segment_id: ed599c7f-2766-4294-9d1d-e5235a61270a
                          score: 0.98457545
                          content: >-
                            "Model","Release Date","Display
                            Size","Resolution","Processor","RAM","Storage","Camera","Battery","Operating
                            System" "iPhone 13 Pro Max","September 24,
                            2021","6.7 inch","1284 x 2778","Hexa-core (2x3.23
                            GHz Avalanche + 4x1.82 GHz Blizzard)","6 GB","128,
                            256, 512 GB, 1TB","12 MP","4352 mAh","iOS 15"
                    created_at: 1705407629
            text/event-stream:
              schema:
                type: string
                description: >-
                  サーバー送信イベント (SSE) のストリームです。


                  **パース**：各イベントは `data: ` プレフィックス付きの JSON オブジェクトの行で、`\n\n`
                  で終了します。JSON をパースする前に `data: ` プレフィックスを除去し、`event`
                  フィールドを読み取ってイベントタイプを判定してください。`ping` イベントは `event: ping`
                  行（`data:` ペイロードなし）として 10 秒ごとに接続維持のために送信されるため、無視してください。


                  **ストリームライフサイクル**：ワークフローの進行は
                  `workflow_started`、ノードイベント（`node_started` と
                  `node_finished`、およびイテレーションとループの各バリアント）として、回答は `message`
                  イベントとしてストリーミングされます（`reasoning_format: separated` を指定した LLM
                  ノードは、モデルの思考過程を伝える `reasoning_chunk`
                  イベントも並行して発行します）。終了シーケンスは実行結果によって異なります：

                  - **成功**：`message_end`、続いて `workflow_finished`

                  - **失敗**：ステータスが `failed` の `workflow_finished`、続いて
                  `error`。`message_end` は送信されません

                  - **一時停止**：`human_input_required`、続いて
                  `workflow_paused`（ストリームはここで終了し、実行は別途再開されます）


                  テキスト読み上げ（TTS）の自動再生が有効な場合、`tts_message_end` が終了イベントの後に続きます。


                  **イベント**：`ping` を除き、すべてのイベントには
                  `conversation_id`、`message_id`、`created_at`（Unix
                  エポック秒）が含まれます。`error` を除くイベントには `task_id`
                  も含まれます。ワークフロー、ノード、人間の入力イベントは、ペイロードを `data` の下にネストし、`agent_log`
                  を除いてトップレベルの `workflow_run_id` を持ちます。


                  **応答イベント**


                  | イベント | 発生タイミング | 主なフィールド |

                  |:---|:---|:---|

                  | `message` | 回答の各チャンク（順番に連結） | `answer` |

                  | `message_replace` | 出力モデレーションがそれまでの回答を置き換える |
                  `answer`、`reason` |

                  | `reasoning_chunk` | 思考過程の各デルタ（LLM ノードが `reasoning_format:
                  separated` を使用する場合）。順番に連結してください。`is_final: true`
                  の最終イベントは思考の完了を示し、空の `reasoning` を伴う場合があります |
                  `data.message_id`、`data.reasoning`、`data.node_id`、`data.is_final`
                  |

                  | `message_end` | 回答が完了 |
                  `metadata`（`usage`、`retriever_resources`） |

                  | `tts_message`、`tts_message_end` | 音声チャンク/終了（TTS 自動再生が有効な場合）
                  | `audio` |


                  **ワークフロー・ノードイベント**


                  各イベントはペイロードを `data` オブジェクトの下にネストします。


                  | イベント | 発生タイミング | 主な `data` フィールド |

                  |:---|:---|:---|

                  | `workflow_started` | 実行開始 | `inputs` |

                  | `node_started` | ノード開始 | `node_id`、`node_type`、`title` |

                  | `node_finished` | ノード終了 |
                  `status`、`outputs`、`execution_metadata` |

                  | `node_retry` | 失敗後にノードを再試行 | `retry_index` |

                  | `iteration_started`、`iteration_next`、`iteration_completed` |
                  イテレーションノードの進行（情報提供のみ、処理は任意） | `data` |

                  | `loop_started`、`loop_next`、`loop_completed` |
                  ループノードの進行（情報提供のみ、処理は任意） | `data` |

                  | `agent_log` | Agent
                  ノードのステップログ（情報提供のみ、処理は任意、`workflow_run_id` なし） | `data` |

                  | `workflow_finished` | 実行終了 |
                  `status`（`succeeded`、`failed`、`partial-succeeded`、`stopped`）、`outputs`、`total_tokens`
                  |

                  | `workflow_paused` | 実行が一時停止 | `paused_nodes`、`reasons` |

                  | `human_input_required` | 実行が人間の入力ノードに到達 |
                  `form_token`、`form_content`、`expiration_time` |


                  一時停止後、このストリームは `workflow_paused`
                  で終了します。[人間の入力フォームを送信](/api-reference/人間の入力/人間の入力フォームを送信)
                  でフォームを送信するか、タイムアウトさせてください。再開後の実行（`human_input_form_filled`/`human_input_form_timeout`
                  から `workflow_finished`
                  までを含む）は、[ワークフローイベントをストリーム](/api-reference/チャットフロー/ワークフローイベントをストリーム)
                  からストリーミングされます。


                  **トランスポートイベント**


                  | イベント | 発生タイミング | 主なフィールド |

                  |:---|:---|:---|

                  | `error` | 失敗によりストリームが終了。HTTP は `200` のまま |
                  `status`（例：`400`）、`code`（例：`invalid_param`）、`message` |

                  | `ping` | 10 秒ごとのキープアライブ | なし |
              examples:
                streamingResponseBasic:
                  summary: Response Example - Streaming (Basic)
                  value: >-
                    data: {"event": "message", "task_id": "mock_task_id",
                    "message_id": "5ad4cb98-f0c7-4085-b384-88c403be6290",
                    "conversation_id": "45701982-8118-4bc5-8e9b-64562b4555f2",
                    "answer": " I", "created_at": 1679586595} data: {"event":
                    "message_end", "task_id": "mock_task_id", "message_id":
                    "5ad4cb98-f0c7-4085-b384-88c403be6290", "conversation_id":
                    "45701982-8118-4bc5-8e9b-64562b4555f2", "created_at":
                    1679586595, "metadata": {"usage": {"total_tokens": 10,
                    "latency": 1.0}}}
                streamingResponseWorkflow:
                  summary: Response Example - Streaming (Workflow)
                  value: >-
                    data: {"event": "workflow_started", "task_id": "task123",
                    "workflow_run_id": "wfr_abc123", "message_id": "msg123",
                    "conversation_id": "conv123", "created_at": 1705395332,
                    "data": {"id": "wfr_abc123", "workflow_id": "wf_def456",
                    "inputs": {"city": "San Francisco"}, "created_at":
                    1705395332}} data: {"event": "node_started", "task_id":
                    "task123", "workflow_run_id": "wfr_abc123", "message_id":
                    "msg123", "conversation_id": "conv123", "created_at":
                    1705395332, "data": {"id": "ne_001", "node_id":
                    "node_llm_1", "node_type": "llm", "title": "LLM", "index":
                    1, "created_at": 1705395332}} data: {"event":
                    "reasoning_chunk", "task_id": "task123", "message_id":
                    "msg123", "conversation_id": "conv123", "created_at":
                    1705395333, "data": {"message_id": "msg123", "reasoning":
                    "The user greeted me, so", "node_id": "node_llm_1",
                    "is_final": false}} data: {"event": "reasoning_chunk",
                    "task_id": "task123", "message_id": "msg123",
                    "conversation_id": "conv123", "created_at": 1705395333,
                    "data": {"message_id": "msg123", "reasoning": "", "node_id":
                    "node_llm_1", "is_final": true}} data: {"event": "message",
                    "task_id": "task123", "message_id": "msg123",
                    "conversation_id": "conv123", "answer": " I", "created_at":
                    1705395333} data: {"event": "node_finished", "task_id":
                    "task123", "workflow_run_id": "wfr_abc123", "message_id":
                    "msg123", "conversation_id": "conv123", "created_at":
                    1705395334, "data": {"id": "ne_001", "node_id":
                    "node_llm_1", "node_type": "llm", "title": "LLM", "index":
                    1, "status": "succeeded", "elapsed_time": 1.5, "created_at":
                    1705395332, "finished_at": 1705395334}} data: {"event":
                    "message_end", "task_id": "task123", "message_id": "msg123",
                    "conversation_id": "conv123", "created_at": 1705395334,
                    "metadata": {"usage": {"total_tokens": 50, "latency": 2.5}}}
                    data: {"event": "workflow_finished", "task_id": "task123",
                    "workflow_run_id": "wfr_abc123", "message_id": "msg123",
                    "conversation_id": "conv123", "created_at": 1705395335,
                    "data": {"id": "wfr_abc123", "workflow_id": "wf_def456",
                    "status": "succeeded", "elapsed_time": 2.5, "total_tokens":
                    50, "total_steps": 2, "created_at": 1705395332,
                    "finished_at": 1705395335}}
                humanInputPause:
                  summary: レスポンス例 - 人間の入力での一時停止
                  value: >-
                    data: {"event": "workflow_started", "task_id":
                    "c3800678-a077-43df-a102-53f23ed20b88", "message_id":
                    "2e4f6a8b-1c3d-5e7f-9a0b-2c4d6e8f0a1b", "conversation_id":
                    "9d3a2f1b-6c7d-4e8f-a0b1-c2d3e4f5a6b7", "created_at":
                    1705407629, "workflow_run_id":
                    "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"id":
                    "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "workflow_id":
                    "7c3e33d4-2a8b-4e5f-9b1a-d3c6e8f12345", "inputs": {"draft":
                    "Hello"}, "created_at": 1705407629, "reason": "initial"}}
                    data: {"event": "human_input_required", "task_id":
                    "c3800678-a077-43df-a102-53f23ed20b88", "message_id":
                    "2e4f6a8b-1c3d-5e7f-9a0b-2c4d6e8f0a1b", "conversation_id":
                    "9d3a2f1b-6c7d-4e8f-a0b1-c2d3e4f5a6b7", "created_at":
                    1705407629, "workflow_run_id":
                    "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data": {"form_id":
                    "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "form_token":
                    "tok_abc123", "node_id": "approval_node", "node_title":
                    "Approval", "form_content": "Please review the draft.",
                    "inputs": [{"type": "paragraph", "output_variable_name":
                    "comment", "default": null}], "actions": [{"id": "approve",
                    "title": "Approve", "button_style": "primary"}],
                    "display_in_ui": false, "resolved_default_values":
                    {"comment": ""}, "expiration_time": 1705494029}} data:
                    {"event": "workflow_paused", "task_id":
                    "c3800678-a077-43df-a102-53f23ed20b88", "message_id":
                    "2e4f6a8b-1c3d-5e7f-9a0b-2c4d6e8f0a1b", "conversation_id":
                    "9d3a2f1b-6c7d-4e8f-a0b1-c2d3e4f5a6b7", "created_at":
                    1705407629, "workflow_run_id":
                    "fb47b2e6-5e43-4f90-be01-d5c5a088d156", "data":
                    {"workflow_run_id": "fb47b2e6-5e43-4f90-be01-d5c5a088d156",
                    "paused_nodes": ["approval_node"], "outputs": {}, "reasons":
                    [{"TYPE": "human_input_required", "form_id":
                    "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "form_content":
                    "Please review the draft.", "inputs": [{"type": "paragraph",
                    "output_variable_name": "comment", "default": null}],
                    "actions": [{"id": "approve", "title": "Approve",
                    "button_style": "primary"}], "node_id": "approval_node",
                    "node_title": "Approval", "resolved_default_values":
                    {"comment": ""}, "form_token": "tok_abc123",
                    "expiration_time": 1705494029}], "status": "paused",
                    "created_at": 1705407629, "elapsed_time": 0.5,
                    "total_tokens": 0, "total_steps": 1}}
        '400':
          description: |-
            - `app_unavailable` : アプリケーションが利用できないか、設定が正しくありません。
            - `not_chat_app` : App mode does not match the API route.
            - `conversation_completed` : The conversation has ended.
            - `provider_not_initialize` : 有効なモデルプロバイダーの認証情報が見つかりません。
            - `provider_quota_exceeded` : モデルプロバイダーのクォータが使い切られました。
            - `model_currently_not_support` : 現在のモデルは利用できません。
            - `completion_request_error` : テキスト生成に失敗しました。
            - `bad_request` : Cannot use draft workflow version.
            - `bad_request` : Invalid `workflow_id` format.
          content:
            application/json:
              examples:
                app_unavailable:
                  summary: app_unavailable
                  value:
                    status: 400
                    code: app_unavailable
                    message: App unavailable, please check your app configurations.
                not_chat_app:
                  summary: not_chat_app
                  value:
                    status: 400
                    code: not_chat_app
                    message: Please check if your app mode matches the right API route.
                conversation_completed:
                  summary: conversation_completed
                  value:
                    status: 400
                    code: conversation_completed
                    message: >-
                      The conversation has ended. Please start a new
                      conversation.
                provider_not_initialize:
                  summary: provider_not_initialize
                  value:
                    status: 400
                    code: provider_not_initialize
                    message: >-
                      No valid model provider credentials found. Please go to
                      Settings -> Model Provider to complete your provider
                      credentials.
                provider_quota_exceeded:
                  summary: provider_quota_exceeded
                  value:
                    status: 400
                    code: provider_quota_exceeded
                    message: >-
                      Your quota for Dify Hosted OpenAI has been exhausted.
                      Please go to Settings -> Model Provider to complete your
                      own provider credentials.
                model_currently_not_support:
                  summary: model_currently_not_support
                  value:
                    status: 400
                    code: model_currently_not_support
                    message: >-
                      Dify Hosted OpenAI trial currently not support the GPT-4
                      model.
                completion_request_error:
                  summary: completion_request_error
                  value:
                    status: 400
                    code: completion_request_error
                    message: Completion request failed.
                is_draft_workflow:
                  summary: bad_request
                  value:
                    status: 400
                    code: bad_request
                    message: >-
                      Cannot use draft workflow version. Workflow ID:
                      a1b2c3d4-5678-90ab-cdef-1234567890ab. 
                workflow_id_format_error:
                  summary: bad_request
                  value:
                    status: 400
                    code: bad_request
                    message: 'Invalid workflow_id format: ''not-a-valid-id''. '
        '404':
          description: |-
            - `not_found` : 会話が存在しません。
            - `not_found` : 指定された `workflow_id` のワークフローが見つかりません。
          content:
            application/json:
              examples:
                conversation_not_exists:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Conversation Not Exists.
                workflow_not_found:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: >-
                      Workflow not found with id:
                      a1b2c3d4-5678-90ab-cdef-1234567890ab
        '429':
          description: |-
            - `too_many_requests` : このアプリケーションへの同時リクエストが多すぎます。
            - `rate_limit_error` : アップストリームのモデルプロバイダーのレート制限を超えました。
          content:
            application/json:
              examples:
                too_many_requests:
                  summary: too_many_requests
                  value:
                    status: 429
                    code: too_many_requests
                    message: Too many requests. Please try again later.
                rate_limit_error:
                  summary: rate_limit_error
                  value:
                    status: 429
                    code: rate_limit_error
                    message: Rate Limit Error
        '500':
          description: '`internal_server_error` : 内部サーバーエラー。'
          content:
            application/json:
              examples:
                internal_server_error:
                  summary: internal_server_error
                  value:
                    status: 500
                    code: internal_server_error
                    message: Internal server error.
components:
  schemas:
    ChatRequest:
      type: object
      required:
        - inputs
        - query
        - user
      properties:
        query:
          type: string
          description: ユーザーの入力/質問内容です。
        inputs:
          type: object
          description: >-
            アプリで定義されたさまざまな変数の値を入力できます。キーと値のペアを含みます。アプリが期待する変数名と型については、[アプリケーションのパラメータ情報を取得](/api-reference/アプリケーション設定/アプリケーションのパラメータ情報を取得)
            レスポンスの `user_input_form` フィールドを参照してください。
          additionalProperties: true
        response_mode:
          type: string
          enum:
            - streaming
            - blocking
          description: >-
            レスポンスの返却モード。`streaming`（推奨）は SSE を使用します。`blocking`
            は完了後に返却します（長時間の処理では中断される場合があります）。Cloudflare のタイムアウトは `100 s`
            です。省略した場合、デフォルトでブロッキングモードになります。
        user:
          type: string
          description: >-
            アプリケーション内で一意のユーザー識別子です。この識別子はデータアクセスの範囲を限定します——会話、メッセージ、ファイルは同じ
            `user` 値でクエリした場合にのみ表示されます。
        conversation_id:
          type: string
          description: >-
            会話を継続するための会話 ID です。前のメッセージの `conversation_id`
            を渡します。新しい会話を開始するには、このフィールドを省略するか空文字列を渡します。レスポンスで `conversation_id`
            が返されます——以降のメッセージでこの値を渡すとその会話を継続できます。
        files:
          type: array
          description: >-
            マルチモーダル理解用のファイルリストです。画像、ドキュメント、音声、動画を含みます。ローカルファイルを添付するには、まず
            [ファイルをアップロード](/api-reference/ファイル操作/ファイルをアップロード) でアップロードし、返された `id`
            を `upload_file_id` として `transfer_method: local_file` で使用します。
          items:
            type: object
            required:
              - type
              - transfer_method
            properties:
              type:
                type: string
                enum:
                  - image
                  - document
                  - audio
                  - video
                  - custom
                description: ファイルタイプ。
              transfer_method:
                type: string
                enum:
                  - remote_url
                  - local_file
                description: >-
                  転送方法です。ファイル URL の場合は `remote_url`、アップロードファイルの場合は `local_file`
                  です。
              url:
                type: string
                format: url
                description: ファイル URL（`transfer_method` が `remote_url` の場合は必須）です。
              upload_file_id:
                type: string
                description: >-
                  [ファイルをアップロード](/api-reference/ファイル操作/ファイルをアップロード) API
                  から取得したアップロード済みファイル ID です（`transfer_method` が `local_file`
                  の場合は必須）。
        auto_generate_name:
          type: boolean
          description: >-
            会話タイトルを自動生成します。`false` の場合、[会話の名前を変更](/api-reference/会話管理/会話の名前を変更)
            API で `auto_generate: true` を設定して非同期でタイトルを生成します。
          default: true
        workflow_id:
          type: string
          description: 実行する公開済みワークフローバージョンの ID を指定します。指定しない場合、最新の公開バージョンが使用されます。
    ChatCompletionResponse:
      type: object
      properties:
        event:
          type: string
          description: イベントタイプ。`message` に固定されています。
        task_id:
          type: string
          format: uuid
          description: リクエスト追跡およびレスポンス停止 API 用のタスク ID です。
        id:
          type: string
          format: uuid
          description: このレスポンスイベントの一意 ID です。
        message_id:
          type: string
          format: uuid
          description: >-
            一意のメッセージ ID です。フィードバックや推奨質問のエンドポイントを呼び出す際に `message_id`
            パラメータとして使用します。
        conversation_id:
          type: string
          format: uuid
          description: 会話 ID。
        mode:
          type: string
          description: アプリモード、`advanced-chat` 固定です。
        answer:
          type: string
          description: 完全なレスポンスコンテンツ。
        metadata:
          type: object
          description: 使用量と検索リソースを含むメタデータ。
          properties:
            usage:
              $ref: '#/components/schemas/Usage'
            retriever_resources:
              type: array
              description: 使用された検索リソースのリスト。
              items:
                $ref: '#/components/schemas/RetrieverResource'
        created_at:
          type: integer
          format: int64
          description: メッセージ作成タイムスタンプ（Unix エポック秒）。
    Usage:
      type: object
      description: モデルの使用情報です。
      properties:
        prompt_tokens:
          type: integer
          description: プロンプト内のトークン数。
        prompt_unit_price:
          type: string
          format: decimal
          description: プロンプトトークンあたりの単価。
        prompt_price_unit:
          type: string
          format: decimal
          description: プロンプトトークンの価格単位。
        prompt_price:
          type: string
          format: decimal
          description: プロンプトトークンの合計価格。
        completion_tokens:
          type: integer
          description: 補完のトークン数。
        completion_unit_price:
          type: string
          format: decimal
          description: 補完トークンあたりの単価。
        completion_price_unit:
          type: string
          format: decimal
          description: 補完トークンの価格単位。
        completion_price:
          type: string
          format: decimal
          description: 補完トークンの合計価格。
        total_tokens:
          type: integer
          description: 使用されたトークンの合計数。
        total_price:
          type: string
          format: decimal
          description: すべてのトークンの合計価格。
        currency:
          type: string
          description: 課金通貨。
        latency:
          type: number
          format: double
          description: レイテンシ（秒）。
    RetrieverResource:
      type: object
      description: 検索リソースの引用および帰属情報です。
      properties:
        id:
          type: string
          format: uuid
          description: 検索リソースの一意の ID。
        message_id:
          type: string
          format: uuid
          description: このリソースが属するメッセージの ID。
        position:
          type: integer
          description: リスト内のリソースの位置。
        dataset_id:
          type: string
          format: uuid
          description: ナレッジベース ID。
        dataset_name:
          type: string
          description: ナレッジベース名。
        document_id:
          type: string
          format: uuid
          description: ドキュメント ID。
        document_name:
          type: string
          description: ドキュメント名。
        data_source_type:
          type: string
          description: データソースのタイプ。
        segment_id:
          type: string
          format: uuid
          description: ドキュメント内の特定のチャンクの ID。
        score:
          type: number
          format: float
          description: リソースの関連性スコア。
        hit_count:
          type: integer
          description: このチャンクがヒットした回数。
        word_count:
          type: integer
          description: チャンクの単語数。
        segment_position:
          type: integer
          description: ドキュメント内のチャンクの位置。
        index_node_hash:
          type: string
          description: インデックスノードのハッシュ。
        content:
          type: string
          description: リソースからのコンテンツスニペット。
        summary:
          type: string
          nullable: true
          description: チャンクコンテンツの要約。
        created_at:
          type: integer
          format: int64
          description: 作成タイムスタンプ（Unix エポック秒）。
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````