POST
/
completion-messages
{
  "event": "<string>",
  "message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "mode": "<string>",
  "answer": "<string>",
  "metadata": {
    "usage": {
      "prompt_tokens": 123,
      "prompt_unit_price": "<string>",
      "prompt_price_unit": "<string>",
      "prompt_price": "<string>",
      "completion_tokens": 123,
      "completion_unit_price": "<string>",
      "completion_price_unit": "<string>",
      "completion_price": "<string>",
      "total_tokens": 123,
      "total_price": "<string>",
      "currency": "<string>",
      "latency": 123
    },
    "retriever_resources": [
      {
        "document_id": "<string>",
        "segment_id": "<string>",
        "score": 123,
        "content": "<string>"
      }
    ]
  },
  "created_at": 123
}

Authorizations

Authorization
string
header
required

API-Key認証。すべてのAPIリクエストで、Authorization HTTPヘッダーに Bearer {API_KEY} の形式でAPIキーを含めてください。APIキーの漏洩を避けるため、サーバーサイドでの保存を強く推奨します。

Body

application/json

完了メッセージを作成するためのリクエストボディ。

The body is of type object.

Response

200
application/json

リクエスト成功。レスポンスのコンテントタイプと構造はリクエストの response_mode パラメータに依存します。

  • response_modeblocking の場合、application/jsonCompletionResponseJp オブジェクトを返します。
  • response_modestreaming の場合、text/event-streamChunkCompletionEventJp のストリームを返します。

ブロッキングモードでのアプリの完全な結果。