Skip to main content
Connect via WebSocket. For browser-native, low-latency voice, see WebRTC.

Endpoint

Authentication

Flow

  1. Connect → receive session.created
  2. Send session.update (instructions, audio config, tools)
  3. Stream audio (input_audio_buffer.append) or text (conversation.item.create)
  4. response.create → handle response.output_* until response.done

Session Config

session.update accepts partial updates so you are able to dynamically update your prompt, voice, model, tools, and so on during the conversation.
providerData carries Inworld-specific extensions to the OpenAI-compatible session shape — STT tuning, TTS segmentation/steering, automatic memory, and more. Most providerData fields are hot-swappable via partial session.update, but a few are read only at session open and ignored afterwards (notably providerData.tts.conversational and providerData.tts.user_turn_mode). See Inworld Realtime API Extensions for the field-by-field reference, including which fields are hot-swappable.

Audio

The default audio format is PCM16 at 24 kHz, mono, base64-encoded. The API also accepts audio/pcmu and audio/pcma (G.711 μ-law / A-law) at 8 kHz for telephony, and audio/float32 for pipelines that natively produce 32-bit float samples. Set the format under audio.input.format (and audio.output.format) in session.update — see Audio input formats for the full catalog. Recommended chunk size is 60-100ms.
Use input_audio_buffer.clear to discard unwanted audio.

Text

The Realtime API can accept text as well as audio. Send it from your client using conversation.item.create.

Events

Speech-to-speech conversations are facilitated by websocket events - both client-sent events which you’ll send to the API, and server-sent events which you’ll receive and react to.
  • Session: session.created, session.updated
  • Conversation: conversation.item.added/done/retrieved/deleted/truncated, transcription deltas/completions
  • Responses: response.created, response.output_item.added/done, response.output_text.delta/done, response.output_audio.delta/done, response.done
  • Audio/VAD: input_audio_buffer.speech_started, input_audio_buffer.speech_stopped, input_audio_buffer.turn_suggestion, input_audio_buffer.turn_suggestion_revoked, input_audio_buffer.timeout_triggered, response.output_audio_transcript.delta
  • Back-channel: response.backchannel.audio.delta, response.backchannel.audio.done, response.backchannel.skipped
  • Errors: error
The full list of events and their schemas is available in the API reference.

Node.js websocket server example

Server-side Node.js example using the ws library with Basic auth.
API reference for full schemas.