Skip to main content
Qwen-Audio-Realtime

Qwen-Audio-Realtime Server Events

Qwen-Audio-Realtime API server event reference

Server events are pushed from the server to the client. All server events include the common fields event_id (a unique identifier automatically generated by the server) and type (the event type). User guide: Real-time voice conversation (Qwen-Audio-Realtime). For the event interaction timeline, see WebSocket API.

error

Returned when a request is invalid or a service error occurs. Client errors (invalid_request_error) do not interrupt the connection; server errors (server_error) terminate the connection.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as error.
errorobjectError details.
error.typestringError type, such as invalid_request_error (client error) or server_error (server error).
error.codestringError code.
error.messagestringError message.
error.paramstringThe parameter related to the error.
{
    "event_id": "event_xxx",
    "type": "error",
    "error": {
        "type": "invalid_request_error",
        "code": "invalid_value",
        "message": "Cannot create response while another response is in progress.",
        "param": "response.create"
    }
}

session.created

The first event sent by the server after the connection is established, carrying the default session configuration.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as session.created.
sessionobjectThe session configuration.
session.objectstringFixed as realtime.session.
session.modelstringThe name of the model in use.
session.modalitiesarrayThe model's output modalities.
session.voicestringThe voice used for generated audio — either a system voice name or the voice_id of a voice-cloning voice.
session.input_audio_transcriptionobjectSpeech transcription configuration.
session.input_audio_transcription.modelstringThe speech transcription model, such as fun-asr.
session.turn_detectionobjectTurn detection (VAD) configuration.
session.idstringThe unique identifier of the session.
{
    "event_id": "event_KiKZC2zrhNsKFPZ5cTpyA",
    "type": "session.created",
    "session": {
        "object": "realtime.session",
        "model": "qwen-audio-3.0-realtime-plus",
        "modalities": ["text", "audio"],
        "voice": "longanqian",
        "input_audio_transcription": {
            "model": "fun-asr"
        },
        "turn_detection": {
            "type": "server_vad",
            "threshold": 0.5,
            "silence_duration_ms": 800
        },
        "id": "sess_A1LbG2D63WELBSawRbpq8"
    }
}

session.updated

Returned after a session.update request is processed successfully, carrying the complete updated session configuration. If an error occurs, an error event is returned instead.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as session.updated.
sessionobjectThe complete updated session configuration. The structure matches the session object in session.created.
{
    "event_id": "event_FMG6kiHbILCGiqXFPA98e",
    "type": "session.updated",
    "session": {
        "id": "sess_A1LbG2D63WELBSawRbpq8",
        "object": "realtime.session",
        "model": "qwen-audio-3.0-realtime-plus",
        "modalities": ["text", "audio"],
        "voice": "longanqian",
        "input_audio_transcription": {
            "model": "fun-asr"
        },
        "turn_detection": {
            "type": "smart_turn",
            "threshold": 0.1,
            "silence_duration_ms": 900
        }
    }
}

input_audio_buffer.speech_started

The VAD detected the start of speech (server_vad / smart_turn mode).
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as input_audio_buffer.speech_started.
audio_start_msintegerThe timestamp (in milliseconds) when speech started.
item_idstringThe ID of the item that will be created once this segment of speech is committed.
{
    "event_id": "event_xxx",
    "type": "input_audio_buffer.speech_started",
    "audio_start_ms": 1200,
    "item_id": "item_xxx"
}

input_audio_buffer.speech_stopped

The VAD detected the end of speech (server_vad / smart_turn mode).
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as input_audio_buffer.speech_stopped.
audio_end_msintegerThe timestamp (in milliseconds) when speech ended.
item_idstringThe ID of the user message item that will be created.
reasonstringReturned only in smart_turn mode. A value of turn_invalid indicates the current turn was judged invalid (no semantic content) and does not trigger inference. This field is not returned for valid turns.
{
    "event_id": "event_xxx",
    "type": "input_audio_buffer.speech_stopped",
    "audio_end_ms": 3400,
    "item_id": "item_xxx",
    "reason": "turn_invalid"
}

input_audio_buffer.committed

The audio buffer was committed as a user message (either via a push-to-talk commit or automatic VAD commit).
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as input_audio_buffer.committed.
previous_item_idstringThe ID of the previous conversation item.
item_idstringThe ID of the created user message item.
{
    "event_id": "event_xxx",
    "type": "input_audio_buffer.committed",
    "previous_item_id": "item_xxx",
    "item_id": "item_xxx"
}

input_audio_buffer.cleared

The audio buffer was cleared (push-to-talk mode only).
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as input_audio_buffer.cleared.
{
    "event_id": "event_xxx",
    "type": "input_audio_buffer.cleared"
}

conversation.item.created

A new conversation item was created successfully. Triggered when a user audio message is committed, the client manually creates an item, or an assistant response begins.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.created.
previous_item_idstringThe ID of the previous conversation item.
itemobjectThe created conversation item.
item.idstringThe unique identifier of the conversation item.
item.objectstringFixed as realtime.item.
item.typestringThe item type: message (a regular message) or function_call (a function call).
item.statusstringThe item status, such as in_progress or completed.
item.rolestringThe message role, such as user or assistant. Included only for message items.
item.contentarrayThe list of message content. Included only for message items.
{
    "event_id": "event_xxx",
    "type": "conversation.item.created",
    "previous_item_id": "item_xxx",
    "item": {
        "id": "item_xxx",
        "object": "realtime.item",
        "type": "message",
        "status": "in_progress",
        "role": "assistant",
        "content": []
    }
}

conversation.item.deleted

A conversation item was deleted. Returned as confirmation after the client sends conversation.item.delete.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.deleted.
item_idstringThe ID of the deleted conversation item.
{
    "event_id": "event_xxx",
    "type": "conversation.item.deleted",
    "item_id": "item_xxx"
}

conversation.item.retrieved

A conversation item was retrieved successfully. Returned after the client sends conversation.item.retrieve. For audio-type content, only the transcript is returned, not the original audio data.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.retrieved.
itemobjectThe complete retrieved conversation item.
item.idstringThe unique identifier of the conversation item.
item.objectstringFixed as realtime.item.
item.typestringThe item type: message (a regular message) or function_call (a function call).
item.rolestringThe message role, such as user or assistant. Included only for message items.
item.contentarrayThe list of message content. For audio-type content, only the transcript is returned, not the original audio data.
{
    "event_id": "event_xxx",
    "type": "conversation.item.retrieved",
    "item": {
        "id": "item_xxx",
        "object": "realtime.item",
        "type": "message",
        "role": "user",
        "content": [
            {
                "type": "input_audio",
                "transcript": "Hello"
            }
        ]
    }
}

conversation.item.input_audio_transcription.delta

Incremental ASR transcription results, streamed during speech recognition. Includes emotion and language detection information.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.input_audio_transcription.delta.
item_idstringThe ID of the associated conversation item.
content_indexintegerThe index of the content part.
textstringThe finalized transcription text.
stashstringProvisional text that has not yet been finalized.
{
    "event_id": "event_xxx",
    "type": "conversation.item.input_audio_transcription.delta",
    "item_id": "item_xxx",
    "content_index": 0,
    "text": "Hello",
    "stash": "world"
}

conversation.item.input_audio_transcription.completed

The final ASR transcription result. The transcription text is written to the transcript field of the corresponding item.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.input_audio_transcription.completed.
item_idstringThe ID of the associated conversation item.
content_indexintegerThe index of the content part.
transcriptstringThe complete transcription text.
{
    "event_id": "event_xxx",
    "type": "conversation.item.input_audio_transcription.completed",
    "item_id": "item_xxx",
    "content_index": 0,
    "transcript": "Hello world"
}

conversation.item.input_audio_transcription.failed

ASR transcription failed.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.input_audio_transcription.failed.
item_idstringThe ID of the associated conversation item.
content_indexintegerThe index of the content part.
errorobjectError details.
error.typestringError type, such as transcription_error.
error.codestringError code, such as transcription_failed.
error.messagestringError message.
{
    "event_id": "event_xxx",
    "type": "conversation.item.input_audio_transcription.failed",
    "item_id": "item_xxx",
    "content_index": 0,
    "error": {
        "type": "transcription_error",
        "code": "transcription_failed",
        "message": "ASR transcription failed"
    }
}

conversation.item.ambient_audio_transcription.delta

smart_turn mode only. This event is not associated with any item in the conversation context.
Incremental ambient audio transcription results. When the VAD detects voice activity but semantic judgment determines the turn is not valid (for example, noise or non-semantic sounds like "um" or "uh"), the ASR result is passed through to the client as an ambient event. item_id is a separately generated, temporary ID.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.ambient_audio_transcription.delta.
item_idstringA separately generated, temporary ID; not associated with any item in the conversation context.
content_indexintegerThe index of the content part.
textstringThe finalized transcription text.
stashstringProvisional text that has not yet been finalized.
{
    "event_id": "event_xxx",
    "type": "conversation.item.ambient_audio_transcription.delta",
    "item_id": "item_xxx",
    "content_index": 0,
    "text": "Um",
    "stash": ""
}

conversation.item.ambient_audio_transcription.completed

smart_turn mode only. This transcription result is not written to the conversation context.
The final ambient audio transcription result. Paired with the delta event, indicating that transcription of a segment of ambient audio is complete.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as conversation.item.ambient_audio_transcription.completed.
item_idstringA separately generated, temporary ID; not associated with the conversation context.
content_indexintegerThe index of the content part.
transcriptstringThe complete transcription text.
{
    "event_id": "event_xxx",
    "type": "conversation.item.ambient_audio_transcription.completed",
    "item_id": "item_xxx",
    "content_index": 0,
    "transcript": "Um"
}

response.created

A round of model inference has started.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.created.
responseobjectThe response object.
response.idstringThe unique identifier of the response.
response.objectstringFixed as realtime.response.
response.statusstringThe response status, such as in_progress.
response.modalitiesarrayThe model's output modalities.
response.voicestringThe voice used for generated audio — either a system voice name or the voice_id of a voice-cloning voice.
response.outputarrayThe list of output items for the response; initially an empty array.
{
    "event_id": "event_xxx",
    "type": "response.created",
    "response": {
        "id": "resp_xxx",
        "object": "realtime.response",
        "status": "in_progress",
        "modalities": ["text", "audio"],
        "voice": "longanqian",
        "output": []
    }
}

response.output_item.added

A new output item was added to the response. Output items for regular replies have type message; output items for function calling have type function_call.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.output_item.added.
response_idstringThe ID of the associated response.
output_indexintegerThe index of the output item within the response.
itemobjectThe added output item.
item.idstringThe unique identifier of the output item.
item.objectstringFixed as realtime.item.
item.typestringThe output item type: message (a regular message) or function_call (a function call).
item.statusstringThe output item status, such as in_progress.
item.rolestringThe message role, fixed as assistant. Included only for message items.
item.contentarrayThe list of message content. Included only for message items.
Example of a regular message output item:
{
    "event_id": "event_xxx",
    "type": "response.output_item.added",
    "response_id": "resp_xxx",
    "output_index": 0,
    "item": {
        "id": "item_xxx",
        "object": "realtime.item",
        "type": "message",
        "status": "in_progress",
        "role": "assistant",
        "content": []
    }
}
Example of a function call output item: When the output item is a function call, the item structure in response.output_item.added, conversation.item.created, and response.output_item.done is as follows:
{
    "id": "item_xxx",
    "object": "realtime.item",
    "type": "function_call",
    "status": "completed",
    "call_id": "call_xxx",
    "name": "get_weather",
    "arguments": "{\"city\":\"Hangzhou\"}"
}
A single response can include multiple function_call items, and may include both a regular message output and function_call outputs at the same time. Function call content is not sent to TTS for playback.

response.content_part.added

A new content part was added to an output item.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.content_part.added.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
partobjectThe added content part.
part.typestringThe content type, such as audio or text.
part.textstringThe text content; initially an empty string.
{
    "event_id": "event_xxx",
    "type": "response.content_part.added",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "part": {
        "type": "audio",
        "text": ""
    }
}

response.text.delta

Incremental text event in text-only mode, streaming text fragments.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.text.delta.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
deltastringThe incremental text fragment.
{
    "event_id": "event_xxx",
    "type": "response.text.delta",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "delta": "Hello"
}

response.text.done

Text output complete, in text-only mode.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.text.done.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
textstringThe complete text output.
{
    "event_id": "event_xxx",
    "type": "response.text.done",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "text": "Hello! How can I help you?"
}

response.audio_transcript.delta

Incremental caption text event in audio mode, streaming caption fragments.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.audio_transcript.delta.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
deltastringThe incremental caption fragment.
{
    "event_id": "event_xxx",
    "type": "response.audio_transcript.delta",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "delta": "Hello"
}

response.audio_transcript.done

Caption output complete, in audio mode.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.audio_transcript.done.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
transcriptstringThe complete caption text.
{
    "event_id": "event_xxx",
    "type": "response.audio_transcript.done",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "transcript": "Hello! How can I help you?"
}

response.audio.delta

Incremental audio data event in audio mode. The delta field is Base64-encoded PCM audio data.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.audio.delta.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
deltastringA Base64-encoded fragment of PCM audio data.
{
    "event_id": "event_xxx",
    "type": "response.audio.delta",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "delta": "<base64-encoded audio data>"
}

response.audio.done

Audio output complete, in audio mode. Does not include audio data.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.audio.done.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
{
    "event_id": "event_xxx",
    "type": "response.audio.done",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0
}

response.content_part.done

A content part within an output item has finished being output.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.content_part.done.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
content_indexintegerThe index of the content part within the output item.
partobjectThe completed content part.
part.typestringThe content type, such as audio or text.
part.textstringThe text content or audio caption text.
{
    "event_id": "event_xxx",
    "type": "response.content_part.done",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "content_index": 0,
    "part": {
        "type": "audio",
        "text": "Hello! How can I help you?"
    }
}

response.output_item.done

An output item within the response has finished being output.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.output_item.done.
response_idstringThe ID of the associated response.
output_indexintegerThe index of the output item within the response.
itemobjectThe complete finished output item.
item.idstringThe unique identifier of the output item.
item.objectstringFixed as realtime.item.
item.typestringThe output item type: message (a regular message) or function_call (a function call).
item.statusstringThe output item status, such as completed.
item.rolestringThe message role, fixed as assistant. Included only for message items.
item.contentarrayThe list of message content. Included only for message items.
{
    "event_id": "event_xxx",
    "type": "response.output_item.done",
    "response_id": "resp_xxx",
    "output_index": 0,
    "item": {
        "id": "item_xxx",
        "object": "realtime.item",
        "type": "message",
        "status": "completed",
        "role": "assistant",
        "content": [
            {
                "type": "text",
                "text": "Hello! How can I help you?"
            }
        ]
    }
}

response.function_call_arguments.delta

Incremental function calling arguments. When the model decides to call a tool, the server first sends response.output_item.added (with item.type=function_call) and the corresponding conversation.item.created, then streams the argument fragments via this event.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.function_call_arguments.delta.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
call_idstringThe unique identifier of the function call.
deltastringAn incremental fragment of the function call arguments (a JSON string fragment).
{
    "event_id": "event_xxx",
    "type": "response.function_call_arguments.delta",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "call_id": "call_xxx",
    "delta": "{\"city"
}

response.function_call_arguments.done

Function calling arguments output complete. After receiving this event, the client should execute the corresponding tool, write back a function_call_output via conversation.item.create, and then send response.create to trigger the second round of inference.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.function_call_arguments.done.
response_idstringThe ID of the associated response.
item_idstringThe ID of the associated output item.
output_indexintegerThe index of the output item within the response.
call_idstringThe unique identifier of the function call.
namestringThe name of the called function.
argumentsstringThe complete function call arguments (a JSON string).
{
    "event_id": "event_xxx",
    "type": "response.function_call_arguments.done",
    "response_id": "resp_xxx",
    "item_id": "item_xxx",
    "output_index": 0,
    "call_id": "call_xxx",
    "name": "get_weather",
    "arguments": "{\"city\":\"Hangzhou\"}"
}

response.done

A round of inference is complete. status indicates the reason for completion.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as response.done.
responseobjectThe complete response object.
response.idstringThe unique identifier of the response.
response.objectstringFixed as realtime.response.
response.statusstringThe final status of the response: completed (finished normally), cancelled (interrupted and cancelled), or failed (LLM or TTS error).
response.status_detailsobjectStatus details, present only when cancelled or failed.
response.status_details.typestringThe status type, such as cancelled.
response.status_details.reasonstringThe cancellation reason: turn_detected (interrupted by VAD) or client_cancelled (cancelled by the client).
response.modalitiesarrayThe model's output modalities.
response.voicestringThe voice used for generated audio — either a system voice name or the voice_id of a voice-cloning voice.
response.outputarrayThe list of output items for the response, containing the complete item objects.
  • Completed normally
  • Interrupted
{
    "event_id": "event_xxx",
    "type": "response.done",
    "response": {
        "id": "resp_xxx",
        "object": "realtime.response",
        "status": "completed",
        "modalities": ["text", "audio"],
        "voice": "longanqian",
        "output": [
            {
                "id": "item_xxx",
                "object": "realtime.item",
                "type": "message",
                "status": "completed",
                "role": "assistant",
                "content": [
                    {
                        "type": "audio",
                        "transcript": "Hello! How can I help you?"
                    }
                ]
            }
        ]
    }
}

voiceprint_audio_list.in_progress

Voiceprint enrollment is proceeding asynchronously.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as voiceprint_audio_list.in_progress.
item_idstringThe unique identifier of the voiceprint enrollment task.
{
    "event_id": "event_PaEcN7CCrlhE8q4MM2yND",
    "type": "voiceprint_audio_list.in_progress",
    "item_id": "vp_Y12cA986j1KZ9O9YmAXOA"
}

voiceprint_audio_list.completed

Voiceprint enrollment is complete.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as voiceprint_audio_list.completed.
item_idstringThe unique identifier of the voiceprint enrollment task.
{
    "event_id": "event_PaEcN7CCrlhE8q4MM2yND",
    "type": "voiceprint_audio_list.completed",
    "item_id": "vp_Y12cA986j1KZ9O9YmAXOA"
}

voiceprint_audio_list.failed

Voiceprint enrollment failed. This does not block normal conversation calls.
FieldTypeDescription
event_idstringThe unique identifier of this event.
typestringEvent type, fixed as voiceprint_audio_list.failed.
item_idstringThe unique identifier of the voiceprint enrollment task.
reasonstringA description of the failure reason.
{
    "event_id": "event_PaEcN7CCrlhE8q4MM2yND",
    "type": "voiceprint_audio_list.failed",
    "item_id": "vp_Y12cA986j1KZ9O9YmAXOA",
    "reason": ""
}