Qwen-Omni-Realtime client events

Updated at:

Client events for the Qwen-Omni-Realtime API.

NoteThis page is the event reference for Qwen-Omni-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.

For WebSocket SDK usage, see Python SDK and Java SDK. To select a model and protocol, see Overview.

session.update

After opening the WebSocket connection, you can send session.update to configure the session. If you need to change the configuration later, send only the settings you want to change; the other settings will stay as they are.

The server validates the parameters you send. If validation succeeds, it returns the complete updated session configuration in session.updated. If validation fails, it returns an error event.

typestring(required)

The event type. The value must be session.update.

sessionobject(optional)

The session configuration.

For Qwen3.8-Omni-Flash-Realtime, session is required when updating a session. The total input token limit is 196608, calculated using the same rules as Qwen3.5-Omni-Realtime.

Properties

modalitiesarray(optional)

The model output modalities. Valid values:

  • ["text"]

    Text only.

  • ["text","audio"] (default)

    Text and audio.

voicestring(optional)

The voice for the model's audio output. For supported voices, see Voice list.

Default voices:

  • Qwen3.8-Omni-Flash-Realtime: Tina
  • Qwen3.5-Omni-Realtime series model: Tina
  • qwen3-omni-flash-realtime-2025-09-15: Cherry

audioobject (optional)

Input and output audio configuration. Omitted fields retain their existing defaults.

Properties

inputobject (optional)

User input audio configuration.

Properties

formatobject (optional)

Input format and sample rate. Configure these while the session is IDLE, before sending the first audio segment. They cannot change after audio input starts.

Properties

typestring (optional)

For qwen3.5-omni-plus-realtime and qwen3.5-omni-flash-realtime: pcm (default, mono 16-bit raw PCM) or wav (mono 16-bit PCM in a WAV container). Multichannel input for Qwen3.8-Omni-Flash-Realtime requires pcm, which is the default.

sample_rateinteger (optional)

For qwen3.5-omni-plus-realtime and qwen3.5-omni-flash-realtime: 8000, 16000 (default), 24000, or 48000 Hz. Multichannel input for Qwen3.8-Omni-Flash-Realtime requires 16000 Hz, which is the default.

The following four fields apply to Qwen3.8-Omni-Flash-Realtime multichannel input over WebSocket:

sample_formatstring (optional)

PCM sample format. Only s16le is supported; default: s16le.

channelsinteger (optional)

Input channel count: 1 (default), 2, or 4. Two-channel and four-channel spatial audio use twice the input tokens of ordinary audio. See Token calculation.

packingstring (optional)

Sample packing. Only interleaved is supported; default: interleaved.

channel_layoutstring (optional)

Default depends on channels: mono for one channel, raw_mic_array for two, and foa_ambix for four. An explicit value must match channels.

Multichannel input requires PCM, 16000 Hz, s16le, and interleaved samples. Omitted fields use their defaults; supplied fields must have valid types and values. Do not send null instead of omitting a field.

outputobject (optional)

Model output audio configuration.

Properties

formatobject (optional)

Output format and sample rate. Configure these at the start of the session, before audio interaction begins.

Properties

typestring (optional)

For qwen3.5-omni-plus-realtime and qwen3.5-omni-flash-realtime: pcm (default, mono 16-bit raw PCM) or wav (mono 16-bit PCM in a WAV container).

sample_rateinteger (optional)

For qwen3.5-omni-plus-realtime and qwen3.5-omni-flash-realtime: 8000, 16000, 24000 (default), or 48000 Hz.

voicestring (optional)

For Qwen3.8-Omni-Flash-Realtime, the output voice defaults to Tina. See the voice list for available voices and their voice values. session.voice remains available for existing integrations. For new integrations, use session.audio.output.voice. If both fields are set, the audio output uses the voice specified by session.audio.output.voice.

input_audio_transcriptionobject | null (optional)

Input audio transcription configuration. Set to null to disable it.

Properties

modelstring (required)

The value is fixed to qwen3-asr-flash-realtime. Set {"model":"qwen3-asr-flash-realtime"} to enable transcription; the model value cannot be changed. The Python SDK's enable_input_audio_transcription is an update_session method argument, not a top-level session.update field.

input_audio_formatstring(optional)

A legacy compatibility field. For new integrations, use audio.input.format to configure both the input format and sample rate.

output_audio_formatstring(optional)

A legacy compatibility field. For new integrations, use audio.output.format to configure both the output format and sample rate.

smooth_outputboolean | null(optional)

Applies only to qwen3-omni-flash-realtime-2025-09-15.

Controls the response style. Valid values:

  • true (default): Colloquial responses.

  • false: Formal, written responses.

    Content that is difficult to read aloud may not perform well.

  • null: The model automatically selects between colloquial and formal style.

instructionsstring(optional)

System message that sets the model's role or objective. A new instructions value fully replaces the previous instructions value instead of appending to it. To keep the role, send the existing role instructions together with the new requirements.

turn_detectionobject(optional)

Voice activity detection (VAD) configuration. When you first configure the session, omitting this field enables VAD with the default parameters. Set it to null to disable VAD and trigger model responses manually from the client.

Properties

typestring(optional)

The VAD type. Valid values:

  • server_vad (default): Detects end of speech based on acoustic features.
  • semantic_vad: Detects end of speech based on semantic validity, filtering out backchannels and background noise. Supported by Qwen3.8-Omni-Flash-Realtime and the Qwen3.5-Omni-Realtime series.
  • semantic_vad_ec: Semantic validity detection for customer service and business scenarios. Compared with semantic_vad, this mode detects user speech more readily to interrupt the model response, while still filtering out meaningless sounds such as background noise. Supported by the Qwen3.8-Omni-Flash-Realtime series.

thresholdfloat(optional)

The VAD sensitivity. A lower value makes VAD more sensitive—more likely to detect faint sounds as speech, including background noise. A higher value requires clearer and louder speech to trigger.

Valid range: [-1.0, 1.0]. Default: 0.5.

silence_duration_msinteger(optional)

The minimum silence duration after speech ends, in milliseconds. When exceeded, the model generates a response. A lower value speeds up responses but may cause false triggers during brief pauses.

Default: 800. Valid range: [200, 6000].

idle_timeout_msinteger(optional)

Applies only to qwen3.5-omni-plus-realtime and qwen3.5-omni-flash-realtime models in server_vad mode.

The idle timeout in milliseconds. After the server finishes audio playback and the user remains silent beyond this duration (no speech.started triggered), the model proactively generates a response to prompt the user to continue the conversation based on the current context. The timeout starts after the last model response audio finishes playing.

Valid range: [5000, 30000].

enable_searchboolean(optional)

Applies to Qwen3.8-Omni-Flash-Realtime and Qwen3.5-Omni-Realtime models.

Whether to enable web search. Set to true to enable; default is false. When enabled, the model decides autonomously whether it needs to search the web to answer the user's questions.

tools and enable_search are incompatible. Do not enable both at the same time.

search_optionsobject(optional)

Web search configuration. Takes effect only when enable_search is enabled.

Properties

enable_sourceboolean(optional)

Whether to return the list of search result sources. Set to true to enable.

videoobject (optional)

Video input configuration for Qwen3.8-Omni-Flash-Realtime.

Properties

inputobject (optional)

Video input parameters.

Properties

representation_compactstring (optional)

Video representation aggregation. The initial session default is none, which preserves full fine-grained input. normal aggregates it to reduce computation when fine visual detail is unnecessary; for the same video input, it uses one quarter of the tokens used by none. See Token calculation. Set this before the first audio segment; it cannot change after audio input starts.

toolsarray(optional)

A list of tool definitions. The model decides whether to call a tool based on user input. For Qwen3.8-Omni-Flash-Realtime, Function Calling and MCP tools can be configured in the same session. Array elements are distinguished by type; tools and enable_search cannot both be enabled.

Function Calling (type=function)

typestring (required)

Must be function.

functionobject (required)

The custom function definition.

Properties

namestring (required)

The function name, matching the actual function name, such as get_current_weather or get_current_time.

descriptionstring (optional)

A description of what the function does. The model uses it to decide whether to call the tool.

parametersobject (optional)

The function's input parameters. The model uses this to extract parameter values. Omit this field if the function has no input.

Properties

typestring (required)

Must be object.

propertiesobject (optional)

Defines each input parameter by name. In the example on the right, location is a custom parameter name; its type and description describe the data type and purpose.

requiredarray (optional)

Lists which parameters are required.

MCP (type=mcp)

For the MCP configuration and invocation flow of Qwen3.8-Omni-Flash-Realtime, see Interaction flow.

Required fields must be supplied when this MCP array element is present. Every addition or update requires both server_label and server_url; a label alone cannot reuse an existing configuration. Update MCP configuration only when there is no active Response. Connections, discovery, and calls are subject to quotas and timeouts. See MCP call limits.

typestring (required)

Must be mcp.

server_labelstring (required)

Unique MCP server label within the session. Length: 1–64 characters; letters, digits, underscores, and hyphens only.

server_urlstring (required)

MCP Streamable HTTP endpoint. Must be a public HTTPS address on port 443, up to 4096 characters, with no username, password, or fragment. Its domain must resolve to public addresses.

authorizationstring (optional)

Outbound Authorization value, up to 8192 printable ASCII characters.

headersobject (optional)

Additional outbound HTTP headers, up to 16 string-to-string pairs. Names must be 1–128 characters using standard HTTP header-name characters. Values must be printable ASCII and at most 8192 characters.

Names cannot start with mcp-, proxy-, or x-forwarded-, or equal host, authorization, connection, content-length, transfer-encoding, accept, content-type, forwarded, cookie, origin, upgrade, te, or trailer.

allowed_toolsarray of strings (optional)

Filter applied after discovery. Omission allows all tools; an empty array exposes none. Each name is 1–64 characters, with letters, digits, underscores, periods, and hyphens only.

require_approvalstring (optional)

Approval policy: always (default) or never.

server_url, authorization, and headers are used only for the server-side connection and are not echoed in session.updated. Do not reconstruct sensitive settings from that event.

temperaturefloat(optional)

The sampling temperature, controlling output diversity. A higher value produces more varied content; a lower value produces more deterministic output.

Valid range: [0, 2).

Because temperature and top_p both control diversity, set only one.

Default values:

  • qwen3.8-omni-flash-realtime: 0.6
  • Qwen3.5-Omni-Realtime series model: 0.7
  • qwen3-omni-flash-realtime-2025-09-15: 0.9

top_pfloat(optional)

The nucleus sampling probability threshold, controlling output diversity. A higher value produces more varied content; a lower value produces more deterministic output.

Valid range: (0, 1.0].

Because temperature and top_p both control diversity, set only one.

Default values:

  • qwen3.8-omni-flash-realtime: 0.95
  • Qwen3.5-Omni-Realtime series model: 0.8
  • qwen3-omni-flash-realtime-2025-09-15: 1.0

top_kinteger(optional)

The candidate set size for sampling. For example, a value of 50 limits each generation step to the 50 highest-scoring tokens. A larger value increases randomness; a smaller value increases determinism. Set to null or a value greater than 100 to disable top_k, in which case only top_p applies.

Minimum value: 0.

Default values:

  • qwen3.8-omni-flash-realtime: 20
  • Qwen3.5-Omni-Realtime series model: 20
  • qwen3-omni-flash-realtime-2025-09-15: 50

max_tokensinteger(optional)

The maximum number of tokens to return.

The max_tokens setting does not affect the model's generation process. If the generated output exceeds max_tokens, the response is truncated.

For qwen3.8-omni-flash-realtime, the valid range is [1, 65536]. For other models, the default and maximum values equal the model's maximum output length. See Model list.

Use max_tokens to limit output length for tasks like summarization, keyword extraction, cost control, or latency reduction.

repetition_penaltyfloat(optional)

Controls repetition in the model's output. A higher value reduces repetition; 1.0 means no penalty. qwen3.8-omni-flash-realtime also accepts 0. For other models, the value must be greater than 0, with no strict upper limit.

Default values:

  • qwen3.8-omni-flash-realtime: 0
  • Qwen3.5-Omni-Realtime series model: 1.0
  • qwen3-omni-flash-realtime-2025-09-15: 1.05

presence_penalty float(optional)

Controls content repetition in the model's output.

Valid range: [-2.0, 2.0]. A positive value reduces repetition; a negative value increases it.

Default values:

  • qwen3.8-omni-flash-realtime: 1
  • Qwen3.5-Omni-Realtime series model: 1.5
  • qwen3-omni-flash-realtime-2025-09-15: 0.0

When to use:

Higher values suit creative tasks like storytelling or brainstorming, where output diversity and interest matter.

Lower values suit technical or formal content where consistency and precise terminology are required.

seedinteger(optional)

Makes generation more deterministic. Pass the same seed value with unchanged parameters to get consistent results across runs.

Valid range: 0 to 231−1. Default: -1.

{
    "event_id": "event_ToPZqeobitzUJnt3QqtWg",
    "type": "session.update",
    "session": {
        "modalities": [
            "text",
            "audio"
        ],
        "model": "qwen3.5-omni-flash-realtime",
        "voice": "Tina",
        "audio": {
            "input": {
                "format": {
                    "type": "pcm",
                    "sample_rate": 16000
                }
            },
            "output": {
                "format": {
                    "type": "wav",
                    "sample_rate": 24000
                }
            }
        },
        "instructions": "You are an AI customer service specialist for a five-star hotel. Accurately and friendly answer customer inquiries about room types, facilities, prices, and booking policies. Always respond with a professional and helpful attitude. Do not provide unverified information or information outside the scope of hotel services.",
        "turn_detection": {
            "type": "server_vad",
            "threshold": 0.5,
            "silence_duration_ms": 800
        },
        "enable_search": false,
        "tools": [
            {
                "type": "function",
                "function": {
                    "name": "get_current_weather",
                    "description": "Useful for querying the weather in a specific city.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The city or district, such as Beijing, Hangzhou, or Yuhang District."
                            }
                        },
                        "required": ["location"]
                    }
                }
            }
        ],
        "seed": 1314,
        "max_tokens": 16384,
        "repetition_penalty": 1.05,
        "presence_penalty": 0.0,
        "top_k": 50,
        "top_p": 1.0,
        "temperature": 0.9
    }
}

response.create

The response.create event instructs the server to generate a model response. In VAD mode, the server normally starts responses from speech activity; tool continuations follow the explicit flow below. For Function Calling, send this event after returning the tool result via conversation.item.create to continue generation. For Qwen3.8-Omni-Flash-Realtime MCP tools, the server executes the call; if a model continuation is needed, send one response.create after response.done for the Response containing this MCP call, without attaching MCP results.

The server replies with a response.created event, followed by one or more item and content events—such as conversation.item.created and response.content_part.added—and finally a response.done event.

typestring(required)

The event type. The value must be response.create.

{
    "type": "response.create",
    "event_id": "event_1718624400000"
}

response.cancel

Send this event to cancel an ongoing response. If no response is in progress, the server returns an error.

typestring(required)

The event type. The value must be response.cancel.

{
    "event_id": "event_B4o9RHSTWobB5OQdEHLTo",
    "type": "response.cancel"
}

input_audio_buffer.append

For WebSocket access, appends audio bytes to the input audio buffer.

typestring(required)

The event type. The value must be input_audio_buffer.append.

audiostring(required)

The Base64-encoded audio data.

{
    "event_id": "event_B4o9RHSTWobB5OQdEHLTo",
    "type": "input_audio_buffer.append",
    "audio": "UklGR..."
}

input_audio_buffer.commit

Commits the input audio buffer, creating a new user message item in the conversation. If the buffer is empty, the server returns an error.

  • VAD mode: The client does not need to send this event. The server commits the audio buffer automatically.
  • Manual mode: The client must commit the audio buffer to create a user message item.

Committing the buffer does not trigger a model response. The server replies with an input_audio_buffer.committed event.

If the client sent an input_image_buffer.append event, the input_audio_buffer.commit event also commits the image buffer.

typestring(required)

The event type. The value must be input_audio_buffer.commit.

{
    "event_id": "event_B4o9RHSTWobB5OQdEHLTo",
    "type": "input_audio_buffer.commit"
}

input_audio_buffer.clear

Clears audio bytes from the buffer. The server replies with an input_audio_buffer.cleared event.

typestring(required)

The event type. The value must be input_audio_buffer.clear.

{
    "event_id": "event_xxx",
    "type": "input_audio_buffer.clear"
}

input_image_buffer.append

For WebSocket access, adds image data to the image buffer. Images can come from a local file or be captured in real time from a video stream.

The following limits apply to image inputs:

  • Format: JPG or JPEG. Recommended resolution: 480p or 720p; maximum: 1080p.
  • A single image after Base64 encoding must not exceed 256 KB. We recommend keeping the raw image size below 190 KB before encoding.
  • Image data must be Base64-encoded.
  • Recommended send frequency: 1 image per second.
  • Send at least one input_audio_buffer.append event before sending an input_image_buffer.append event.

The image buffer is committed with the audio buffer using the input_audio_buffer.commit event.

typestring(required)

The event type. The value must be input_image_buffer.append.

imagestring(required)

The Base64-encoded image data.

{
    "event_id": "event_xxx",
    "type": "input_image_buffer.append",
    "image": "xxx"
}

conversation.item.create

Send this event to create a conversation item, either a Function Calling result or, for Qwen3.8-Omni-Flash-Realtime, an MCP approval response.

event_idstring (optional)

A client-generated event ID for tracing.

typestring(required)

The event type. The value must be conversation.item.create.

itemobject(required)

The conversation item to create. Cannot be empty.

Approval request IDs, item IDs, and event IDs returned by the server are opaque strings. Do not rely on their lengths, prefixes, or generation rules.

Properties

idstring (optional)

The conversation item ID. Specify one to align with local state; otherwise the server generates one.

typestring (required)

The conversation item type:

  • function_call_output: A Function Calling result. Run the tool locally, return its result with this type, then send response.create.
  • mcp_approval_response: An MCP approval response for Qwen3.8-Omni-Flash-Realtime. The server executes the MCP tool. If a model continuation is needed, wait for response.done for the Response containing this MCP call, then send one response.create without MCP results.

call_idstring (conditionally required)

Required only for function_call_output. Use the call_id returned in response.function_call_arguments.done.

outputstring (conditionally required)

Required only for function_call_output. The tool function execution result.

approval_request_idstring (conditionally required)

Required only for mcp_approval_response. When require_approval is always or omitted in the MCP configuration, the server may send mcp_approval_request. Reply using conversation.item.create; this field must exactly match the item.id of an unhandled approval request.

approveboolean (conditionally required)

Required only for mcp_approval_response. true allows execution; false rejects the call, which enters failed.

Function Calling result

{
    "event_id": "event_55099cddb51b4f208cb95d1a994eef80",
    "type": "conversation.item.create",
    "item": {
        "id": "item_2a80d7682b4e473c9c2154da135041e9",
        "type": "function_call_output",
        "call_id": "call_62c24725afdb4c2680ac54",
        "output": "The weather in Beijing today is changing from haze to clear, with a temperature of 4/-4°C and a light breeze."
    }
}

MCP approval response (Qwen3.8-Omni-Flash-Realtime)

{
  "event_id": "event_client_xxx",
  "type": "conversation.item.create",
  "item": {
    "type": "mcp_approval_response",
    "approval_request_id": "opaque_approval_id",
    "approve": true
  }
}

See Qwen-Omni-Realtime .