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

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

最終更新日:Oct 11, 2026

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

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

error

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

event_idstring

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

typestring

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

errorobject

エラー詳細です。

プロパティ

codestring

エラーコードです。

messagestring

エラーメッセージです。

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

session.created

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

event_idstring

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

typestring

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

sessionobject

セッション構成です。

プロパティ

idstring

セッション ID です。

objectstring

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

modestring

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

modelstring

使用されるモデルです。

voicestring

使用される音声です。

response_formatstring

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

sample_rateinteger

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

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

session.updated

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

event_idstring

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

typestring

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

sessionobject

セッション構成です。

プロパティ

idstring

セッション ID です。

objectstring

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

modestring

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

modelstring

使用されるモデルです。

voicestring

使用される音色です。

response_formatstring

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

sample_rateinteger

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

language_typestring

オーディオの言語です。

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

input_text_buffer.committed

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

event_idstring

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

typestring

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

item_idstring

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

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

input_text_buffer.cleared

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

event_idstring

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

typestring

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

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

response.created

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

event_idstring

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

typestring

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

responseobject

応答詳細です。

プロパティ

idstring

応答 ID です。

objectstring

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

statusstring

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

  • completed
  • failed
  • in_progress
  • incomplete

voicestring

使用される音声です。

outputarray

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

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

response.output_item.added

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

output_indexinteger

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

itemobject

出力アイテム詳細です。

プロパティ

idstring

出力アイテムの ID です。

objectstring

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

statusstring

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

contentarray

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

{
  "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": []
  }
}

response.content_part.added

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

item_idstring

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

output_indexinteger

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

content_indexinteger

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

partobject

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

プロパティ

typestring

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

textstring

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

{
  "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": ""
  }
}

response.audio.delta

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

item_idstring

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

output_indexinteger

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

content_indexinteger

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

deltastring

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

{
  "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"
}

response.content_part.done

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

item_idstring

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

output_indexinteger

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

content_indexinteger

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

partobject

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

プロパティ

typestring

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

textstring

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

{
  "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": ""
  }
}

response.output_item.done

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

output_indexinteger

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

itemobject

出力アイテム詳細です。

プロパティ

idstring

出力アイテムの ID です。

objectstring

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

statusstring

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

contentarray

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

{
  "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": ""
      }
    ]
  }
}

response.audio.done

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

item_idstring

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

output_indexinteger

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

content_indexinteger

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

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

response.done

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

event_idstring

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

typestring

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

response_idstring

応答の ID です。

responseobject

応答詳細です。

プロパティ

idstring

応答 ID です。

objectstring

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

outputarray

応答出力です。

usageobject

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

プロパティ

charactersinteger

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
        }
    }
}

session.finished

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

event_idstring

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

typestring

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

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