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
@SerialName(value = "input")
val input: String

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

Link copied to clipboard
@SerialName(value = "model")
val model: ModelId

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

Link copied to clipboard
@SerialName(value = "response_format")
val responseFormat: SpeechResponseFormat? = null

The format to audio in.

Link copied to clipboard
@SerialName(value = "speed")
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
@SerialName(value = "voice")
val voice: Voice? = null

The voice to use when generating the audio