Client event reference for Qwen-Audio-Realtime API.
User guide: Real-time voice conversation (Qwen-Audio-Realtime). For the event interaction sequence, see WebSocket access.
For WebSocket SDK usage, see Android SDK, iOS SDK, and HarmonyOS SDK. To select a model and protocol, see Overview.
Description: After a connection is established, send this event to update the default session configuration. Include only the fields you want to change; omitted fields retain their current values. If any parameter is invalid, the server returns an error. If all parameters are valid, the server applies the changes and returns the full configuration.
Event type. Fixed value: Session configuration.
Output modalities for the model. Valid values:TTS voice name. The default is Controls the speaking rate of model audio output. Range: Specifies whether to enable speech emotion enhancement. When enabled, the response voice exhibits more pronounced emotional variations. Default: System instructions that define the model's role, response style, and behavioral preferences. Applies to the entire session.Input audio format. Currently only Output audio format. Currently only Input audio transcription configuration.
The source language of the input audio. Applies to Instant hotword configuration for input audio transcription. Applies to
An object that maps hotwords to integer weights. Regular hotwords take weights from 1 to 5. The higher the weight, the more likely the transcription is to use the word. A weight of 50 marks a super hotword. You can include up to 50 super hotwords and up to 2,000 hotwords in total per update.Sending another Output audio configuration. Applies to
The target language of the output audio.This parameter applies to speech synthesis (TTS). The model makes a best effort to produce speech in the target language, but this is not guaranteed, and the language of the response text is not changed. To generate text in the target language, state the requirement explicitly in the prompt, for example by specifying the reply language in Maximum number of conversation turns (question-answer pairs) included in a single request. Valid values: 1 to 50. Default: 20.Applies to the qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, and qwen-audio-3.0-realtime-flash models.Specifies whether to enable web search. Default: The web search configuration. This parameter takes effect only when
Specifies whether to return the sources of search results. Set this parameter to Tool definitions for Function Calling. Once configured, the model decides whether to call a tool based on user input.
Fixed value:
Name of the tool function.Description of the tool function. The model uses this to determine whether to call the tool.Description of the tool function's input parameters. The model uses this to extract the required parameters. Omit this field if the function takes no parameters.
Fixed value: Describes each parameter's name, data type, and description.Specifies which parameters are required.The turn detection fields described below apply to
VAD type. Valid values:VAD sensitivity. Applies to Minimum silence duration (in milliseconds) after speech ends before triggering a model response. Only effective in server_vad mode (ignored in smart_turn / smart_turn_v2 modes). Lower values produce faster responses but may cause false triggers during brief pauses.Range: [200, 6000]. Default: 800. Recommended range for conversations: 400-800.Only effective in smart_turn / smart_turn_v2 modes. A list of publicly accessible URLs pointing to pre-recorded audio samples from the target user, used for speaker enhancement. Once registered, the model locks onto the target speaker during duplex conversations, effectively ignoring other voices and background noise. Maximum 5 URLs. Audio format requirements: 16kHz PCM or WAV.
Description: For WebSocket access, appends audio data to the input buffer. Send data continuously at short intervals, such as one frame every 20~40 ms. The server does not acknowledge this event.
Event type. Fixed value: Base64-encoded audio data.
Description: Push-to-talk mode only. Commits the buffered audio as a user message. This doesn't automatically trigger inference. Send Event type. Fixed value:
Description: For WebSocket access, this event takes effect only in push-to-talk mode. It clears uncommitted audio from the buffer. This event is ignored in server_vad / smart_turn / smart_turn_v2 modes. The server responds with an Event type. Fixed value:
Description: Inserts a conversation item into the conversation context. Use this event to inject historical context or add text content, or to return Function Calling results.
Event type. Fixed value: Specifies the conversation item after which the new item is inserted. If not provided, the item is appended to the end of the conversation.The conversation item to create.
Unique identifier for the conversation item. If not provided, the server generates one automatically. An error is returned if the specified ID already exists in the conversation.Conversation item type. Valid values:Message role. Valid values: List of message content elements. Each element contains a
Unique identifier for the function call, used to correlate requests and results.Name of the function to call.Function call parameters in JSON string format.Tool execution result in JSON string format.
Description: Retrieves a conversation item stored on the server. Audio-type content in the response contains only the transcript (Event type. Fixed value: ID of the conversation item to retrieve. The server returns the result in a
Description: Deletes a conversation item from the conversation context. The server confirms the deletion with a Event type. Fixed value: ID of the conversation item to delete.
Description: Triggers model inference. Behavior varies by mode:
Event type. Fixed value: Overrides the session defaults for the current inference round. If not provided, the current session configuration is used.
Overrides the output modalities for the current round. Valid values are the same as Overrides the TTS voice for the current round.
Description: Cancels the current inference. Any text generated so far is saved to the item list. The server then returns a Event type. Fixed value:
This page is the event reference for Qwen-Audio-Realtime. Event definitions are based on WebSocket access. AOQ and WebRTC use their respective data channels to send and receive model events, and media tracks to transmit media. First read WebSocket access, WebRTC access, or AOQ access.
session.update
Description: After a connection is established, send this event to update the default session configuration. Include only the fields you want to change; omitted fields retain their current values. If any parameter is invalid, the server returns an error. If all parameters are valid, the server applies the changes and returns the full configuration.
turn_detection can only be modified before the first audio is sent (IDLE state).typestring(required)session.update.sessionobject(optional)Properties
Properties
modalitiesarray(optional)-
["text"]Text only. -
["audio", "text"](default) Both text and audio.
voicestring(optional)longanqian_v3.1 for 3.1 Plus/Flash and longanqian for 3.0 Plus/Flash. System voices and cloned voices are supported. Can only be set in the first session.update; ignored in subsequent calls.- System voices for 3.1 Plus/Flash: Supports
longanqian_v3.1and the union of the voice lists for 3.1 TTS Plus and Flash. For the complete range, see Voice configuration. - System voices for 3.0 Plus/Flash: Available values:
longanqian,longanlingxin,longanlingxi,longanxiaoxin,longanlufeng. - Cloned voices: Create a voice through the Voice cloning API, and set this parameter to the returned
voice_id. For details, see Voice configuration.
qwen-audio-3.1-realtime-plus or qwen-audio-3.1-realtime-flash, set the voice in the first session.update, for example:speech_ratefloat(optional)[0.5, 2.0]. Default: 1.0. Lower values slow the speech; higher values speed it up. Supported by qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash.enable_speech_emotionboolean(optional)true. Valid values: true and false.instructionsstring(optional)input_audio_formatstring(optional)pcm (16 kHz, 16-bit, mono) is supported and is the default. Can only be modified before the first audio is sent (IDLE state).output_audio_formatstring(optional)pcm (24 kHz, 16-bit, mono) is supported and is the default.input_audio_transcriptionobject(optional)Properties
Properties
languagestring(optional)qwen-audio-3.1-realtime-plus and qwen-audio-3.1-realtime-flash. Instant hotwords also work when you omit this field.Valid values:zh: Chineseen: Englishja: Japaneseko: Koreanvi: Vietnameseth: Thaiid: Indonesianar: Arabicfr: Frenchde: Germanes: Spanishpt: Portugueseru: Russianit: Italian
corpusobject(optional)qwen-audio-3.0-realtime-plus, qwen-audio-3.0-realtime-flash, qwen-audio-3.1-realtime-plus, and qwen-audio-3.1-realtime-flash.Properties
Properties
vocabularyobjectvocabulary object in the same session replaces the entire previous list. Send an empty object {} to clear the hotwords.output_audioobject(optional)qwen-audio-3.1-realtime-plus and qwen-audio-3.1-realtime-flash.Properties
Properties
languagestring(optional)instructions.Valid values:zh: Chineseen: Englishfr: Frenchde: Germanja: Japaneseko: Koreanru: Russianpt: Portugueseth: Thaiid: Indonesianvi: Vietnamesees: Spanishit: Italianar: Arabic
max_history_turnsinteger(optional)enable_searchboolean(optional)false. When enabled, the model decides whether to search the web based on the real-time query.You can set enable_search to true and configure Function Calling tools through tools in the same session.search_optionsobject(optional)enable_search is set to true.Properties
Properties
enable_sourceboolean(optional)true to return the sources.toolsarray(optional)Properties
Properties
typestring(required)function.functionobjectProperties
Properties
namestring(required)descriptionstring(optional)parametersobject(optional)Properties
Properties
typestring(required)object.propertiesobject(optional)requiredarray(optional)turn_detectionobject|null(optional)qwen-audio-3.1-realtime-plus, qwen-audio-3.1-realtime-flash, qwen-audio-3.0-realtime-plus, and qwen-audio-3.0-realtime-flash.Turn detection configuration. To switch to push-to-talk mode, set this field to null. In push-to-talk mode, audio must be committed manually and inference triggered manually. If this field isn't provided, VAD is enabled with its default parameters.Properties
Properties
typestring(optional)server_vad(default): Detects speech onset and offset based on acoustic features and automatically triggers inference.smart_turn: An intelligent turn detection mode that combines acoustic perception and semantic understanding to determine turn boundaries. Filler sounds such as "um" or "uh" don't trigger a new turn or interrupt model playback.smart_turn_v2(recommended): Builds onsmart_turnto better understand conversation context and interaction intent in multi-speaker settings. Reduces unintended responses or interruptions caused by bystanders or unrelated interjections.
thresholdfloat(optional)server_vad, smart_turn, and smart_turn_v2. Lower values increase VAD sensitivity, making it easier to detect faint sounds (including background noise) as speech. Higher values decrease sensitivity, requiring clearer and louder speech to trigger detection.Range: [-1.0, 1.0]. Default: 0.5.silence_duration_msinteger(optional)voiceprint_audio_urlsarray(optional)- Basic configuration
- Language configuration
- Instant hotwords
- Function Calling
- Voiceprint registration
The examples below apply to
qwen-audio-3.1-realtime-plus and qwen-audio-3.1-realtime-flash and explicitly select the system voice longanqian_v3.1.input_audio_buffer.append
Description: For WebSocket access, appends audio data to the input buffer. Send data continuously at short intervals, such as one frame every 20~40 ms. The server does not acknowledge this event.
typestring(required)input_audio_buffer.append.audiostring(required)input_audio_buffer.commit
Description: Push-to-talk mode only. Commits the buffered audio as a user message. This doesn't automatically trigger inference. Send response.create to trigger inference manually.
This event is ignored in server_vad, smart_turn, and smart_turn_v2 modes.
typestring(required)input_audio_buffer.commit.input_audio_buffer.clear
Description: For WebSocket access, this event takes effect only in push-to-talk mode. It clears uncommitted audio from the buffer. This event is ignored in server_vad / smart_turn / smart_turn_v2 modes. The server responds with an input_audio_buffer.cleared event.
typestring(required)input_audio_buffer.clear.conversation.item.create
Description: Inserts a conversation item into the conversation context. Use this event to inject historical context or add text content, or to return Function Calling results.
If
item.id already exists in the conversation, an error is returned and the item isn't created.typestring(required)conversation.item.create.previous_item_idstring(optional)itemobject(required)Properties
Properties
idstring(optional)typestring(required)message: A regular conversation message.function_call: A function call request. Typically generated by the server, but clients can also use it to inject historical context.function_call_output: A tool execution result. After receiving afunction_call, the client executes the tool and returns the result using this type.
rolestring(required for message type)system, user, assistant.contentarray(required for message type)type field and corresponding data fields.Supported content types by role
Supported content types by role
system
input_text: System message. Required field: text.userinput_text: User text input. Required field:text.input_audio: User audio input. Required field:audio(Base64-encoded).
output_text: Assistant text output. Required field: text.call_idstring(required for function_call / function_call_output type)namestring(required for function_call type)argumentsstring(required for function_call type)outputstring(required for function_call_output type)- User text message
- Function Calling result
Inject a user text message:
conversation.item.retrieve
Description: Retrieves a conversation item stored on the server. Audio-type content in the response contains only the transcript (transcript), not the original audio data.
typestring(required)conversation.item.retrieve.item_idstring(required)conversation.item.retrieved event.conversation.item.delete
Description: Deletes a conversation item from the conversation context. The server confirms the deletion with a conversation.item.deleted event.
typestring(required)conversation.item.delete.item_idstring(required)response.create
Description: Triggers model inference. Behavior varies by mode:
- Push-to-talk mode: Must be called manually. Commit the buffered audio with
input_audio_buffer.commitfirst, or return afunction_call_outputresult before triggering. Can't be called while a response is being generated. - server_vad mode: Typically triggered automatically by the server. Clients can also call it manually when no response is being generated. Can't be called while a response is being generated.
- smart_turn / smart_turn_v2 modes: Can be called while waiting for the next user turn. Can't be called during an active turn (between
input_audio_buffer.speech_startedandresponse.done).
response field overrides the session defaults for the current inference round. In Function Calling scenarios, after the client returns a function_call_output, this event triggers the second inference round.
In server_vad, smart_turn, and smart_turn_v2 modes, manually triggered inferences can still be interrupted by new speech.
typestring(required)response.create.responseobject(optional)Properties
Properties
modalitiesarray(optional)session.update modalities.voicestring(optional)response.cancel
Description: Cancels the current inference. Any text generated so far is saved to the item list. The server then returns a response.done event with status=cancelled.
An error is returned if no inference is in progress.
typestring(required)response.cancel.