Start audio playback
Rate limit: Per command · Burst: 8 · Refill: 4 req/s
Play WAV or MP3 files, live AAC/HLS streams, raw live audio, or indefinite silence.
Playback modes:
- Use
type: filesfor one or more WAV or MP3 files. - Use
type: silencefor indefinite silence. - Use
type: streamwith one HTTP/HTTPS AAC or HLS live streamurl; optionally setformattoaacorhls, or omit it for auto-detection. Explicit ports must be 80 or 443. Playback starts at the current live position and does not support pause, resume, or seek. - Use
type: pushwith a raw monomedia_format. The202response includes aningestobject with the short-lived URL, HTTP method, required headers, and expiry. Send one streamingPOSTexactly as described, add the normal Bearer authorization header in addition toingest.headers, write unframed raw audio in the request body, and close the body at end of input. A successful ingest response means the complete body was accepted, not that the caller has heard all audio.
File playlists play in URL order. Session playback does not loop. To start partway through one file, set offset_ms; an offset is not valid for a playlist.
A new play request automatically replaces active playback. Call playback/stop to stop audio without starting another source. For a DTMF menu, receive the usual Session DTMF event and call playback/stop before preparing the selected source when you need the current audio to stop first.
A 202 response confirms durable asynchronous admission. It does not confirm that previous playback has stopped or that new playback has started.
After admission:
- For files, the platform prepares source 0 first and can begin caller playback without waiting for the complete playlist. It then keeps up to five following sources ready ahead of the source being consumed, preparing another source as playback advances.
- For live streams, source fetching and decoding begin after the
202; fetch, format, or decode failures emitplayback.failedwith reasonmedia_unavailable. - The platform emits
playback.startedwhen it estimates that playback began. - Any platform, source, or preparation failure after admission emits one operation-level
playback.failed. Because later sources are prepared asynchronously, this event can occur before or afterplayback.started. - An explicit stop or replacement before playback starts emits
playback.stopped, which may precede anyplayback.started.
Triggered webhooks: playback.started, playback.stopped, and playback.failed.
See Playback lifecycle events for complete payload schemas and examples.
Match the operation_uuid in every playback webhook to the value returned by the 202 response.
Audio files
Play one WAV or MP3 file, or a playlist:
The platform plays the URLs in order. Use offset_ms only with one
file. For private files, use presigned HTTPS URLs that remain valid
through playback. Seek within playback is
available only for files.
Live stream
Play a live audio stream, such as a radio station:
The platform starts playback at the stream’s current position. Live streams do not support seek.
Live push (for TTS)
To push generated audio such as TTS, use:
Start a pushed raw-audio stream:
The 202 Accepted response includes a short-lived ingest object.
Send the application’s normal Bearer authorization together with every
header in ingest.headers, then stream the TTS bytes to ingest.url in
one request and close the body when the TTS stream ends:
The audio must be unframed signed 16-bit little-endian PCM. For
example, an OpenAI TTS response with response_format: pcm can be
streamed directly as the request body.
The audio must match media_format: signed little-endian PCM16 at 8,
16, 24, or 48 kHz; or G.711 mu-law at 8 kHz.
Silence
Keep Session Playback active without an audio source:
Silence continues until another playback replaces it, the session ends, or you stop playback.
An accepted request returns 202 Accepted with operation_uuid and
status: in_progress. New playback replaces active playback
automatically. See Playback lifecycle events
for completion and failure webhooks.
Authentication
Send Authorization: Bearer <app_uuid>:<api_key> using an active API key. See Authentication for details.
Path parameters
Session identifier.
Headers
Optional key for safely retrying mutating requests. An explicitly empty header is treated like omission and does not enable replay protection. See Idempotency for details.
optional client-supplied lowercase RFC-4122 v4 UUID returned as operation_uuid; platform generates one when omitted; correlation metadata distinct from Idempotency-Key.
Request
Play one HTTP/HTTPS AAC or HLS live audio source from its current live position. Omit format to auto-detect; explicit ports must be 80 or 443.
Response headers
Server-owned W3C Trace Context for correlating this response with support and observability data. It is present on successful and error responses. A valid incoming traceparent is linked to, but never becomes, the server-owned trace identifier.
Response
Present only for type: push. Send one streaming HTTP request exactly as described by this object, plus the normal application Bearer authorization header.