Configure a session, send audio, and return task results.
Send JSON events by controlling the WebSocket. For connection and authentication, see WebSocket integration.
Configure a session. The service confirms that the configuration has taken effect via Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Session configuration.
Frontend speech model ID used for the session. Options: If you omit Output modality. Default includes System voice ID used by the frontend model. Default value:
Turn detection configuration.
Set to Input format. Pure WebSocket uses Output format. Pure WebSocket uses Frontend functions executable by the application. Default: empty array.
Tool type. Use Function name.What the function does.Function parameters defined using JSON Schema.
Parameter structure. Use Types and constraints of parameters, keyed by the names defined by your application.Names of the required parameters.Controls whether undeclared parameters are allowed. Set to Task execution method.
Required in Responses mode. Model Studio passes the settings documented here to the backend model. See the Responses API for the tool definition format.
Backend Responses model ID for handling delegated tasks, e.g., Task instructions for the backend model in Responses mode. Model Studio supplies no built-in backend instructions.Declares tools available for the backend model. The structure of each tool depends on its
Tool type. Use Function name.What the function does.Function parameters defined using JSON Schema.
Parameter structure. Use Types and constraints of parameters, keyed by the names defined by your application.Names of the required parameters.Controls whether undeclared parameters are allowed. Set to Uses WebSocket if omitted or an empty object is passed.
Specify the transport method explicitly. Required when AOQ configuration.
Whether to deliver downstream audio via WebSocket in addition. Default is
Sends one frame of audio in a pure WebSocket session. Audio is sent via AOQ in AOQ sessions.
Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Base64-encoded 16 kHz, 16-bit, mono PCM16LE.
Mutes audio input. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.
Resumes audio input. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.
Input user text or return the result of a frontend function. The application executes the function at most once per Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Session content to be written.
Enter Example for Content of
Enter User text.Frontend function call ID corresponding to String result of
Update task progress. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Use the ID from Task progress.Start time on the session timeline, in milliseconds.End time, in milliseconds. Provided in conjunction with
Provides questions requiring user input. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Use the ID from Typically omitted.Information requiring user input.Start time on the session timeline, in milliseconds.End time, in milliseconds. Provided in conjunction with
Returns the task result handled by this connection, or submits user text. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Use the ID from Task result or user text.Start time on the session timeline, in milliseconds.End time, in milliseconds. Provided in conjunction with Task error message.
Add backend input in Responses mode. Then send Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Backend input. Supports
Input item type.Example for User message content.
Enter User text.Function call ID for Function result as a string for
Initiate a new backend task. The service returns backend events via Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.Pass backend generation configuration. For configuration format, see Responses API.
Terminate the session. The service returns Event type; fixed value: Client event ID. Non-empty; maximum length: 128 characters.
session.update
Configure a session. The service confirms that the configuration has taken effect via session.updated. With pure WebSocket integration, audio can be sent immediately after this step. For WebRTC and AOQ, you must wait for their respective media connections to become ready.
typestringRequiredsession.update.event_idstringRequiredsessionobjectRequiredView child fields
View child fields
modelstringRequiredqwen-audio-4.0-realtime-preview or qwen-audio-3.1-realtime-flash.For duplex conversations, use qwen-audio-4.0-realtime-preview and set turn_detection.type to duplex.instructionsstringOptionalsession.instructions in the initial session configuration, the frontend model uses its built-in instructions. Providing session.instructions replaces them.modalitiesarrayOptionalaudio and text.voicestringOptionalyunshu.| Voice name | Voice ID |
|---|---|
| 云舒 | yunshu |
| 小满 | xiaoman |
| 晚风 | wanfeng |
| 青柚 | qingyou |
| 破晓 | poxiao |
| 麦芽 | maiya |
| 乌龙 | wulong |
| 雪松 | xuesong |
turn_detectionobjectOptionalView child fields
View child fields
typestringRequiredduplex for duplex conversations, and select qwen-audio-4.0-realtime-preview as the frontend model.input_audio_formatstringOptionalpcm, defaulting to 16 kHz, mono PCM16LE.output_audio_formatstringOptionalpcm, defaulting to 24 kHz, mono PCM16LE.toolsarray[object]OptionalView child fields
View child fields
typestringfunction for a custom function.namestringdescriptionstringparametersobjectView child fields
View child fields
typestringobject for an object.propertiesobjectrequiredarray[string]additionalPropertiesboolean | objectfalse to reject them.delegationobjectRequiredView child fields
View child fields
typestringRequiredclient: Task executed by the application. responses: Backend Responses model invoked by the service.responsesobjectConditionally requiredView child fields
View child fields
modelstringRequiredqwen4-max.instructionsstringOptionaltoolsarray[object]Optionaltype. The fields below apply to custom functions (type is function).View child fields
View child fields
typestringfunction for a custom function.namestringdescriptionstringparametersobjectView child fields
View child fields
typestringobject for an object.propertiesobjectrequiredarray[string]additionalPropertiesboolean | objectfalse to reject them.transportobjectOptionalView child fields
View child fields
typestringConditionally requiredwebsocket uses WebSocket, rtc uses WebRTC, and aoq uses AOQ.sdpstringConditionally requiredtype is rtc. Pass the Offer SDP generated by the client. See WebRTC integration.aoqobjectOptionalView child fields
View child fields
ws_audiobooleanOptionalfalse.- Client mode
- Responses mode
session.input_audio.append
Sends one frame of audio in a pure WebSocket session. Audio is sent via AOQ in AOQ sessions.
typestringRequiredsession.input_audio.append.event_idstringOptionalaudiostringRequiredsession.input_audio.mute
Mutes audio input. The service returns session.input_audio.muted.
typestringRequiredsession.input_audio.mute.event_idstringOptionalsession.input_audio.unmute
Resumes audio input. The service returns session.input_audio.unmuted.
typestringRequiredsession.input_audio.unmute.event_idstringOptionalsession.item.create
Input user text or return the result of a frontend function. The application executes the function at most once per call_id.
typestringRequiredsession.item.create.event_idstringOptionalitemobjectFill according to purpose.View child fields
View child fields
typestringRequiredmessage or function_call_output.rolestringFill according to type.message: user.contentarrayFill according to type.message.View child fields
View child fields
typestringRequiredinput_text for text input.textstringRequiredcall_idstringFill according to type.function_call_output.outputstringFill according to type.function_call_output.- Return function result
- Input text
session.thinking.append
Update task progress. The service returns session.thinking.appended.
typestringRequiredsession.thinking.append.event_idstringOptionaldelegation_idstringRequiredsession.delegation.created received over the current connection.contentstringRequiredstart_msnumberOptionalend_msnumberOptionalstart_ms. Both values must be finite and non-negative, and the end time must not precede the start time.session.instruction.append
Provides questions requiring user input. The service returns session.instructions.appended.
typestringRequiredsession.instruction.append.event_idstringOptionaldelegation_idstringRequiredsession.delegation.created received over the current connection.task_idstringOptionalcontentstringRequiredstart_msnumberOptionalend_msnumberOptionalstart_ms. Both values must be finite and non-negative, and the end time must not precede the start time.session.commentary.append
Returns the task result handled by this connection, or submits user text. The service returns session.commentary.appended.
typestringRequiredsession.commentary.append.event_idstringOptionaldelegation_idstringRequired when returning a task result.session.delegation.created received over the current connection.contentstringOptionalstart_msnumberOptionalend_msnumberOptionalstart_ms. Both values must be finite and non-negative, and the end time must not precede the start time.errorobjectOptional- Return task result.
- Input text
response.item.create
Add backend input in Responses mode. Then send response.create to trigger generation.
typestringRequiredresponse.item.create.event_idstringOptionalitemobjectRequiredmessage and function_call_output.View child fields
View child fields
typestringRequiredrolestringFill according to type.message: user.contentarrayFill according to type.View child fields
View child fields
typestringRequiredinput_text for text input.textstringRequiredcall_idstringfunction_call_output. Use the call_id returned in the backend event.outputstringfunction_call_output.- Input text
- Return a backend function result
response.create
Initiate a new backend task. The service returns backend events via response.event. When explicitly initiated, the service returns backend events directly; only auto-delegated workflows send session.delegation.created.
typestringRequiredresponse.create.event_idstringOptionalresponseobjectOptionalsession.close
Terminate the session. The service returns session.closed.
typestringRequiredsession.close.event_idstringRequired