Server events for the Qwen-Omni-Realtime API, including tool calling (function calling) events.
See Qwen-Omni-Realtime.
error
Server error.
event_idstringA unique identifier for this event.typestringThe event type. This value is always error.errorobjectError details.
Properties type stringThe error type.codestringThe error code.messagestringThe error message.paramstringThe parameter associated with the error, such as session.modalities. |
session.created
Returned when a client connects. Contains the default session configuration.
event_idstringA unique identifier for this event.typestringThe event type. This value is always session.created.sessionobjectThe session configuration.
Properties object stringThis value is always realtime.session.modelstringThe model used.modalitiesarrayThe output modalities for the model.voicestringThe voice for model-generated audio.input_audio_formatstringInput audio format. Only pcm is supported (16 kHz sample rate).output_audio_formatstringOutput audio format. Only pcm is supported (24 kHz sample rate).input_audio_transcriptionobjectThe transcription configuration.
Properties model stringTranscription model. Always qwen3-asr-flash-realtime. Not configurable.objectThe voice activity detection (VAD) configuration.
Properties type stringThe VAD type. Valid values are server_vad (default) or semantic_vad. See Client events.thresholdfloatThe VAD detection threshold.silence_duration_msintegerSilence duration (ms) that triggers end-of-speech detection.idle_timeout_msintegerThe idle timeout in milliseconds. Returned only in server_vad mode with qwen3.5-omni-plus-realtime or qwen3.5-omni-flash-realtime models.booleanWhether to enable web search. Supported only by Qwen3.5-Omni-Realtime series model.search_optionsobjectThe options for the web search.temperaturefloatThe temperature parameter for the model. |
session.updated
Returned after a successful session.update request. On failure, an error event is returned instead.
event_idstringA unique identifier for this event.typestringThe event type. This value is always session.updated.sessionobjectThe session configuration.
Properties temperature floatThe temperature parameter for the model.modalitiesarrayThe output modalities for the model.voicestringThe voice for model-generated audio.instructionsstringThe model's goal and role.input_audio_formatstringInput audio format. Only pcm is supported (16 kHz sample rate).output_audio_formatstringOutput audio format. Only pcm is supported (24 kHz sample rate).input_audio_transcriptionobjectThe transcription configuration.
Properties model stringTranscription model. Always qwen3-asr-flash-realtime. Not configurable.objectThe voice activity detection (VAD) configuration.
Properties type stringThe VAD type. Valid values are server_vad (default) or semantic_vad. See Client events.thresholdfloatThe VAD detection threshold.silence_duration_msintegerSilence duration (ms) that triggers end-of-speech detection.idle_timeout_msintegerThe idle timeout in milliseconds. Returned only in server_vad mode with qwen3.5-omni-plus-realtime or qwen3.5-omni-flash-realtime models.boolean (optional)Whether to enable web search. Supported only by Qwen3.5-Omni-Realtime series model.search_optionsobject (optional)The web search options.toolsarray (optional)Tool definitions. When configured, the model can decide whether to call a tool based on user input.
Properties type string (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 type string (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.floatThe probability threshold for nucleus sampling.top_kintegerCandidate set size for sampling during generation.max_tokensintegerMaximum tokens the model can return for this request.repetition_penaltyfloatControls repetition in consecutive sequences during generation.presence_penaltyfloatControls repetition in generated content.seedintegerThe degree of consistency in the model's output per request. |
input_audio_buffer.speech_started
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_idstringA unique identifier for this event.typestringThe event type. This value is always input_audio_buffer.speech_started.audio_start_msintegerTime (ms) from when audio buffer writing starts until speech is first detected.item_idstringID 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. |
input_audio_buffer.speech_stopped
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_idstringA unique identifier for this event.typestringThe event type. This value is always input_audio_buffer.speech_stopped.audio_end_msintegerTime (ms) from session start until end-of-speech is detected.item_idstringThe ID of the user message item that will be created. |
input_audio_buffer.committed
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.commitevent.
event_idstringA unique identifier for this event.typestringThe event type. This value is always input_audio_buffer.committed.item_idstringThe ID of the user message item that will be created. |
input_audio_buffer.cleared
Returned after the client sends an input_audio_buffer.clear event.
event_idstringA unique identifier for this event.typestringThe event type. This value is always input_audio_buffer.cleared. |
conversation.item.created
Returned when a conversation item is created.
event_idstringA unique identifier for this event.typestringThe event type. This value is always conversation.item.created.itemobjectThe conversation item to add.
Properties id stringThe unique ID of the conversation item.objectstringThis value is always realtime.item.statusstringThe status of the conversation item.rolestringThe role of the message.contentarrayThe content of the message. This parameter is returned when the type is message.typestringThe type of the conversation item. Valid values are message or function_call.namestringThe name of the function that is called when the type is function_call.call_idstringWhen the type is function_call, this is the unique ID of the function invocation.argumentsstringWhen the type is function_call, this parameter contains the arguments for the function invocation as a JSON string. |
conversation.item.input_audio_transcription.delta
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_idstringA unique identifier for this event.typestringThe event type. This value is always conversation.item.input_audio_transcription.delta.item_idstringThe ID of the associated conversation item.content_indexintegerThe index of the content part that contains the audio.textstringConfirmed text prefix — the portion the model has finalized and will not change.stashstringPreliminary text suffix — a temporary draft following the confirmed portion, subject to revision.languagestringThe detected language of the recognized audio.emotionstringThe detected emotion of the recognized audio. Valid values: neutral, happy, sad, angry, surprised, disgusted, fearful. | 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:
|
conversation.item.input_audio_transcription.completed
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_idstringA unique identifier for this event.typestringThe event type. This value is always conversation.item.input_audio_transcription.completed.item_idstringThe ID of the user message item.content_indexintegerThis value is always 0.transcriptstringThe transcribed text. |
conversation.item.input_audio_transcription.failed
Returned when input audio transcription is enabled and the transcription fails. Independent of the error event; helps clients identify transcription failures specifically.
event_idstringA unique identifier for this event.typestringThe event type. This value is always conversation.item.input_audio_transcription.failed.item_idstringThe ID of the user message item.content_indexintegerThis value is always 0.errorobjectThe error information.
Properties code stringThe error code.message stringThe error message.param stringThe parameter related to the error. |
response.created
Returned when the server starts generating a new response.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.created.responseobjectThe response object.
Properties id stringThe unique ID of the response.conversation_id stringThe unique ID of the current session.object stringThe object type. For this event, this value is always realtime.response.status stringThe response status. Valid values are completed, failed, in_progress, or incomplete.modalities arrayThe response modalities.voice stringThe voice for model-generated audio.output arrayThis field is empty for this event. |
response.done
Returned after the response is fully generated. The response object includes all output items except raw audio data.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.done.responseobjectThe response object.
Properties id stringThe unique ID of the response.conversation_id stringThe unique ID of the current session.object stringThe object type. For this event, this value is always realtime.response.status stringThe response status.modalities arrayThe response modalities.voice stringThe voice for model-generated audio.output objectThe response output.
Properties id stringThe ID of the response output.type stringThe type of the output item. Valid values are message or function_call.object stringThe output item object type. This value is always realtime.item.status stringThe output item status.role stringThe output item role.content arrayThe content of the output item. This field is returned only when the type is message.
Properties type stringThe content type. The value can be text for plain text output or audio for audio output.text stringThe text output.transcript stringThe text transcript of the audio.stringThe name of the function that is invoked when the type is function_call.call_id stringWhen the type is function_call, this is the unique ID of the function invocation.arguments stringWhen the type is function_call, this field contains the full arguments for the function call as a JSON string.objectToken usage details for this response.
Properties total_tokens integerTotal tokens used in this response.input_tokens integerNumber of input tokens.output_tokens integerNumber of output tokens.input_tokens_details objectDetails about input token usage, including text_tokens and audio_tokens.output_tokens_details objectDetails 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 objectSearch metering data.
Properties count integerThe number of searches.strategy stringThe search strategy. |
response.text.delta
Returned when the output modality is text-only and the model generates new text incrementally.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.text.delta.deltastringIncremental text generated by the model.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response. This value is always 0.content_indexintegerThe index of the internal part within the output item. This value is always 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_idstringA unique identifier for this event.typestringThe event type. This value is always response.text.done.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.content_indexintegerThe index of the output item in the response.text stringThe full text generated by the model. |
response.audio.delta
Returned when the output modality includes audio and the model generates new audio data incrementally.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.audio.delta.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.content_indexintegerThe index of the output item in the response.delta stringIncremental audio data, Base64-encoded. |
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_idstringA unique identifier for this event.typestringThe event type. This value is always response.audio.done.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.content_indexintegerThe index of the output item in the response. |
response.audio_transcript.delta
Returned when the output modality includes audio and the model generates new response.audio_transcript.delta transcript text incrementally.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.audio_transcript.delta.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.content_indexintegerThe index of the output item in the response.deltastringThe incremental text. |
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_idstringA unique identifier for this event.typestringThe event type. This value is always response.audio_transcript.done.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.content_indexintegerThe index of the output item in the response.transcriptstringThe full transcription text. |
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_idstringA unique identifier for this event.typestringThe event type. This value is always response.function_call_arguments.delta.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.call_idstringThe unique ID for this function invocation. This is consistent with the done event in the same turn.deltastringNew segment of the argument string. Concatenate segments in order. |
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_idstringA unique identifier for this event.typestringThe event type. This value is always response.function_call_arguments.done.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response.call_idstringThe unique ID for this function invocation.namestringThe name of the function that was called.argumentsstringComplete function call arguments as a JSON string. |
response.output_item.added
Returned when a new item is created during response generation. The item type can be message or function_call.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.output_item.added.response_idstringThe response ID.output_indexintegerThe index of the output item in the response.itemobjectInformation about the output item.
Properties id stringThe unique ID of the output item.objectstringThis value is always realtime.item.statusstringThe status of the output item.rolestringThe role of the sender.contentarrayThe content of the message. This field is returned when the type is message.typestringThe type of the output item. Valid values are message or function_call.namestringThe name of the function to call when the type is function_call.call_idstringThe unique ID of the current function invocation when the type is function_call.argumentsstringFunction call arguments as a JSON string when the type is function_call. Initially an empty string in added events. |
response.output_item.done
Returned when an output item is fully generated.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.output_item.done.response_idstringThe response ID.output_indexintegerThe index of the output item in the response.itemobjectThe output item information.
Properties id stringThe unique ID of the output item.objectstringThis value is always realtime.item.statusstringThe status of the output item.rolestringThe role of the sender.contentarrayThe content of the message. This field is returned when the type is message.typestringThe type of the output item. Valid values are message or function_call.namestringThe name of the function that is called when the type is function_call.call_idstringWhen the type is function_call, this is the unique ID for the function invocation.argumentsstringWhen the type is function_call, contains the full function call arguments as a JSON string. |
response.content_part.added
Returned when a new content part is added to an assistant message item during response generation.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.content_part.added.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response. This value is always 0.content_indexintegerThe index of the internal part within the output item. This value is always 0.partobjectThe output item information.
Properties type stringThe type of the content part.textstringThe text of the content part. |
response.content_part.done
Returned when streaming of a content part within an assistant message item finishes.
event_idstringA unique identifier for this event.typestringThe event type. This value is always response.content_part.done.response_idstringThe response ID.item_idstringThe message item ID.output_indexintegerThe index of the output item in the response. This value is always 0.content_indexintegerThe index of the content part in the content array. This value is always 0.partobjectThe output item information.
Properties type stringThe type of the content part.textstringThe text of the content part. |