openai_struct/models/create_speech_request.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11#[allow(unused_imports)]
12use serde_json::Value;
13
14#[derive(Debug, Serialize, Deserialize)]
15pub struct CreateSpeechRequest {
16 /// The text to generate audio for. The maximum length is 4096 characters.
17 #[serde(rename = "input")]
18 pub input: String,
19 /// Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`.
20 #[serde(rename = "instructions")]
21 pub instructions: Option<String>,
22 /// One of the available [TTS models](/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`.
23 #[serde(rename = "model")]
24 pub model: Value,
25 /// The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`.
26 #[serde(rename = "response_format")]
27 pub response_format: Option<String>,
28 /// The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default.
29 #[serde(rename = "speed")]
30 pub speed: Option<f32>,
31 /// The voice to use when generating the audio. Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in the [Text to speech guide](/docs/guides/text-to-speech#voice-options).
32 #[serde(rename = "voice")]
33 pub voice: crate::models::VoiceIdsShared,
34}