Skip to main content

Qwen-Omni-Realtime のサーバーイベント

Qwen-Omni-Realtime API のサーバーイベントです。ツール呼び出し (関数呼び出し) イベントも含まれます。

このページは Qwen-Omni-Realtime のイベントリファレンスです。イベント定義は WebSocket アクセスを基準としています。AOQ と WebRTC は、それぞれのデータチャネルでモデルイベントを送受信し、メディアトラックでメディアを転送します。最初に WebSocket アクセス、WebRTC アクセス、または AOQ アクセスをお読みください。
WebSocket SDK の使用方法は、Python SDKと Java SDKをご覧ください。モデルとプロトコルの選択は、概要をご覧ください。

error

サーバーエラーです。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。値は常にerrorです。errorobjectエラーの詳細。

プロパティ

typestringエラーの種類。codestringエラーコード。messagestringエラーメッセージ。paramstringエラーに関連付けられたパラメーター、 session.modalities など。
{
  "event_id": "event_RoUu4T8yExPMI37GKwaOC",
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_value",
    "message": "Invalid modalities: ['audio']. Supported combinations are: ['text'] and ['audio', 'text'].",
    "param": "session.modalities"
  }
}

session.created

クライアントの接続時に返されます。デフォルトのセッション設定を含みます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に session.created です。sessionobjectセッション構成。

プロパティ

objectstringこの値は常に realtime.session です。modelstring使用するモデル。modalitiesarrayモデルの出力モダリティ。voicestringモデルが生成する音声の声。input_audio_formatstring入力音声形式。pcm のみをサポートします(サンプリングレート 16 kHz)。output_audio_formatstring出力音声形式。pcm のみをサポートします(サンプリングレート 24 kHz)。input_audio_transcriptionobject文字起こしの設定。

プロパティ

modelstring文字起こしモデル。常に qwen3-asr-flash-realtime で、設定できません。
turn_detectionobject音声アクティビティ検出(VAD)の設定。

プロパティ

typestringVAD の種類。有効値は server_vad(デフォルト)、semantic_vad、semantic_vad_ec です。semantic_vad_ec は Qwen3.8-Omni-Flash-Realtime シリーズでサポートします。クライアントイベントをご覧ください。thresholdfloatVAD の検出しきい値。silence_duration_msinteger発話終了の検出を開始する無音時間(ms)。idle_timeout_msintegerアイドルタイムアウト(ミリ秒)。qwen3.5-omni-plus-realtime または qwen3.5-omni-flash-realtime の server_vad モードでのみ返されます。
enable_searchbooleanWeb 検索を有効にするかどうかです。Qwen3.8-Omni-Flash-Realtime と Qwen3.5-Omni-Realtime がサポートします。search_optionsobjectWeb 検索のオプション。temperaturefloatモデルの temperature パラメーター。
以下は北京リージョンの qwen3.8-omni-flash-realtime が返すデフォルトセッションの例です。
{
    "event_id": "event_QQubXbhHMyXmKaSuE6PQ8",
    "type": "session.created",
    "session": {
        "input_audio_format": "pcm",
        "input_audio_transcription": {
            "model": "qwen3-asr-flash-realtime"
        },
        "id": "sess_MjEctgJ4ziXPEioCzSSvK",
        "object": "realtime.session",
        "modalities": [
            "text",
            "audio"
        ],
        "turn_detection": {
            "type": "server_vad",
            "silence_duration_ms": 800,
            "interrupt_response": true,
            "create_response": true,
            "threshold": 0.5,
            "prefix_padding_ms": 300
        },
        "model": "qwen3.8-omni-flash-realtime",
        "voice": "Tina",
        "output_audio_format": "pcm"
    }
}

session.updated

session.update リクエストが成功した後に返され、失敗した場合は代わりに error イベントが返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に session.updated です。sessionobjectセッション構成。

プロパティ

temperaturefloatモデルの temperature パラメーター。modalitiesarrayモデルの出力モダリティ。voicestringモデルが生成する音声の声。instructionsstringモデルの目標と役割。input_audio_formatstring入力音声形式。pcm のみをサポートします(サンプリングレート 16 kHz)。output_audio_formatstring出力音声形式。pcm のみをサポートします(サンプリングレート 24 kHz)。input_audio_transcriptionobject文字起こしの設定。

プロパティ

modelstring文字起こしモデル。常に qwen3-asr-flash-realtime で、設定できません。
turn_detectionobject音声アクティビティ検出(VAD)の設定。

プロパティ

typestringVAD の種類。有効値は server_vad(デフォルト)、semantic_vad、semantic_vad_ec です。semantic_vad_ec は Qwen3.8-Omni-Flash-Realtime シリーズでサポートします。クライアントイベントをご覧ください。thresholdfloatVAD の検出しきい値。silence_duration_msinteger発話終了の検出を開始する無音時間(ms)。idle_timeout_msintegerアイドルタイムアウト(ミリ秒)。qwen3.5-omni-plus-realtime または qwen3.5-omni-flash-realtime の server_vad モードでのみ返されます。
enable_searchboolean (任意)Web 検索を有効にするかどうかです。Qwen3.8-Omni-Flash-Realtime と Qwen3.5-Omni-Realtime がサポートします。search_optionsobject (任意)ウェブ検索のオプション。toolsarray (任意)ツールの定義。以下のプロパティは、type="function" の Function Calling ツールを説明します。Qwen3.8-Omni-Flash-Realtime の MCP フィールドは、クライアントのツール設定をご覧ください。MCP エンドポイントと認証情報は session.updated には返されません。
typestring (必須)この値は常に function です。function.namestring (必須)get_current_weather や get_current_time などの関数名です。function.descriptionstring (任意)関数の目的の説明。モデルはこの説明を基に、関数を呼び出すかどうかを判断します。function.parametersobject (任意)入力パラメーターのスキーマ。モデルはこれを使用してパラメーターを抽出します。関数にパラメーターがない場合は省略します。
typestring (必須)この値は常に object です。propertiesobject (任意)各キーはパラメーター名で、type と description を持つオブジェクトにマッピングされます。requiredarray (任意)必須の入力パラメーターを指定します。
top_pfloatnucleus sampling の確率しきい値。top_kinteger生成時のサンプリング候補集合のサイズ。max_tokensintegerこのリクエストでモデルが返せる最大トークン数。repetition_penaltyfloat生成時の連続する系列での繰り返しを制御します。presence_penaltyfloat生成内容の繰り返しを制御します。seedintegerリクエストごとのモデル出力の一貫性の度合い。
以下の例では、北京リージョンの qwen3.8-omni-flash-realtime を使用し、出力をテキストのみに設定して max_tokens=32 を指定しています。
{
    "event_id": "event_TSBGI9Yj5ecCKjiGO34VB",
    "type": "session.updated",
    "session": {
        "id": "sess_MjEctgJ4ziXPEioCzSSvK",
        "object": "realtime.session",
        "model": "qwen3.8-omni-flash-realtime",
        "modalities": [
            "text"
        ],
        "instructions": "请只回复 OK。",
        "voice": "Tina",
        "input_audio_format": "pcm",
        "output_audio_format": "pcm",
        "input_audio_transcription": {
            "model": "qwen3-asr-flash-realtime"
        },
        "max_tokens": 32
    }
}

input_audio_buffer.speech_started

VAD モードでは、サーバーがオーディオバッファー内で発話開始を検出したときに返されます。
発話が検出される前にオーディオがバッファーに追加されるたびにトリガーされることがあります。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に input_audio_buffer.speech_started です。audio_start_msintegerオーディオバッファーへの書き込み開始から、最初の発話が検出されるまでの時間 (ミリ秒) です。item_idstring発話終了が検出されたときに作成されるユーザーメッセージアイテムの ID です。
ユーザーメッセージアイテムは、モデル推論のためにユーザー入力を会話履歴に追加します。
{
    "event_id": "event_Pvp8nEhsQuGCQbFJ9x58n",
    "type": "input_audio_buffer.speech_started",
    "audio_start_ms": 3647,
    "item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}

input_audio_buffer.speech_stopped

VAD モードでは、サーバーがオーディオバッファー内で発話終了を検出したときに返されます。 また、対応するユーザーメッセージアイテムを含む conversation.item.created イベントを返します。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に input_audio_buffer.speech_stopped です。audio_end_msinteger会話の開始から発話終了が検出されるまでの時間 (ミリ秒) です。item_idstring作成されるユーザーメッセージアイテムの ID です。
{
    "event_id": "event_UhQiqNVRsgUiq4KUS5Xb5",
    "type": "input_audio_buffer.speech_stopped",
    "audio_end_ms": 4453,
    "item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}

input_audio_buffer.committed

入力オーディオバッファーがコミットされたときに返されます。
  • VAD モードでは、サーバーは発話終了を検出すると自動的にバッファーをコミットします。
  • 手動モードでは、クライアントが input_audio_buffer.commit イベントを送信した後に返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に input_audio_buffer.committed です。item_idstring作成されるユーザーメッセージアイテムの ID です。
{
    "event_id": "event_Iy6sUzL1nmdFgshFYxJEz",
    "type": "input_audio_buffer.committed",
    "item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}

input_audio_buffer.cleared

クライアントが input_audio_buffer.clear イベントを送信した後に返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に input_audio_buffer.cleared です。
{
  "event_id": "event_RoUu4T8yExPMI37GKwaOC",
  "type": "input_audio_buffer.cleared"
}

conversation.item.created

対話項目の作成時に返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントの種類。常に conversation.item.created です。response_idstring (条件付き必須)item.type が mcp_approval_request の場合のみ返されます。MCP 呼び出しを生成した親 Response を識別します。item_idstring (条件付き必須)item.type が mcp_approval_request の場合のみ返されます。承認項目の ID で、item.id と同じです。previous_item_idstring (条件付き必須)item.type が mcp_approval_request の場合のみ返されます。承認対象の mcp_call 項目を識別します。itemobject追加する対話項目。

プロパティ

idstring対話項目の一意の ID。objectstringmessage と function_call の項目では、このフィールドは realtime.item です。MCP 項目でも、返される場合は同じ値です。statusstring返される場合、対話項目の状態を示します。初期の mcp_call 項目では必須で、値は in_progress です。rolestringメッセージ項目にのみ存在し、メッセージの役割を識別します。contentarray of objectsメッセージの内容。種類が message の場合に返されます。次のフィールドは、この例の配列要素を説明します。

配列の要素

typestringコンテンツパートの種類。この例では input_audio です。
typestring対話項目の種類には message と function_call があります。Qwen3.8-Omni-Flash-Realtime は mcp_list_tools、mcp_call、mcp_approval_request も返します。MCP 項目の例をご覧ください。namestring種類が function_call の場合に呼び出す関数の名前。call_idstringtype が function_call の場合、関数呼び出しの一意の ID です。argumentsstringtype が function_call の場合、関数呼び出しの引数を JSON 文字列として含みます。

type=mcp_list_tools

この項目の種類では、item.id はツール検出状態イベントの item_id と一致します。server_labelstring (必須)MCP サーバーを識別します。toolsarray of objects (必須)allowed_tools によるフィルター後の検証済みツール定義。検出失敗時は空です。

配列の要素

namestring (必須)元のツール名。英字、数字、アンダースコア、ピリオド、ハイフンを使用し、1~64 文字です。descriptionstring (任意)MCP サーバーが提供するツールの説明。input_schemaobject (必須)MCP サーバーが提供する JSON Schema。サービスは JSON Schema の意味を完全には検証しません。最終的な引数の検証は MCP サーバーが行います。

プロパティ

typestring (必須)ルート値は object にする必要があります。propertiesobject (任意)各パラメーターを独自の名前で列挙します。たとえば、mcp_list_tools の例の city はパラメーター名で、その type と description はデータ型と用途を説明します。各パラメーターの JSON Schema は MCP サーバーが定義します。requiredarray of strings (任意)必須パラメーターの名前。additionalProperties、$defs、oneOf、anyOf、allOf などのその他の標準 JSON Schema フィールドは、元のスキーマからそのまま渡されます。
annotationsobject (任意)MCP サーバーが提供する ToolAnnotations。次の MCP 標準ヒントフィールドは任意です。返すフィールドはサーバーが決定します。

プロパティ

titlestring (任意)ツールの表示名。readOnlyHintboolean (任意)ツールが読み取り専用かどうかを示すヒント。destructiveHintboolean (任意)ツールが破壊的な変更を行う可能性を示すヒント。idempotentHintboolean (任意)繰り返し呼び出しても追加の効果がないかどうかを示すヒント。openWorldHintboolean (任意)ツールが外部システムとやり取りする可能性を示すヒント。これらはヒントであり、安全性の保証として使用してはいけません。
errorobject (任意)検出失敗時に返されます。

プロパティ

typestring (必須)tool_execution_error にする必要があります。messagestring (必須)上流レスポンスの機密情報を含まない、クライアントに提示可能な説明。

type=mcp_call(初期項目)

objectstring (必須)realtime.item にする必要があります。statusstring (必須)初期値は in_progress。server_labelstring (必須)ツールを実行する MCP サーバーを識別します。namestring (必須)元のツール名。call_idstring (必須)この呼び出しの一意の ID。argumentsstring (必須)通常、初期状態では空です。完全な引数は、後続のイベントと最終項目を使用してください。

type=mcp_approval_request

応答時は、この承認項目の item.id を変更せず approval_request_id にコピーします。server_labelstring (必須)承認待ちツールの MCP サーバーを識別します。namestring (必須)承認待ちツールの元の名前。argumentsstring (必須)承認待ちの引数の完全な JSON 文字列。call_idstring (必須)承認待ち呼び出しの ID。
例:
{
    "event_id": "event_JEfkrr9gO3Ny7Xcv9bGVd",
    "type": "conversation.item.created",
    "item": {
        "id": "item_YbAiGvK2H7YaS34o4R6Ba",
        "object": "realtime.item",
        "type": "message",
        "status": "in_progress",
        "role": "assistant",
        "content": [
            {
                "type": "input_audio"
            }
        ]
    }
}
// Tool calling scenario
{
    "event_id": "event_S1hkaIQgcuQD8OEdOpGHQ",
    "type": "conversation.item.created",
    "item": {
        "id": "item_FEG9qJGNkPcdf4et3p7BV",
        "object": "realtime.item",
        "type": "function_call",
        "status": "in_progress",
        "call_id": "call_bc0a7fb7235840f69ecfe4",
        "name": "get_current_weather",
        "arguments": ""
    }
}

conversation.item.input_audio_transcription.delta

入力音声の文字起こしが有効な場合、ユーザーの発話中に頻繁に送信されます。リアルタイムの中間文字起こしを返します。任意の時点で文全体の最新プレビューを得るには、text + stash を連結します。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に conversation.item.input_audio_transcription.delta です。item_idstring関連する対話項目の ID。content_indexinteger音声を含むコンテンツパートのインデックスです。textstring確定済みのテキストのプレフィックス。モデルが確定し、今後変更しない部分。stashstring暫定テキストのサフィックス。確定部分の後に続く仮の内容で、修正される可能性があります。languagestring認識した音声で検出された言語。emotionstring認識された音声から検出された感情。有効な値: neutral、 happy、 sad、 angry、 surprised、 disgusted、 fearful。
{
    "event_id": "event_C7jzoeSFuiwOZS6tR14yx",
    "type": "conversation.item.input_audio_transcription.delta",
    "item_id": "item_ThVYhLHOdeXb4bBSvzSFF",
    "content_index": 0,
    "text": "",
    "stash": "How is the weather today?",
    "language": "en",
    "emotion": "neutral",
    "obfuscation": "ABEXGYmxdmc97u"
}
任意の時点で文全体の最新プレビューを得るには、次の 2 つのフィールドを連結します。リアルタイムプレビュー = text + stash。
ユーザーが「The weather is nice today, sunny and warm.」と話しているとします。受信する可能性があるイベントストリームと、その解釈を次に示します。

時間

ユーザーの発話の進行状況

API 応答 (text と stash)

クライアント UI 表示 (text + stash)

T1

「天気は...」

text: ""

stash: "天気"

天気は

T2

「...良いですね...」

text: ""

stash: "天気は良いですね"

天気は良いですね

T3

「...今日は、」

text: "天気は"

stash: "良いですね今日は、"

天気は良いですね今日は、

(「天気は」が確定し、text に移動しました)

T4

(短い間)

text: "天気は良いですね今日は、"

stash: ""

天気は良いですね今日は、

(最初の句が完全に確定しました)

T5

「晴れていて...」

text: "天気は良いですね今日は、"

stash: "sunny"

今日は天気が良く、晴れです。

T6

「...そして暖かいです。」

text: "天気は良いですね今日は、"

stash: "晴れていて暖かいです。"

天気は良いですね今日は、晴れていて暖かいです。

T7

(発話停止)

-

最終結果として conversation.item.input_audio_transcription.completed の文字起こしを使用します。

conversation.item.input_audio_transcription.completed

ユーザーの音声が、組み込みの音声認識モデル (qwen3-asr-flash-realtime) によって文字起こしされたことを示します。設定不可。
音声認識モデルによる文字起こしテキストは、Qwen-Omni-Realtime モデルによって生成された解釈と異なる場合があります。この文字起こしは参照用です。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に conversation.item.input_audio_transcription.completed です。item_idstringユーザーメッセージアイテムの ID です。content_indexintegerこの値は常に 0 です。transcriptstring文字起こしされたテキストです。
{
    "event_id": "event_FrrZcxiDfTB9LD9p4pVng",
    "type": "conversation.item.input_audio_transcription.completed",
    "item_id": "item_YbAiGvK2H7YaS34o4R6Ba",
    "content_index": 0,
    "transcript": "Hello."
}

conversation.item.input_audio_transcription.failed

入力音声の文字起こしが有効な状態でこれに失敗した場合に返されます。error イベントとは独立しているため、クライアントは文字起こしの失敗を具体的に特定できます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に conversation.item.input_audio_transcription.failed です。item_idstringユーザーメッセージアイテムの ID です。content_indexintegerこの値は常に 0 です。errorobjectエラー情報です。

プロパティ

code stringエラーコード。message stringエラーメッセージ。param stringエラーに関連するパラメーターです。
{
  "type": "conversation.item.input_audio_transcription.failed",
  "item_id": "<item_id>",
  "content_index": 0,
  "error": {
    "code": "<code>",
    "message": "<message>",
    "param": "<param>"
  }
}

response.created

サーバーが新しいレスポンスの生成を開始すると返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.created です。responseobjectレスポンスオブジェクト。

プロパティ

id string応答の一意の ID です。conversation_id string現在のセッションの一意の ID。object stringオブジェクトの種類。このイベントでは常に realtime.response です。status stringレスポンスの状態。有効値は completed, failed, in_progress, or incomplete です。modalities arrayレスポンスのモダリティ。voice stringモデルが生成する音声の声。output arrayこのイベントでは、このフィールドは空です。
{
    "event_id": "event_XuDavMzQN3KKepqGu3KRh",
    "type": "response.created",
    "response": {
        "id": "resp_HaVOPdbmX6vifiV5pAfJY",
        "object": "realtime.response",
        "conversation_id": "conv_FjJaccpnvwHNo9cPVuzGc",
        "status": "in_progress",
        "modalities": [
            "text",
            "audio"
        ],
        "voice": "Cherry",
        "output_audio_format": "pcm",
        "output": []
    }
}

response.done

応答が完全に生成された後に返されます。response オブジェクトには、raw 音声データを除くすべての出力項目が含まれます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.done です。responseobjectレスポンスオブジェクト。

プロパティ

id string応答の一意の ID です。conversation_id string現在のセッションの一意の ID。object stringオブジェクトの種類。このイベントでは常に realtime.response です。status stringレスポンスのステータス。modalities arrayレスポンスのモダリティ。voice stringモデルが生成する音声の声。output arrayレスポンスの出力項目。各配列要素は対話項目のオブジェクトです。

配列の要素

id stringレスポンス出力の ID。type string出力項目の種類。値には message と function_call があります。Qwen3.8-Omni-Flash-Realtime は mcp_call もサポートします。MCP 項目の例をご覧ください。object stringmessage と function_call の項目では、このフィールドは realtime.item です。MCP 項目でも、返される場合は同じ値です。status string出力項目のステータス。role stringメッセージ項目にのみ存在し、メッセージの役割を識別します。content array出力項目の内容。type が message の場合のみ返されます。各配列要素はコンテンツパートのオブジェクトです。

配列の要素

type stringコンテンツタイプ。値は、プレーンテキスト出力の場合は text、オーディオ出力の場合は audio です。text string出力テキスト。transcript string音声の文字起こしテキスト。
name string種類が function_call の場合に呼び出す関数の名前。call_id stringtype が function_call の場合、関数呼び出しの一意の ID です。arguments stringtype が function_call の場合、関数呼び出しの完全な引数を JSON 文字列として含みます。

type=mcp_call(最終項目)

statusstring (必須)completed または failed。server_labelstring (必須)ツールを実行した MCP サーバーを識別します。namestring (必須)元のツール名。call_idstring (必須)この呼び出しの一意の ID。argumentsstring (必須)引数の完全な JSON 文字列。outputstring (任意)MCP の tools/call.result をシリアライズした JSON 文字列。一部の失敗時にも存在する場合があります。errorobject (任意)失敗時に返されます。

プロパティ

typestring (必須)tool_execution_error にする必要があります。messagestring (必須)上流レスポンスの機密情報を含まない、クライアントに提示可能な説明。
MCP サーバーが isError=true を返した場合、最終状態は failed となり、元の output も含まれる場合があります。
usage objectこのレスポンスのトークン使用量の詳細。
total_tokens integerこのレスポンスで使用した合計トークン数。input_tokens integer入力トークン数。output_tokens integer出力トークン数。input_tokens_details objecttext_tokens と audio_tokens を含む入力トークン使用量の詳細。output_tokens_details objecttext_tokens と audio_tokens を含む出力トークン使用量の詳細。plugins object (任意)プラグインの使用量メトリック。Web 検索 (enable_search) が有効な場合に返されます。
search object検索の計量データ。
count integer検索回数。strategy string検索戦略。
例:
{
    "event_id": "event_CSaxRRYLvbrfexDXAEuDG",
    "type": "response.done",
    "response": {
        "id": "resp_HaVOPdbmX6vifiV5pAfJY",
        "object": "realtime.response",
        "conversation_id": "conv_FjJaccpnvwHNo9cPVuzGc",
        "status": "completed",
        "modalities": [
            "text",
            "audio"
        ],
        "voice": "Cherry",
        "output_audio_format": "pcm",
        "output": [
            {
                "id": "item_Ls6MtCUWO7LM4E59QziNv",
                "object": "realtime.item",
                "type": "message",
                "status": "completed",
                "role": "assistant",
                "content": [
                    {
                        "type": "audio",
                        "transcript": "Hello! How can I help you?"
                    }
                ]
            }
        ],
        "usage": {
            "total_tokens": 377,
            "input_tokens": 336,
            "output_tokens": 41,
            "input_tokens_details": {
                "text_tokens": 228,
                "audio_tokens": 108
            },
            "output_tokens_details": {
                "text_tokens": 9,
                "audio_tokens": 32
            },
            "plugins": {
                "search": {
                    "count": 1,
                    "strategy": "agent"
                }
            }
        }
    }
}
// Tool calling scenario
{
    "event_id": "event_T1EFAJp43X2DWtDRmxTtx",
    "type": "response.done",
    "response": {
        "id": "resp_TucN5QgymL5MA8vkJvFlS",
        "object": "realtime.response",
        "conversation_id": "conv_SEDZESRlefT8WvLSmEn6E",
        "status": "completed",
        "modalities": ["text", "audio"],
        "voice": "Ethan",
        "output_audio_format": "pcm",
        "output": [
            {
                "id": "item_FEG9qJGNkPcdf4et3p7BV",
                "object": "realtime.item",
                "type": "function_call",
                "status": "completed",
                "call_id": "call_bc0a7fb7235840f69ecfe4",
                "name": "get_current_weather",
                "arguments": " {\"location\": \"Hangzhou\"}"
            }
        ],
        "usage": {
            "total_tokens": 567,
            "input_tokens": 524,
            "output_tokens": 43,
            "input_tokens_details": {
                "text_tokens": 487,
                "audio_tokens": 37
            },
            "output_tokens_details": {
                "text_tokens": 43
            }
        }
    }
}

response.text.delta

出力モダリティがテキストのみで、モデルが新しいテキストを増分的に生成するときに返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常にresponse.text.deltaです。deltastringモデルによって生成された増分テキストです。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。この値は常に 0 です。content_indexinteger出力アイテム内の内部パートのインデックスです。この値は常に 0 です。
{
    "delta": "Hello",
    "event_id": "event_TH49MauuPmRo1RGaMSlP7",
    "type": "response.text.delta",
    "response_id": "resp_PrRSvPVpnCExdUOGHHLuP",
    "item_id": "item_L8IRm9kRXFpxoOjDqDC96",
    "output_index": 0,
    "content_index": 0
}

response.text.done

出力モダリティがテキストのみで、モデルがテキストの生成を終了したときに返されます。
応答が中断、不完全、またはキャンセルされた場合にも返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.text.done です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。content_indexinteger応答内の出力アイテムのインデックスです。text stringモデルによって生成された完全なテキストです。
{
  "event_id": "event_B1lIeE2Nac33zn5V7h2mm",
  "type": "response.text.done",
  "response_id": "resp_B1lIdtjF4Noqpn5NOjznj",
  "item_id": "item_B1lIdJsAJlJiFs8ztWpJt",
  "output_index": 0,
  "content_index": 0,
  "text": "How can I assist you today?"
}

response.audio.delta

WebSocket アクセスでは、出力モダリティに音声が含まれ、モデルが新しい音声データを逐次生成すると、サーバーがこのイベントを返します。WebRTC アクセスでは、音声は RTP 音声トラックで転送され、このイベントは返されません。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.audio.delta です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。content_indexinteger応答内の出力アイテムのインデックスです。delta string増分オーディオデータ、Base64 エンコードされています。
{
  "event_id": "event_B1osWMZBtrEQbiIwW0qHQ",
  "type": "response.audio.delta",
  "response_id": "resp_P79OOMs8LnrXVpiIHUCKR",
  "item_id": "item_OFaPGtzfWCPyGzxnuEX9i",
  "output_index": 0,
  "content_index": 0,
  "delta": "{base64 audio}"
}

response.audio.done

出力モダリティにオーディオが含まれ、モデルがオーディオデータの生成を終了したときに返されます。
応答が中断、不完全、またはキャンセルされた場合にも返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.audio.done です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。content_indexinteger応答内の出力アイテムのインデックスです。
{
    "event_id": "event_Le1TDl7VfyHQxl47DtGxI",
    "type": "response.audio.done",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "item_id": "item_Ls6MtCUWO7LM4E59QziNv",
    "output_index": 0,
    "content_index": 0
}

response.audio_transcript.delta

出力モダリティにオーディオが含まれ、モデルが新しい response.audio_transcript.delta トランスクリプトテキストを増分的に生成する場合に返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.audio_transcript.delta です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。content_indexinteger応答内の出力アイテムのインデックスです。deltastring増分テキストです。
{
    "event_id": "event_BksW7fOwnyavZdDxIzZYM",
    "type": "response.audio_transcript.delta",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "item_id": "item_Ls6MtCUWO7LM4E59QziNv",
    "output_index": 0,
    "content_index": 0,
    "delta": "What"
}

response.audio_transcript.done

出力モダリティに音声が含まれ、モデルが音声文字起こしを完了すると、response.audio_transcript.done イベントとして返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.audio_transcript.done です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。content_indexinteger応答内の出力アイテムのインデックスです。transcriptstring完全な文字起こしテキストです。
{
    "event_id": "event_X49tL2WerT4WjxcmH16lS",
    "type": "response.audio_transcript.done",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "item_id": "item_Ls6MtCUWO7LM4E59QziNv",
    "output_index": 0,
    "content_index": 0,
    "transcript": "Hello! How can I help you?"
}

response.function_call_arguments.delta

モデルが関数呼び出しの引数をストリーミングする際に返されます。delta フィールドを連結して、引数文字列を構築します。完全なコンテンツは、後続の response.function_call_arguments.done イベントで提供されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に response.function_call_arguments.delta です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。call_idstringこの関数呼び出しの一意の ID です。この ID は、同じターン内の done イベントと一致します。deltastring引数文字列の新しいセグメントです。セグメントを順番に連結します。
{
    "event_id": "event_SlKoJyEbPEqLq14DSM1u5",
    "type": "response.function_call_arguments.delta",
    "response_id": "resp_JnTOsWXlFhKcFohZbtfz6",
    "item_id": "item_Rhcms7CauTNsQprV5S4Hr",
    "output_index": 0,
    "call_id": "call_2be200f4cafe419b9530dd",
    "delta": " {\"location\": \"Beijing\"}"
}

response.function_call_arguments.done

関数呼び出しの引数生成が完了したことを示します。arguments フィールドに完全な引数文字列が含まれます。ローカル関数の解析と呼び出しには、delta の連結結果ではなく、このイベントの arguments を使用してください。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプです。この値は常に response.function_call_arguments.done です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。call_idstringこの関数呼び出しの一意の ID。namestring呼び出した関数の名前。argumentsstring関数呼び出しの完全な引数(JSON 文字列)。
{
    "event_id": "event_X6suLyuL5agdH7r6koesM",
    "type": "response.function_call_arguments.done",
    "response_id": "resp_JnTOsWXlFhKcFohZbtfz6",
    "item_id": "item_Rhcms7CauTNsQprV5S4Hr",
    "output_index": 0,
    "name": "get_current_weather",
    "call_id": "call_2be200f4cafe419b9530dd",
    "arguments": " {\"location\": \"Beijing\"}"
}

response.output_item.added

レスポンス生成中に新しい項目が作成されると返されます。項目の種類は message または function_call です。Qwen3.8-Omni-Flash-Realtime は mcp_call もサポートします。MCP 項目の例をご覧ください。
event_idstringこのイベントの一意の識別子です。typestringイベントの種類。常に response.output_item.added です。response_idstring応答 ID です。output_indexinteger応答内の出力アイテムのインデックスです。itemobject出力項目の情報。

プロパティ

idstring出力項目の一意の ID。objectstringmessage と function_call の項目では、このフィールドは realtime.item です。MCP 項目でも、返される場合は同じ値です。statusstring出力項目の状態。rolestringメッセージ項目にのみ存在し、メッセージの役割を識別します。contentarrayメッセージの内容。種類が message の場合に返されます。この例では配列は最初は空です。完成した項目は response.output_item.done の例をご覧ください。typestring出力項目の種類。値には message と function_call があります。Qwen3.8-Omni-Flash-Realtime は mcp_call もサポートします。MCP 項目の例をご覧ください。namestringtype が function_call の場合に呼び出す関数の名前。call_idstring種類が function_call の場合の、現在の関数呼び出しの一意の ID。argumentsstringtype が function_call の場合、関数呼び出しの引数は JSON 文字列になります。added イベントでは、最初は空の文字列です。

type=mcp_call(初期項目)

objectstring (必須)realtime.item にする必要があります。statusstring (必須)初期値は in_progress。server_labelstring (必須)ツールを実行する MCP サーバーを識別します。namestring (必須)元のツール名。call_idstring (必須)この呼び出しの一意の ID。argumentsstring (必須)通常、初期状態では空です。完全な引数は response.mcp_call_arguments.done と最終項目を使用してください。
{
    "event_id": "event_DsCO341DEVtiATtCB6BUY",
    "type": "response.output_item.added",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "output_index": 0,
    "item": {
        "id": "item_Ls6MtCUWO7LM4E59QziNv",
        "object": "realtime.item",
        "type": "message",
        "status": "in_progress",
        "role": "assistant",
        "content": []
    }
}
// Tool calling scenario
{
    "event_id": "event_HXmKt5pGoiRtXx7Hq7zpN",
    "type": "response.output_item.added",
    "response_id": "resp_TucN5QgymL5MA8vkJvFlS",
    "output_index": 0,
    "item": {
        "id": "item_FEG9qJGNkPcdf4et3p7BV",
        "object": "realtime.item",
        "type": "function_call",
        "status": "in_progress",
        "call_id": "call_bc0a7fb7235840f69ecfe4",
        "name": "get_current_weather",
        "arguments": ""
    }
}

response.output_item.done

出力項目の生成が完了したときに返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.output_item.done です。response_idstring応答 ID です。output_indexinteger応答内の出力アイテムのインデックスです。itemobject出力アイテム情報です。

プロパティ

idstring出力項目の一意の ID。objectstringmessage と function_call の項目では、このフィールドは realtime.item です。MCP 項目でも、返される場合は同じ値です。statusstring出力項目の状態。rolestringメッセージ項目にのみ存在し、メッセージの役割を識別します。contentarray of objectsメッセージの内容。種類が message の場合に返されます。次のフィールドは、この例の配列要素を説明します。

配列の要素

typestringコンテンツパートの種類。この例では audio です。textstringこの例のテキスト内容。
typestring出力項目の種類。値には message と function_call があります。Qwen3.8-Omni-Flash-Realtime は mcp_call もサポートします。MCP 項目の例をご覧ください。namestring種類が function_call の場合に呼び出す関数の名前。call_idstringtype が function_call の場合、関数呼び出しの一意の ID です。argumentsstringtype が function_call の場合、関数呼び出しの完全な引数を JSON 文字列として含みます。

type=mcp_call(最終項目)

statusstring (必須)completed または failed。server_labelstring (必須)ツールを実行した MCP サーバーを識別します。namestring (必須)元のツール名。call_idstring (必須)この呼び出しの一意の ID。argumentsstring (必須)引数の完全な JSON 文字列。outputstring (任意)MCP の tools/call.result をシリアライズした JSON 文字列。一部の失敗時にも存在する場合があります。errorobject (任意)失敗時に返されます。

プロパティ

typestring (必須)tool_execution_error にする必要があります。messagestring (必須)上流レスポンスの機密情報を含まない、クライアントに提示可能な説明。
MCP サーバーが isError=true を返した場合、最終状態は failed となり、元の output も含まれる場合があります。
{
    "event_id": "event_MEu5nlLw1LsOguHiehIP8",
    "type": "response.output_item.done",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "output_index": 0,
    "item": {
        "id": "item_Ls6MtCUWO7LM4E59QziNv",
        "object": "realtime.item",
        "type": "message",
        "status": "completed",
        "role": "assistant",
        "content": [
            {
                "type": "audio",
                "text": "Hello! How can I help you?"
            }
        ]
    }
}
// Tool calling scenario
{
    "event_id": "event_FHspdfAnCyjuME3mmAwSY",
    "type": "response.output_item.done",
    "response_id": "resp_TucN5QgymL5MA8vkJvFlS",
    "output_index": 0,
    "item": {
        "id": "item_FEG9qJGNkPcdf4et3p7BV",
        "object": "realtime.item",
        "type": "function_call",
        "status": "completed",
        "call_id": "call_bc0a7fb7235840f69ecfe4",
        "name": "get_current_weather",
        "arguments": " {\"location\": \"Hangzhou\"}"
    }
}

response.content_part.added

応答生成中にアシスタントメッセージアイテムに新しいコンテンツパートが追加されたときに返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.content_part.added です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。この値は常に 0 です。content_indexinteger出力アイテム内の内部パートのインデックスです。この値は常に 0 です。partobject出力アイテム情報です。

プロパティ

typestringコンテンツパートの種類。textstringコンテンツパートのテキスト。
{
    "event_id": "event_AVBOmrgY3C8bjlRajfSUT",
    "type": "response.content_part.added",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "item_id": "item_Ls6MtCUWO7LM4E59QziNv",
    "output_index": 0,
    "content_index": 0,
    "part": {
        "type": "audio",
        "text": ""
    }
}

response.content_part.done

アシスタントメッセージアイテム内のコンテンツパートのストリーミングが終了したときに返されます。
event_idstringこのイベントの一意の識別子です。typestringイベントタイプ。この値は常に response.content_part.done です。response_idstring応答 ID です。item_idstringメッセージアイテム ID です。output_indexinteger応答内の出力アイテムのインデックスです。この値は常に 0 です。content_indexintegerコンテンツ配列内のコンテンツパートのインデックスです。この値は常に 0 です。partobject出力アイテム情報です。

プロパティ

typestringコンテンツパートの種類。textstringコンテンツパートのテキスト。
{
    "event_id": "event_Il8HD19v58Qr5IBkw7LtN",
    "type": "response.content_part.done",
    "response_id": "resp_HaVOPdbmX6vifiV5pAfJY",
    "item_id": "item_Ls6MtCUWO7LM4E59QziNv",
    "output_index": 0,
    "content_index": 0,
    "part": {
        "type": "audio",
        "text": "Hello! How can I help you?"
    }
}

MCP イベント

このセクションは、qwen3.8-omni-flash-realtime の WebSocket イベントとフィールドを説明します。その他の基本イベントとフィールドは、上記の共通プロトコルに従います。必須フィールドは、それを含むオブジェクトが存在する場合に必須です。ID は不透明な文字列です。長さ、プレフィックス、生成規則に依存しないでください。arguments と output は文字列で、内容の JSON 解析が必要です。MCP の接続、検出、呼び出しにはサービスのクォータとタイムアウトが適用されます。

mcp_list_tools.*

イベントの種類送信タイミング
mcp_list_tools.in_progressMCP サーバーのツール検出が開始します。
mcp_list_tools.completed検出が成功し、allowed_tools によるフィルターが完了します。
mcp_list_tools.failed検出に失敗、タイムアウト、またはサービス制限を超過します。
3 つとも、文字列フィールドの event_id(一意のイベント ID)、type(上記のイベントの種類)、item_id(関連する mcp_list_tools 項目)が必須です。in_progress は session.updated より先に届く場合があります。completed と failed では、最終ツール一覧またはエラーを含む conversation.item.created が先に届き、続いて同じ item_id の状態イベントが届きます。
{
  "event_id": "opaque_event_id",
  "type": "mcp_list_tools.completed",
  "item_id": "opaque_item_id"
}

response.mcp_call_arguments.delta

フィールド型必須意味
event_idstringはいイベントの一意の ID。
typestringはいresponse.mcp_call_arguments.delta
response_idstringはい親 Response の ID。
item_idstringはい現在の mcp_call 項目の ID。
output_indexintegerはい親 Response の出力配列内の、0 から始まるインデックス。
deltastringはいJSON 文字列の増分フラグメント。イベントの順序で連結します。
obfuscationstringいいえ任意の難読化文字列。引数の組み立てと解析では無視します。
{
  "event_id": "opaque_event_id",
  "type": "response.mcp_call_arguments.delta",
  "response_id": "opaque_response_id",
  "item_id": "opaque_item_id",
  "output_index": 0,
  "delta": "{\"city\":\"杭",
  "obfuscation": "opaque-value"
}

response.mcp_call_arguments.done

event_id、type、response_id、item_id(文字列)、output_index(整数、意味は上記と同じ)、arguments(文字列)が必須です。type は response.mcp_call_arguments.done です。arguments は完全な JSON エンコード引数を含み、正とする値です。
{
  "event_id": "opaque_event_id",
  "type": "response.mcp_call_arguments.done",
  "response_id": "opaque_response_id",
  "item_id": "opaque_item_id",
  "output_index": 0,
  "arguments": "{\"city\":\"杭州\"}"
}

response.mcp_call.*

イベントの種類送信タイミング
response.mcp_call.in_progress引数が完成し、承認が得られたか不要となったため、MCP 呼び出しが開始します。
response.mcp_call.completedMCP 呼び出しが成功します。
response.mcp_call.failed接続、プロトコル、ツールの業務エラー、承認の拒否またはタイムアウト、呼び出しのタイムアウト、またはキャンセル。
3 つとも event_id、type、item_id(文字列)と output_index(整数)が必須です。item_id は現在の mcp_call を、output_index は親 Response の出力配列内のインデックスを示します。
{
  "event_id": "opaque_event_id",
  "type": "response.mcp_call.in_progress",
  "item_id": "opaque_item_id",
  "output_index": 0
}

MCP の会話項目

これらのオブジェクトはイベントの item フィールドの型で、Qwen3.8-Omni-Flash-Realtime に適用されます。

mcp_list_tools 項目

conversation.item.created.item として返されます。フィールドは、conversation.item.created の type=mcp_list_tools 分岐をご覧ください。 例:
{
  "event_id": "opaque_event_id",
  "type": "conversation.item.created",
  "item": {
    "id": "opaque_item_id",
    "type": "mcp_list_tools",
    "server_label": "amap",
    "tools": [
      {
        "name": "maps_weather",
        "description": "查询天气",
        "input_schema": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string",
              "description": "城市名"
            }
          },
          "required": ["city"]
        }
      }
    ]
  }
}

初期 mcp_call 項目

モデルが MCP ツールを選択すると、この項目は response.output_item.added.item に現れ、conversation.item.created.item にも現れる場合があります。response.output_item.added と conversation.item.created の対応する item 分岐をご覧ください。 response.output_item.added の例:
{
  "event_id": "opaque_event_id",
  "type": "response.output_item.added",
  "response_id": "opaque_response_id",
  "output_index": 0,
  "item": {
    "id": "opaque_item_id",
    "object": "realtime.item",
    "type": "mcp_call",
    "status": "in_progress",
    "call_id": "opaque_call_id",
    "server_label": "amap",
    "name": "maps_weather",
    "arguments": ""
  }
}

mcp_approval_request 項目

conversation.item.created で返されます。イベントと承認 item のフィールドは、conversation.item.createdをご覧ください。 例:
{
  "event_id": "opaque_event_id",
  "type": "conversation.item.created",
  "response_id": "opaque_response_id",
  "item_id": "opaque_approval_id",
  "previous_item_id": "opaque_item_id",
  "item": {
    "id": "opaque_approval_id",
    "type": "mcp_approval_request",
    "server_label": "amap",
    "name": "maps_weather",
    "arguments": "{\"city\":\"杭州\"}",
    "call_id": "opaque_call_id"
  }
}

最終 mcp_call 項目

呼び出しが終端状態に達すると、項目は response.output_item.done.item と、親の最終 response.done.response.output スナップショットに現れます。response.output_item.done と response.done の対応する分岐をご覧ください。 呼び出し成功:
{
  "event_id": "opaque_event_id",
  "type": "response.output_item.done",
  "response_id": "opaque_response_id",
  "output_index": 0,
  "item": {
    "id": "opaque_item_id",
    "type": "mcp_call",
    "status": "completed",
    "call_id": "opaque_call_id",
    "server_label": "amap",
    "name": "maps_weather",
    "arguments": "{\"city\":\"杭州\"}",
    "output": "{\"content\":[{\"type\":\"text\",\"text\":\"...\"}],\"isError\":false}"
  }
}
呼び出し失敗:
{
  "event_id": "opaque_event_id",
  "type": "response.output_item.done",
  "response_id": "opaque_response_id",
  "output_index": 0,
  "item": {
    "id": "opaque_item_id",
    "type": "mcp_call",
    "status": "failed",
    "call_id": "opaque_call_id",
    "server_label": "amap",
    "name": "maps_weather",
    "arguments": "{\"city\":\"杭州\"}",
    "error": {
      "type": "tool_execution_error",
      "message": "MCP tool call failed (call_timeout)."
    }
  }
}

MCP エラー

MCP エラーは、ツール検出またはツール実行中に発生する場合があります。検出エラーは conversation.item.created の mcp_list_tools 分岐内の error、実行エラーは response.output_item.done の mcp_call 分岐をご覧ください。
Qwen-Omni-Realtime をご参照ください。