すべてのプロダクト
Search
ドキュメントセンター

Alibaba Cloud Model Studio:サーバーサイドイベント

最終更新日:Feb 05, 2026

このトピックでは、Qwen-TTS-Realtime API のサーバーサイドイベントについて説明します。

詳細については、「Qwen を使用したリアルタイム音声合成」をご参照ください。

error

サーバーは、クライアントサイドとサーバーサイドの両方のエラーに対してこのイベントに応答します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_QzAVZRVa9hKqM5VOaHunh",
  "type": "error",
  "error": {
    "code": "invalid_value",
    "message": "Session update error: session already started or finished or failed."
  }
}

type string

イベントタイプです。この値は常に error です。

error object

エラー詳細です。

プロパティ

code string

エラーコードです。

message string

エラーメッセージです。

session.created

クライアントが接続した後、サーバーは最初の応答としてこのイベントを送信します。これには、セッションのデフォルト構成が含まれます。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_xxx",
  "type": "session.created",
  "session": {
    "object": "realtime.session",
    "mode": "server_commit",
    "model": "qwen-tts-realtime",
    "voice": "Cherry",
    "response_format": "pcm",
    "sample_rate": 24000,
    "id": "sess_xxx"
  }
}

type string

イベントタイプです。この値は常に session.created です。

session object

セッション構成です。

プロパティ

id string

セッション ID です。

object string

セッションサービス名です。

mode string

インタラクションモードです。有効な値は server_commit または commit です。

model string

使用されるモデルです。

voice string

使用される音声です。

response_format string

オーディオフォーマットです。

sample_rate integer

音声サンプリングレートです。

session.updated

サーバーは、クライアントから session.update リクエストを受信して正常に処理した後に、このイベントを送信します。エラーが発生した場合は、代わりに error イベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_xxx",
  "type": "session.updated",
  "session": {
    "id": "sess_xxx",
    "object": "realtime.session",
    "model": "qwen-tts-realtime",
    "voice": "Cherry",
    "language_type": "Chinese",
    "mode": "commit",
    "response_format": "pcm",
    "sample_rate": 24000
  }
}

type string

イベントタイプです。この値は常に session.updated です。

session object

セッション構成です。

プロパティ

id string

セッション ID です。

object string

セッションサービス名です。

mode string

インタラクションモードです。有効な値は server_commit または commit です。

model string

使用されるモデルです。

voice string

使用される音色です。

response_format string

オーディオフォーマットです。

sample_rate integer

音声サンプリングレートです。

language_type string

オーディオの言語です。

input_text_buffer.committed

クライアントから input_text_buffer.commit イベントを受信した後、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_FC6MA88wS2oEeXkPvWsxX",
  "type": "input_text_buffer.committed",
  "item_id": ""
}

type string

イベントタイプです。この値は常に input_text_buffer.committed です。

item_id string

作成するユーザーメッセージアイテムの ID です。

input_text_buffer.cleared

クライアントが input_audio_buffer.clear イベントを送信した後のサーバーの応答イベントです。

event_id string

サーバーサイドイベントの ID です。

{
    "event_id": "event_1122",
    "type": "input_text_buffer.cleared"
}

type string

イベントタイプです。この値は常に input_text_buffer.cleared です。

response.created

クライアントから input_text_buffer.commit イベントを受信した後、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_IMnLqDvG6Ahhk7sWV2uOs",
  "type": "response.created",
  "response": {
    "id": "resp_USvBwHktHcz76r6GaIJUV",
    "object": "realtime.response",
    "conversation_id": "",
    "status": "in_progress",
    "voice": "Cherry",
    "output": []
  }
}

type string

イベントタイプです。この値は常に response.created です。

response object

応答詳細です。

プロパティ

id string

応答 ID です。

object string

オブジェクトタイプです。この値は常に realtime.response です。

status string

応答の最終ステータスです。有効な値は次のとおりです。

  • completed

  • failed

  • in_progress

  • incomplete

voice string

使用される音声です。

output array

このフィールドは、このイベントでは空です。

response.output_item.added

新しい出力アイテムの準備ができたときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_INDGnGNulaXCrStd9ZM5X",
  "type": "response.output_item.added",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "output_index": 0,
  "item": {
    "id": "item_FIrYGaNVK3rbIZqeY4QjM",
    "object": "realtime.item",
    "type": "message",
    "status": "in_progress",
    "role": "assistant",
    "content": []
  }
}

type string

イベントタイプです。この値は常に response.output_item.added です。

response_id string

応答の ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

item object

出力アイテム詳細です。

プロパティ

id string

出力アイテムの ID です。

object string

この値は常に realtime.item です。

status string

出力アイテムのステータスです。

content array

メッセージコンテンツです。

response.content_part.added

新しいコンテンツパートの準備ができたときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_DigZ95MWN36YYyyjcENoq",
  "type": "response.content_part.added",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": ""
  }
}

type string

イベントタイプです。この値は常に response.content_part.added です。

response_id string

応答の ID です。

item_id string

メッセージアイテムの ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

content_index integer

応答出力アイテム内のコンテンツパートのインデックスです。この値は常に 0 です。

part object

完了したコンテンツパートです。

プロパティ

type string

コンテンツパートのタイプです。

text string

コンテンツパートのテキストです。

response.audio.delta

モデルが新しいオーディオデータを増分的に生成するときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_B1osWMZBtrEQbiIwW0qHQ",
  "type": "response.audio.delta",
  "response_id": "resp_B1osWTzBb8hO0WsELHgVP",
  "item_id": "item_B1osWH81fXDoyim1T5fsF",
  "output_index": 0,
  "content_index": 0,
  "delta": "base64 audio"
}

type string

イベントタイプです。この値は常に response.audio.delta です。

response_id string

応答の ID です。

item_id string

メッセージアイテムの ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

content_index integer

応答出力アイテム内のコンテンツパートのインデックスです。この値は常に 0 です。

delta string

モデルによって増分的に生成されたオーディオデータです。データは Base64エンコードされています。

response.content_part.done

コンテンツパートが完了したときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_Vo2YUjlYQJ4colH8nVzkU",
  "type": "response.content_part.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0,
  "part": {
    "type": "audio",
    "text": ""
  }
}

type string

イベントタイプです。この値は常に response.content_part.done です。

response_id string

応答の ID です。

item_id string

メッセージアイテムの ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

content_index integer

応答出力アイテム内のコンテンツパートのインデックスです。この値は常に 0 です。

part object

完了したコンテンツパートです。

プロパティ

type string

コンテンツパートのタイプです。

text string

コンテンツパートのテキストです。

response.output_item.done

出力アイテムが完了したときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_LO6SJRKIQ9NBayyYB8a1A",
  "type": "response.output_item.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "output_index": 0,
  "item": {
    "id": "item_FIrYGaNVK3rbIZqeY4QjM",
    "object": "realtime.item",
    "type": "message",
    "status": "completed",
    "role": "assistant",
    "content": [
      {
        "type": "audio",
        "text": ""
      }
    ]
  }
}

type string

イベントタイプです。この値は常に response.output_item.done です。

response_id string

応答の ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

item object

出力アイテム詳細です。

プロパティ

id string

出力アイテムの ID です。

object string

この値は常に realtime.item です。

status string

出力アイテムのステータスです。

content array

メッセージコンテンツです。

response.audio.done

モデルがオーディオデータの生成を完了したときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_LZaOHPzXYMUXGBcVkBmKX",
  "type": "response.audio.done",
  "response_id": "resp_USvBwHktHcz76r6GaIJUV",
  "item_id": "item_FIrYGaNVK3rbIZqeY4QjM",
  "output_index": 0,
  "content_index": 0
}

type string

イベントタイプです。この値は常に response.audio.done です。

response_id string

応答の ID です。

item_id string

メッセージアイテムの ID です。

output_index integer

応答出力アイテムのインデックスです。この値は常に 0 です。

content_index integer

応答出力アイテム内のコンテンツパートのインデックスです。この値は常に 0 です。

response.done

応答生成が完了したときに、サーバーはこのイベントを送信します。このイベントの response オブジェクトには、すべての出力アイテムが含まれますが、すでに送信された生オーディオデータは除外されます。

event_id string

サーバーサイドイベントの ID です。

Qwen3-TTS Realtime

{
    "event_id": "event_Aemy83XqHFFDDSeJIDn6N",
    "type": "response.done",
    "response": {
        "id": "resp_LFeR42yXZ9SxUAeXjmyTz",
        "object": "realtime.response",
        "conversation_id": "",
        "status": "completed",
        "modalities": [
            "text",
            "audio"
        ],
        "voice": "Cherry",
        "output": [
            {
                "id": "item_Ae1lv2XmRljRSG96L8Zm1",
                "object": "realtime.item",
                "type": "message",
                "status": "completed",
                "role": "assistant",
                "content": [
                    {
                        "type": "audio",
                        "transcript": ""
                    }
                ]
            }
        ],
        "usage": {
            "characters": 25
        }
    }
}

Qwen-TTS Realtime

{
  "event_id": "event_xxx",
  "type": "response.done",
  "response": {
    "id": "resp_xxx",
    "object": "realtime.response",
    "conversation_id": "",
    "status": "completed",
    "modalities": [
      "text",
      "audio"
    ],
    "voice": "Cherry",
    "output": [
      {
        "id": "item_FIrYGaNVK3rbIZqeY4QjM",
        "object": "realtime.item",
        "type": "message",
        "status": "completed",
        "role": "assistant",
        "content": [
          {
            "type": "audio",
            "transcript": ""
          }
        ]
      }
    ],
    "usage": {
      "total_tokens": 67,
      "input_tokens": 3,
      "output_tokens": 64,
      "input_tokens_details": {
        "text_tokens": 3
      },
      "output_tokens_details": {
        "text_tokens": 0,
        "audio_tokens": 64
      }
    }
  }
}

type string

イベントタイプです。この値は常に response.done です。

response_id string

応答の ID です。

response object

応答詳細です。

プロパティ

id string

応答 ID です。

object string

オブジェクトタイプです。この値は常に realtime.response です。

output array

応答出力です。

usage object

この音声合成リクエストの課金情報です。

プロパティ

characters integer

Qwen3-TTS Realtime で課金される文字数です。

total_tokensinteger

Qwen-TTS Realtime の入力と出力 (合成されたオーディオ) の合計トークン数です。

input_tokensinteger

Qwen-TTS Realtime の入力コンテンツのトークン数です。

output_tokensinteger

Qwen-TTS Realtime の出力コンテンツのトークン数です。

input_tokens_detailsinteger

Qwen-TTS Realtime の入力コンテンツの詳細なトークン数です。

input_tokens_details.text_tokensinteger

Qwen-TTS Realtime の入力テキストコンテンツのトークン数です。

output_tokens_detailsinteger

Qwen-TTS Realtime の出力コンテンツの詳細なトークン数です。

output_tokens_details.text_tokensinteger

Qwen-TTS Realtime の出力テキストコンテンツのトークン数です。

output_tokens_details.audio_tokensinteger

Qwen-TTS Realtime の出力オーディオコンテンツのトークン数です。

オーディオからトークンへの変換ルール: オーディオの 1 秒ごとに 50 トークンに相当します。1 秒未満のオーディオは 50 トークンとしてカウントされます。

session.finished

すべての応答が生成されたときに、サーバーはこのイベントを送信します。

event_id string

サーバーサイドイベントの ID です。

{
  "event_id": "event_2239",
  "type": "session.finished"
}

type string

イベントタイプです。この値は常に session.finished です。