Audio (TTS & STT)
Audio (TTS & STT)
Audio
Text-to-Speech
client.audio.synthesize sends POST /v1/audio/speech and returns a Uint8Array of raw audio bytes.
SpeechParams fields
Speech-to-Text (Transcription)
client.audio.transcribe sends POST /v1/audio/transcriptions as a multipart upload and returns a TranscriptionResponse.
TranscriptionParams key fields
Transcribe & Translate
client.audio.translate sends POST /v1/audio/transcriptions/translate — it transcribes the audio and translates the transcript to English in one step. Same three-argument shape as transcribe.
Translation (to English)
client.audio.translations sends POST /v1/audio/translations — a distinct endpoint that transcribes audio in any language and returns the text translated to English. It takes the same three-argument shape as transcribe and returns a TranscriptionResponse (.text is the English translation).
Use a speech model that supports translation — see the Models list. model is required.
Optional parameters (passed in the second argument object): prompt (context hint), response_format ("json", "text", or "verbose_json"), and temperature (0–2).
List Voices
client.audio.listVoices sends GET /v1/audio/voices.
ListVoicesParams fields
Get Voice
client.audio.getVoice sends GET /v1/audio/voices/{voice_id}.