Realtime Conversation (listen while speaking)
yaoshu-omni-realtime is the realtime conversation model: over a single long-lived WebSocket connection you send text, live audio streams, and video frames, and you receive text and speech. It suits voice assistants, live translation, companion chat, and similar interactive scenarios. Integrate it with the OpenAI Realtime SDK.
This is a realtime conversation over a WebSocket, not a single HTTP request. The platform forwards realtime events between client and server as-is and does not fill in session configuration on the client's behalf; the effective defaults are whatever the server echoes in
session.created, and changing behavior requires an explicit declaration insession.update.
1. Endpoint and Authentication
wss://token.yaoshu.cc/v1/realtime?model=yaoshu-omni-realtimemodelmust be passed as a connection parameter and is fixed toyaoshu-omni-realtime; the model cannot be switched once the connection is established.- The WebSocket upgrade must be initiated over HTTP/1.1. Rewriting the upgrade request with HTTP/2 may return a misleading
400 Model not exist— if you hit this error, check the protocol version and themodelparameter before suspecting the model name. - Authentication: use either of the following
Sec-WebSocket-Protocol: openai-insecure-api-key.sk-your-api-key(the OpenAI Realtime SDK default)Authorization: Bearer sk-your-api-key
2. Capabilities and Limits
- Interruptible, semantic turn detection (the current playback stops automatically when the user starts speaking), tool calling, web search
- Default voice
Tina; for new integrations usesession.audio.output.voice; the legacy fieldsession.voiceis still supported, and when both are set the former takes precedence - Input audio: PCM, 16 kHz, 16-bit, mono; 1 / 2 / 4 channels are also supported (only with PCM + 16 kHz +
s16le+interleaved), and 2 / 4 channel input is billed at 2× the tokens of normal audio - Output audio: PCM, 24 kHz
- Tool calling and web search cannot be enabled at the same time
- Maximum duration of a single connection is 120 minutes
- Per-request limits: total input 196,608 tokens, output 65,536 tokens
- Audio history holds at most 100 turns or 600 seconds in total; video history holds at most 50 turns or 240 seconds in total — the oldest history is dropped beyond that
3. Session Configuration (including null semantics)
3.1 Do not rely on server-side defaults
After the connection is established, the server first sends session.created, which carries the default configuration for this session:
input_audio_transcriptionis on by default, echoed as{"model":"<transcription-model>"}(the exact model is whateversession.createdechoes);- Not sending this field ≠ disabled: when omitted, the server fills in the default recognition engine,
conversation.item.input_audio_transcription.*events appear in the stream, and a transcription charge is incurred (which contributes nothing to the model output); - Only an explicit
nullactually disables it:session.updatedechoes"input_audio_transcription": null, and transcription events no longer appear in the stream.
If you do not need transcription, write "input_audio_transcription": null explicitly in every session.update; if you do need it, omit the field (the server fills in the default) or configure the model echoed by session.created. Do not rely on "the server fills in defaults automatically" — that default-on behavior defeats the intent to save cost.
3.2 Two interaction modes
VAD mode (default): pass server_vad / semantic_vad / semantic_vad_ec as turn_detection; the server decides when an utterance ends, commits the audio automatically, and triggers generation:
{
"type": "session.update",
"session": {
"modalities": ["text", "audio"],
"voice": "Tina",
"audio": {
"input": { "format": { "type": "pcm", "sample_rate": 16000 } },
"output": { "format": { "type": "pcm", "sample_rate": 24000 } }
},
"turn_detection": { "type": "semantic_vad" },
"input_audio_transcription": null
}
}{ "type": "input_audio_buffer.append", "audio": "<Base64 PCM>" }Manual mode: pass an explicit null for turn_detection to disable VAD; the client controls the pacing. In manual mode input_audio_buffer.commit only commits audio and does not trigger generation — after receiving input_audio_buffer.committed you must send response.create yourself:
{ "type": "input_audio_buffer.commit" }{ "type": "response.create" }Event order: input_audio_buffer.append (may repeat) → input_audio_buffer.commit → input_audio_buffer.committed → response.create → response.text.delta / response.audio.delta (may repeat) → response.done.
3.3 Audio formats
For new integrations, use session.audio.input.format / session.audio.output.format to declare both the format and the sample rate; the legacy fields input_audio_format / output_audio_format are still supported. Once audio streaming has started, the input audio format can no longer be changed.
4. Event Stream
4.1 Event list
Client → server:
| Event | Purpose |
|---|---|
session.update | Update session configuration (modalities, voice, audio format, VAD, transcription, tools, etc.) |
input_audio_buffer.append | Append Base64-encoded PCM audio |
input_audio_buffer.commit | Commit buffered audio in manual mode |
response.create | Trigger one generation turn in manual mode |
response.cancel | Interrupt the current generation |
conversation.item.create | Append a text or image message |
input_image_buffer.append | Append a video frame |
Server → client:
| Event | Content |
|---|---|
session.created / session.updated | Session configuration (defaults, and the echo after this update's overrides) |
input_audio_buffer.committed | Audio committed |
conversation.item.input_audio_transcription.delta | Live preview of the input transcription (only when transcription is enabled) |
conversation.item.input_audio_transcription.completed | Final text of the input transcription (only when transcription is enabled) |
response.text.delta / response.text.done | Text output delta / done |
response.audio.delta / response.audio.done | Base64 PCM (24 kHz) delta / done |
response.audio_transcript.delta / .done | Text delta / done corresponding to the speech |
response.done | A response turn has ended; response.usage is the billing basis for this turn |
error | Error |
The client only needs to handle the modality events it actually uses; any other unrecognized events can be ignored. The platform forwards server events as-is, so new event types require no changes to your integration code.
5. Billing
Billing is settled per turn: once at the end of each response (response.done), and any usage not yet settled is settled when the connection closes.
- Input is counted as tokens per modality: text, images, and audio. Input audio is roughly 7 tokens per second (mono estimate); 2 / 4 channel input is counted at 2× the tokens of normal audio.
- Output is counted as tokens per modality: for voice output, audio tokens and the corresponding text tokens are billed separately (this model's convention), so factor this double counting into cost estimates; text-only output counts text only.
- Input transcription (ASR) is a separate line item: when
input_audio_transcriptionis enabled, the recognition engine incurs an additional charge. If you do not need transcription, be sure to pass an explicitnull(see section 3) — otherwise the default-on setting adds a charge on every utterance that contributes nothing to the model output. - Billing is authoritative on the
response.usagereturned by the server; when the event stream carries no usage, the platform falls back to metering the audio, video, and text actually sent and received on the connection. - Unit prices are per the model pricing page in the Console.
When the remaining quota is insufficient, usage already incurred is still billed and the connection is then interrupted; a billing anomaly never lets a connection keep consuming for free. Closing the connection does not mean the current turn's usage has already been settled — unsettled usage is handled by durable compensation, and the same billing event is never charged twice.
