Class SpeechCreateParams
- 
                    
                    - All Implemented Interfaces:
- 
                            
                            com.openai.core.Params
 
 public final class SpeechCreateParams implements Params Generates audio from the input text. 
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public final classSpeechCreateParams.BuilderA builder for SpeechCreateParams. public final classSpeechCreateParams.Bodypublic final classSpeechCreateParams.VoiceThe voice to use when generating the audio. Supported voices are alloy,ash,ballad,coral,echo,fable,onyx,nova,sage,shimmer, andverse. Previews of the voices are available in the Text to speech guide.public final classSpeechCreateParams.ResponseFormatThe format to audio in. Supported formats are mp3,opus,aac,flac,wav, andpcm.public final classSpeechCreateParams.StreamFormatThe format to stream the audio in. Supported formats are sseandaudio.sseis not supported fortts-1ortts-1-hd.
 - 
                                
                            
                                Method SummaryModifier and Type Method Description final Stringinput()The text to generate audio for. final SpeechModelmodel()One of the available TTS models: tts-1,tts-1-hdorgpt-4o-mini-tts.final SpeechCreateParams.Voicevoice()The voice to use when generating the audio. final Optional<String>instructions()Control the voice of your generated audio with additional instructions. final Optional<SpeechCreateParams.ResponseFormat>responseFormat()The format to audio in. final Optional<Double>speed()The speed of the generated audio. final Optional<SpeechCreateParams.StreamFormat>streamFormat()The format to stream the audio in. final JsonField<String>_input()Returns the raw JSON value of input. final JsonField<SpeechModel>_model()Returns the raw JSON value of model. final JsonField<SpeechCreateParams.Voice>_voice()Returns the raw JSON value of voice. final JsonField<String>_instructions()Returns the raw JSON value of instructions. final JsonField<SpeechCreateParams.ResponseFormat>_responseFormat()Returns the raw JSON value of responseFormat. final JsonField<Double>_speed()Returns the raw JSON value of speed. final JsonField<SpeechCreateParams.StreamFormat>_streamFormat()Returns the raw JSON value of streamFormat. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final SpeechCreateParams.BuildertoBuilder()final SpeechCreateParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. Booleanequals(Object other)IntegerhashCode()StringtoString()final static SpeechCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of SpeechCreateParams. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        modelfinal SpeechModel model() One of the available TTS models: tts-1,tts-1-hdorgpt-4o-mini-tts.
 - 
                                        voicefinal SpeechCreateParams.Voice voice() The voice to use when generating the audio. Supported voices are alloy,ash,ballad,coral,echo,fable,onyx,nova,sage,shimmer, andverse. Previews of the voices are available in the Text to speech guide.
 - 
                                        instructionsfinal Optional<String> instructions() Control the voice of your generated audio with additional instructions. Does not work with tts-1ortts-1-hd.
 - 
                                        responseFormatfinal Optional<SpeechCreateParams.ResponseFormat> responseFormat() The format to audio in. Supported formats are mp3,opus,aac,flac,wav, andpcm.
 - 
                                        speedfinal Optional<Double> speed() The speed of the generated audio. Select a value from 0.25to4.0.1.0is the default.
 - 
                                        streamFormatfinal Optional<SpeechCreateParams.StreamFormat> streamFormat() The format to stream the audio in. Supported formats are sseandaudio.sseis not supported fortts-1ortts-1-hd.
 - 
                                        _inputfinal JsonField<String> _input() Returns the raw JSON value of input. Unlike input, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _modelfinal JsonField<SpeechModel> _model() Returns the raw JSON value of model. Unlike model, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _voicefinal JsonField<SpeechCreateParams.Voice> _voice() Returns the raw JSON value of voice. Unlike voice, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _instructionsfinal JsonField<String> _instructions() Returns the raw JSON value of instructions. Unlike instructions, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _responseFormatfinal JsonField<SpeechCreateParams.ResponseFormat> _responseFormat() Returns the raw JSON value of responseFormat. Unlike responseFormat, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _speedfinal JsonField<Double> _speed() Returns the raw JSON value of speed. Unlike speed, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _streamFormatfinal JsonField<SpeechCreateParams.StreamFormat> _streamFormat() Returns the raw JSON value of streamFormat. Unlike streamFormat, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _additionalBodyPropertiesfinal Map<String, JsonValue> _additionalBodyProperties() 
 - 
                                        _additionalHeadersfinal Headers _additionalHeaders() Additional headers to send with the request. 
 - 
                                        _additionalQueryParamsfinal QueryParams _additionalQueryParams() Additional query param to send with the request. 
 - 
                                        toBuilderfinal SpeechCreateParams.Builder toBuilder() 
 - 
                                        _bodyfinal SpeechCreateParams.Body _body() 
 - 
                                        _headersHeaders _headers() The full set of headers in the parameters, including both fixed and additional headers. 
 - 
                                        _queryParamsQueryParams _queryParams() The full set of query params in the parameters, including both fixed and additional query params. 
 - 
                                        builderfinal static SpeechCreateParams.Builder builder() Returns a mutable builder for constructing an instance of SpeechCreateParams. The following fields are required: .input() .model() .voice()
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-