SpeechRequest

@Serializable
data class SpeechRequest(val model: ModelId, val input: String, val voice: Voice? = null, val responseFormat: SpeechResponseFormat? = null, val speed: Double? = null)

Generates audio from the input text.

Constructors

Link copied to clipboard
constructor(model: ModelId, input: String, voice: Voice? = null, responseFormat: SpeechResponseFormat? = null, speed: Double? = null)

Properties

Link copied to clipboard

The text to generate audio for. The maximum length is 4096 characters.

Link copied to clipboard

One of the available TTS models: tts-1 or tts-1-hd

Link copied to clipboard

The format to audio in.

Link copied to clipboard
val speed: Double? = null

The speed of the generated audio. Select a value from 0.25 to 4.0. 1.0 is the default.

Link copied to clipboard
val voice: Voice? = null

The voice to use when generating the audio