Server events for the Qwen-Omni-Realtime API, including tool calling (function calling) events.
error
Server error.
event_idstring A unique identifier for this event. typestring The event type. This value is always error. errorobject Error details. Properties typestring The error type. codestring The error code. messagestring The error message. paramstring The parameter associated with the error, such as 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
Returned when a client connects. Contains the default session configuration.
event_idstring A unique identifier for this event. typestring The event type. This value is always session.created. sessionobject The session configuration. Properties objectstring This value is always realtime.session. modelstring The model used. modalitiesarray The output modalities for the model. voicestring The voice for model-generated audio. input_audio_formatstring Input audio format. Only pcm is supported (16 kHz sample rate). output_audio_formatstring Output audio format. Only pcm is supported (24 kHz sample rate). input_audio_transcriptionobject The transcription configuration. Properties modelstring Transcription model. Always qwen3-asr-flash-realtime. Not configurable. turn_detectionobject The voice activity detection (VAD) configuration. Properties typestring The VAD type. Valid values are server_vad (default) or semantic_vad. See Client events. thresholdfloat The VAD detection threshold. silence_duration_msinteger Silence duration (ms) that triggers end-of-speech detection. idle_timeout_msinteger The idle timeout in milliseconds. Returned only in server_vad mode with qwen3.5-omni-plus-realtime or qwen3.5-omni-flash-realtime models. enable_searchboolean Whether to enable web search. Supported by Qwen3.8-Omni-Flash-Realtime and Qwen3.5-Omni-Realtime models. search_optionsobject The options for the web search. temperaturefloat The temperature parameter for the model. | The following example is the default session returned by qwen3.8-omni-flash-realtime in the Beijing region. {
"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
Returned after a successful session.update request. On failure, an error event is returned instead.
event_idstring A unique identifier for this event. typestring The event type. This value is always session.updated. sessionobject The session configuration. Properties temperaturefloat The temperature parameter for the model. modalitiesarray The output modalities for the model. voicestring The voice for model-generated audio. instructionsstring The model's goal and role. input_audio_formatstring Input audio format. Only pcm is supported (16 kHz sample rate). output_audio_formatstring Output audio format. Only pcm is supported (24 kHz sample rate). input_audio_transcriptionobject The transcription configuration. Properties modelstring Transcription model. Always qwen3-asr-flash-realtime. Not configurable. turn_detectionobject The voice activity detection (VAD) configuration. Properties typestring The VAD type. Valid values are server_vad (default) or semantic_vad. See Client events. thresholdfloat The VAD detection threshold. silence_duration_msinteger Silence duration (ms) that triggers end-of-speech detection. idle_timeout_msinteger The idle timeout in milliseconds. Returned only in server_vad mode with qwen3.5-omni-plus-realtime or qwen3.5-omni-flash-realtime models. enable_searchboolean (optional) Whether to enable web search. Supported by Qwen3.8-Omni-Flash-Realtime and Qwen3.5-Omni-Realtime models. search_optionsobject (optional) The web search options. toolsarray (optional) Tool definitions. The properties below describe Function Calling tools with type="function". See client tool configuration for Qwen3.8-Omni-Flash-Realtime MCP fields; MCP endpoints and credentials are not echoed in session.updated. Properties typestring (required) This value is always function. function.namestring (required) The function name, such as get_current_weather or get_current_time. function.descriptionstring (optional) Description of the function's purpose. The model uses this to decide whether to call the function. function.parametersobject (optional) Input parameter schema. The model uses this to extract parameters. Omit if the function takes no parameters. Properties typestring (required) This value is always object. propertiesobject (optional) Each key is a parameter name mapped to an object with type and description. requiredarray (optional) Specifies which input parameters are required. top_pfloat The probability threshold for nucleus sampling. top_kinteger Candidate set size for sampling during generation. max_tokensinteger Maximum tokens the model can return for this request. repetition_penaltyfloat Controls repetition in consecutive sequences during generation. presence_penaltyfloat Controls repetition in generated content. seedinteger The degree of consistency in the model's output per request. | The following example uses qwen3.8-omni-flash-realtime in the Beijing region, with text-only output and 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
}
}
|
In VAD mode, returned when the server detects speech onset in the audio buffer.
May be triggered each time audio is added to the buffer before speech is detected.
event_idstring A unique identifier for this event. typestring The event type. This value is always input_audio_buffer.speech_started. audio_start_msinteger Time (ms) from when audio buffer writing starts until speech is first detected. item_idstring ID of the user message item created when end-of-speech is detected.
User message items append user input to the conversation history for model inference.
| {
"event_id": "event_Pvp8nEhsQuGCQbFJ9x58n",
"type": "input_audio_buffer.speech_started",
"audio_start_ms": 3647,
"item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}
|
In VAD mode, returned when the server detects end-of-speech in the audio buffer.
Also returns a conversation.item.created event with the corresponding user message item.
event_idstring A unique identifier for this event. typestring The event type. This value is always input_audio_buffer.speech_stopped. audio_end_msinteger Time (ms) from session start until end-of-speech is detected. item_idstring The ID of the user message item that will be created. | {
"event_id": "event_UhQiqNVRsgUiq4KUS5Xb5",
"type": "input_audio_buffer.speech_stopped",
"audio_end_ms": 4453,
"item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}
|
Returned when the input audio buffer is committed.
- In VAD mode, the server automatically commits the buffer when it detects end-of-speech.
- In Manual mode, returned after the client sends an
input_audio_buffer.commit event.
event_idstring A unique identifier for this event. typestring The event type. This value is always input_audio_buffer.committed. item_idstring The ID of the user message item that will be created. | {
"event_id": "event_Iy6sUzL1nmdFgshFYxJEz",
"type": "input_audio_buffer.committed",
"item_id": "item_YbAiGvK2H7YaS34o4R6Ba"
}
|
Returned after the client sends an input_audio_buffer.clear event.
event_idstring A unique identifier for this event. typestring The event type. This value is always input_audio_buffer.cleared. | {
"event_id": "event_RoUu4T8yExPMI37GKwaOC",
"type": "input_audio_buffer.cleared"
}
|
conversation.item.created
Returned when a conversation item is created.
event_idstring A unique identifier for this event. typestring The event type. This value is always conversation.item.created. response_idstring (conditionally required) Returned only when item.type is mcp_approval_request; identifies the parent Response that generated the MCP call. item_idstring (conditionally required) Returned only when item.type is mcp_approval_request; the approval item ID, equal to item.id. previous_item_idstring (conditionally required) Returned only when item.type is mcp_approval_request; identifies the mcp_call item under review. itemobject The conversation item to add. Properties idstring The unique ID of the conversation item. objectstring For message and function_call items, this field is realtime.item. For MCP items, it has the same value when returned. statusstring When returned, this field indicates the conversation item status. An initial mcp_call item requires it with the value in_progress. rolestring Present only on message items; identifies the message role. contentarray of objects The content of the message, returned when the type is message. The following fields describe the array element in this example. Array item typestring The content-part type; input_audio in this example. typestring The conversation item type includes message and function_call. Qwen3.8-Omni-Flash-Realtime also returns mcp_list_tools, mcp_call, and mcp_approval_request; see MCP item examples. namestring The name of the function that is called when the type is function_call. call_idstring When the type is function_call, this is the unique ID of the function invocation. argumentsstring When the type is function_call, this parameter contains the arguments for the function invocation as a JSON string. type=mcp_call (initial item) objectstring (required) Must be realtime.item. statusstring (required) Initially in_progress. server_labelstring (required) Identifies the MCP server executing the tool. namestring (required) Original tool name. call_idstring (required) Unique ID of this call. argumentsstring (required) Usually empty initially; use later events and the final item for full arguments. type=mcp_approval_request Copy this approval item's item.id unchanged into approval_request_id when replying. server_labelstring (required) Identifies the MCP server for the pending tool. namestring (required) Original name of the pending tool. argumentsstring (required) Full JSON string of arguments awaiting approval. call_idstring (required) ID of the call awaiting approval. | Example: {
"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": ""
}
}
|
Sent frequently while the user is speaking when input audio transcription is enabled. Provides real-time intermediate transcription results. Concatenate text + stash for the most complete sentence preview at any point.
event_idstring A unique identifier for this event. typestring The event type. This value is always conversation.item.input_audio_transcription.delta. item_idstring The ID of the associated conversation item. content_indexinteger The index of the content part that contains the audio. textstring Confirmed text prefix — the portion the model has finalized and will not change. stashstring Preliminary text suffix — a temporary draft following the confirmed portion, subject to revision. languagestring The detected language of the recognized audio. emotionstring The detected emotion of the recognized audio. Valid values: 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"
}
To get the most complete sentence preview at any moment, concatenate these two fields: real-time preview = text + stash. Click to view example Suppose the user is saying: "The weather is nice today, sunny and warm." The following shows the event stream you might receive and how to interpret them: Time | User speech progress | API response (text and stash) | Client UI display (text + stash) |
|---|
T1 | "The weather..." | text: "" stash: "The weather" | The weather | T2 | "...is nice..." | text: "" stash: "The weather is nice" | The weather is nice | T3 | "...today," | text: "The weather" stash: " is nice today," | The weather is nice today, ("The weather" has been confirmed and moved to text) | T4 | (brief pause) | text: "The weather is nice today, " stash: "" | The weather is nice today, (first clause fully confirmed) | T5 | "sunny..." | text: "The weather is nice today, " stash: "sunny" | The weather is nice today, sunny | T6 | "...and warm." | text: "The weather is nice today, " stash: "sunny and warm." | The weather is nice today, sunny and warm. | T7 | (stops speaking) | - | Use the transcript from conversation.item.input_audio_transcription.completed as the final result. |
|
Indicates that the user's audio has been transcribed by the built-in speech recognition model (qwen3-asr-flash-realtime). Not configurable.
The transcribed text from the speech recognition model may differ from the interpretation generated by the Qwen-Omni-Realtime model. The transcription is for reference only.
event_idstring A unique identifier for this event. typestring The event type. This value is always conversation.item.input_audio_transcription.completed. item_idstring The ID of the user message item. content_indexinteger This value is always 0. transcriptstring The transcribed text. | {
"event_id": "event_FrrZcxiDfTB9LD9p4pVng",
"type": "conversation.item.input_audio_transcription.completed",
"item_id": "item_YbAiGvK2H7YaS34o4R6Ba",
"content_index": 0,
"transcript": "Hello."
}
|
Returned when input audio transcription is enabled and the transcription fails. Independent of the error event; helps clients identify transcription failures specifically.
event_idstring A unique identifier for this event. typestring The event type. This value is always conversation.item.input_audio_transcription.failed. item_idstring The ID of the user message item. content_indexinteger This value is always 0. errorobject The error information. Properties code string The error code. message string The error message. param string The parameter related to the error. | {
"type": "conversation.item.input_audio_transcription.failed",
"item_id": "<item_id>",
"content_index": 0,
"error": {
"code": "<code>",
"message": "<message>",
"param": "<param>"
}
}
|
response.created
Returned when the server starts generating a new response.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.created. responseobject The response object. Properties id string The unique ID of the response. conversation_id string The unique ID of the current session. object string The object type. For this event, this value is always realtime.response. status string The response status. Valid values are completed, failed, in_progress, or incomplete. modalities array The response modalities. voice string The voice for model-generated audio. output array This field is empty for this event. | {
"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
Returned after the response is fully generated. The response object includes all output items except raw audio data.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.done. responseobject The response object. Properties id string The unique ID of the response. conversation_id string The unique ID of the current session. object string The object type. For this event, this value is always realtime.response. status string The response status. modalities array The response modalities. voice string The voice for model-generated audio. output array The response output items. Each array element is a conversation item object. Array item id string The ID of the response output. type string The type of the output item. Values include message and function_call. Qwen3.8-Omni-Flash-Realtime also supports mcp_call; see MCP item examples. object string For message and function_call items, this field is realtime.item. For MCP items, it has the same value when returned. status string The output item status. role string Present only on message items; identifies the message role. content array The output item content, returned only when type is message. Each array element is a content-part object. Array item type string The content type. The value can be text for plain text output or audio for audio output. text string The text output. transcript string The text transcript of the audio. name string The name of the function that is invoked when the type is function_call. call_id string When the type is function_call, this is the unique ID of the function invocation. arguments string When the type is function_call, this field contains the full arguments for the function call as a JSON string. type=mcp_call (final item) statusstring (required) completed or failed.
server_labelstring (required) Identifies the MCP server that executed the tool. namestring (required) Original tool name. call_idstring (required) Unique ID of this call. argumentsstring (required) Full JSON string of arguments. outputstring (optional) A JSON string serialized from MCP tools/call.result. It may also appear in some failure cases. errorobject (optional) Returned on failure. Properties typestring (required) Must be tool_execution_error. messagestring (required) A client-safe description without sensitive upstream response content. If the MCP server returns isError=true, the final status is failed and the original output may also be present. usage object Token usage details for this response. Properties total_tokens integer Total tokens used in this response. input_tokens integer Number of input tokens. output_tokens integer Number of output tokens. input_tokens_details object Details about input token usage, including text_tokens and audio_tokens. output_tokens_details object Details about output token usage, including text_tokens and audio_tokens. plugins object (optional) Plugin usage metrics. Returned when web search (enable_search) is enabled. Properties search object Search metering data. Properties count integer The number of searches. strategy string The search strategy. | Example: {
"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
Returned when the output modality is text-only and the model generates new text incrementally.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.text.delta. deltastring Incremental text generated by the model. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. This value is always 0. content_indexinteger The index of the internal part within the output item. This value is always 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
Returned when the output modality is text-only and the model finishes generating text.
Also returned if the response is interrupted, incomplete, or canceled.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.text.done. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. content_indexinteger The index of the output item in the response. text string The full text generated by the model. | {
"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
Returned when the output modality includes audio and the model generates new audio data incrementally.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.audio.delta. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. content_indexinteger The index of the output item in the response. delta string Incremental audio data, Base64-encoded. | {
"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
Returned when the output modality includes audio and the model finishes generating audio data.
Also returned if the response is interrupted, incomplete, or canceled.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.audio.done. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. content_indexinteger The index of the output item in the response. | {
"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
Returned when the output modality includes audio and the model generates new response.audio_transcript.delta transcript text incrementally.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.audio_transcript.delta. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. content_indexinteger The index of the output item in the response. deltastring The incremental text. | {
"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
Returned as a response.audio_transcript.done event when the output modality includes audio and the model completes the audio transcript.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.audio_transcript.done. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. content_indexinteger The index of the output item in the response. transcriptstring The full transcription text. | {
"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
Returned as the model streams function call arguments. Concatenate the delta fields in order to build the argument string. The complete content is provided in the subsequent response.function_call_arguments.done event.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.function_call_arguments.delta. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. call_idstring The unique ID for this function invocation. This is consistent with the done event in the same turn. deltastring New segment of the argument string. Concatenate segments in order. | {
"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
Indicates that function call arguments are fully generated. The arguments field contains the complete argument string. Use the arguments from this event — not the concatenated delta results — to parse and call the local function.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.function_call_arguments.done. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. call_idstring The unique ID for this function invocation. namestring The name of the function that was called. argumentsstring Complete function call arguments as a JSON string. | {
"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
Returned when a new item is created during response generation. The item type can be message or function_call; Qwen3.8-Omni-Flash-Realtime also supports mcp_call; see MCP item examples.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.output_item.added. response_idstring The response ID. output_indexinteger The index of the output item in the response. itemobject Information about the output item. Properties idstring The unique ID of the output item. objectstring For message and function_call items, this field is realtime.item. For MCP items, it has the same value when returned. statusstring The status of the output item. rolestring Present only on message items; identifies the message role. contentarray The content of the message, returned when the type is message. The array is initially empty in this example; see the completed item in the response.output_item.done example. typestring The type of the output item. Values include message and function_call. Qwen3.8-Omni-Flash-Realtime also supports mcp_call; see MCP item examples. namestring The name of the function to call when the type is function_call. call_idstring The unique ID of the current function invocation when the type is function_call. argumentsstring Function call arguments as a JSON string when the type is function_call. Initially an empty string in added events. type=mcp_call (initial item) objectstring (required) Must be realtime.item. statusstring (required) Initially in_progress. server_labelstring (required) Identifies the MCP server executing the tool. namestring (required) Original tool name. call_idstring (required) Unique ID of this call. argumentsstring (required) Usually empty initially; use response.mcp_call_arguments.done and the final item for full arguments. | {
"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
Returned when an output item is fully generated.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.output_item.done. response_idstring The response ID. output_indexinteger The index of the output item in the response. itemobject The output item information. Properties idstring The unique ID of the output item. objectstring For message and function_call items, this field is realtime.item. For MCP items, it has the same value when returned. statusstring The status of the output item. rolestring Present only on message items; identifies the message role. contentarray of objects The content of the message, returned when the type is message. The following fields describe the array element in this example. Array item typestring The content-part type; audio in this example. textstring Text content in this example. typestring The type of the output item. Values include message and function_call. Qwen3.8-Omni-Flash-Realtime also supports mcp_call; see MCP item examples. namestring The name of the function that is called when the type is function_call. call_idstring When the type is function_call, this is the unique ID for the function invocation. argumentsstring When the type is function_call, contains the full function call arguments as a JSON string. type=mcp_call (final item) statusstring (required) completed or failed.
server_labelstring (required) Identifies the MCP server that executed the tool. namestring (required) Original tool name. call_idstring (required) Unique ID of this call. argumentsstring (required) Full JSON string of arguments. outputstring (optional) A JSON string serialized from MCP tools/call.result. It may also appear in some failure cases. errorobject (optional) Returned on failure. Properties typestring (required) Must be tool_execution_error. messagestring (required) A client-safe description without sensitive upstream response content. If the MCP server returns isError=true, the final status is failed and the original output may also be present. | {
"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
Returned when a new content part is added to an assistant message item during response generation.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.content_part.added. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. This value is always 0. content_indexinteger The index of the internal part within the output item. This value is always 0. partobject The output item information. Properties typestring The type of the content part. textstring The text of the content part. | {
"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
Returned when streaming of a content part within an assistant message item finishes.
event_idstring A unique identifier for this event. typestring The event type. This value is always response.content_part.done. response_idstring The response ID. item_idstring The message item ID. output_indexinteger The index of the output item in the response. This value is always 0. content_indexinteger The index of the content part in the content array. This value is always 0. partobject The output item information. Properties typestring The type of the content part. textstring The text of the content part. | {
"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 events
This section describes WebSocket events and fields for qwen3.8-omni-flash-realtime. Other base events and fields use the common protocol documented above. Required fields are required when their containing object is present. IDs are opaque strings; do not rely on their lengths, prefixes, or generation rules. arguments and output are strings whose contents require JSON parsing. MCP connections, discovery, and calls are subject to service quotas and timeouts.
| Event type | When emitted |
|---|
mcp_list_tools.in_progress | Tool discovery starts for an MCP server. |
mcp_list_tools.completed | Discovery succeeds and allowed_tools filtering completes. |
mcp_list_tools.failed | Discovery fails, times out, or exceeds service limits. |
All three require string fields event_id (unique event ID), type (event type above), and item_id (associated mcp_list_tools item). in_progress can arrive before session.updated. For completed and failed, conversation.item.created containing the final tool list or error arrives first, followed by the status event with the same item_id.
{
"event_id": "opaque_event_id",
"type": "mcp_list_tools.completed",
"item_id": "opaque_item_id"
}
response.mcp_call_arguments.delta
| Field | Type | Required | Meaning |
|---|
event_id | string | Yes | Unique event ID. |
type | string | Yes | response.mcp_call_arguments.delta |
response_id | string | Yes | Parent Response ID. |
item_id | string | Yes | Current mcp_call item ID. |
output_index | integer | Yes | Zero-based index in the parent Response output array. |
delta | string | Yes | Incremental JSON-string fragment; concatenate in event order. |
obfuscation | string | No | Optional obfuscation string; ignore when assembling and parsing arguments. |
{
"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
Requires event_id, type, response_id, and item_id (strings), output_index (integer, same meaning as above), and arguments (string). type is response.mcp_call_arguments.done. arguments contains the complete JSON-encoded arguments and is authoritative.
{
"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.*
| Event type | When emitted |
|---|
response.mcp_call.in_progress | Arguments are complete and approval has been granted or is unnecessary; the MCP call starts. |
response.mcp_call.completed | The MCP call succeeds. |
response.mcp_call.failed | Connection, protocol, or tool business error; approval rejection or timeout; call timeout; or cancellation. |
All three require event_id, type, and item_id (strings), and output_index (integer). item_id identifies the current mcp_call; output_index is its index in the parent Response output array.
{
"event_id": "opaque_event_id",
"type": "response.mcp_call.in_progress",
"item_id": "opaque_item_id",
"output_index": 0
}
MCP conversation items
These objects are types of the item field in events, applicable to Qwen3.8-Omni-Flash-Realtime.
Returned as conversation.item.created.item; see the type=mcp_list_tools branch under conversation.item.created for its fields.
Example:
{
"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"]
}
}
]
}
}
Initial mcp_call item
When the model selects an MCP tool, this item appears in response.output_item.added.item and may also appear in conversation.item.created.item; see the corresponding item branches under response.output_item.added and conversation.item.created.
response.output_item.added example:
{
"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 item
Returned in conversation.item.created; see conversation.item.created for the event and approval item fields.
Example:
{
"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"
}
}
Final mcp_call item
After a call reaches a terminal state, the item appears in response.output_item.done.item and in the final parent response.done.response.output snapshot; see the corresponding branches under response.output_item.done and response.done.
Successful call:
{
"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}"
}
}
Failed call:
{
"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 errors
MCP errors can occur during tool discovery or tool execution. For discovery errors, see error under the mcp_list_tools branch of conversation.item.created; for execution errors, see the mcp_call branch of response.output_item.done.
See Qwen-Omni-Realtime.