Skip to main content
silk supports five explicit audio_format values on muga, mulberry and mulberry-1.6: opus, pcm, mulaw, alaw, and mp3. the field is optional. omit it entirely to preserve the original response:
  • post /v1/tts returns a 24 khz mono wav file.
  • post /v1/tts/json returns the same wav bytes in audio_base64.
  • websocket sessions stream raw 24 khz mono signed 16-bit little-endian pcm.
do not send "audio_format": null. explicit null is invalid and returns 400 unsupported_audio_format. omit the field when you want the default.

supported values

wav and ogg are not accepted values. omit audio_format for wav, and use opus for opus audio in an ogg container.

binary http response

add audio_format to the json request body. the response body contains the audio bytes directly, and the response content-type identifies the format.
curl
change only the audio_format value and output extension to request another format. leave the field out to receive speech.wav with the original behavior.

json base64 response

the json endpoint keeps the response object and replaces audio_base64 with the requested audio bytes encoded as base64.
python
the response also includes request_id, audio_duration_ms, credits_used, and usage_cost_nanos. the requested format does not change billing.

websocket streaming

set audio_format when minting the one-shot session. do not add it to later synthesis frames: the gateway stores the negotiated format in the session.
python
always connect to the returned ws_url. the negotiated format applies at the silk gateway. connecting to any other endpoint is outside this contract. for opus and mp3, concatenate binary websocket messages in order before decoding the complete stream. individual messages are not guaranteed to be standalone audio files.

billing and stored audio

payg tts remains based on the exact submitted text character count. choosing a different audio format does not add a surcharge and does not make billing depend on encoded byte length or generated duration. silk stores its canonical wav source for usage and audit workflows regardless of the format returned to the client.