All Bundles

Speech

Audio APIs provides two speech to text endpoints, transcriptions and translations

Derived from: EndPoint

Operations

Speak

Generates audio from the input text

function : Speak(model:String, input:String, voice:String, token:String) ~ Pair<String,ByteArrayRef>
Parameters
NameTypeDescription
modelStringavailable TTS models 'tts-1' or 'tts-1-hd'
inputStringthe text to generate audio for, the maximum length is 4096 characters
voiceStringvoice to use when generating the audio, supported voices are alloy, 'echo', 'fable', 'onyx', 'nova', and 'shimmer'.
tokenStringAPI token

Return
TypeDescription
Pair<String,ByteArrayRef>response with type and content, Nil if unsuccessful

Generates audio from the input text

function : Speak(model:String, input:String, voice:String, response_format:String, token:String) ~ Pair<String,ByteArrayRef>
Parameters
NameTypeDescription
modelStringavailable TTS models 'tts-1' or 'tts-1-hd'
inputStringthe text to generate audio for, the maximum length is 4096 characters
voiceStringvoice to use when generating the audio. Supported voices are alloy, 'echo', 'fable', 'onyx', 'nova', and 'shimmer'.
response_formatStringformat to audio in, supported formats are 'mp3', 'opus', 'aac', 'flac', 'wav', and 'pcm'.
tokenStringAPI token

Return
TypeDescription
Pair<String,ByteArrayRef>response with type and content, Nil if unsuccessful

Generates audio from the input text

function : Speak(model:String, input:String, voice:String, response_format:String, speed:Float, token:String) ~ Pair<String,ByteArrayRef>
Parameters
NameTypeDescription
modelStringavailable TTS models 'tts-1' or 'tts-1-hd'
inputStringthe text to generate audio for, the maximum length is 4096 characters
voiceStringvoice to use when generating the audio. Supported voices are alloy, 'echo', 'fable', 'onyx', 'nova', and 'shimmer'.
response_formatStringformat to audio in, supported formats are 'mp3', 'opus', 'aac', 'flac', 'wav', and 'pcm'.
speedFloatspeed of the generated audio 0.25 to 4.0. 1.0 is the default.
tokenStringAPI token

Return
TypeDescription
Pair<String,ByteArrayRef>response with type and content, Nil if unsuccessful