Class SpeechCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class SpeechCreateParams.Body.Builder
A builder for Body.
-
-
Method Summary
-
-
Method Detail
-
input
final SpeechCreateParams.Body.Builder input(String input)
The text to generate audio for. The maximum length is 4096 characters.
-
input
final SpeechCreateParams.Body.Builder input(JsonField<String> input)
Sets Builder.input to an arbitrary JSON value.
You should usually call Builder.input with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final SpeechCreateParams.Body.Builder model(SpeechModel model)
One of the available TTS models:
tts-1
,tts-1-hd
orgpt-4o-mini-tts
.
-
model
final SpeechCreateParams.Body.Builder model(JsonField<SpeechModel> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed SpeechModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final SpeechCreateParams.Body.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed SpeechModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
voice
final SpeechCreateParams.Body.Builder voice(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.
-
voice
final SpeechCreateParams.Body.Builder voice(JsonField<SpeechCreateParams.Voice> voice)
Sets Builder.voice to an arbitrary JSON value.
You should usually call Builder.voice with a well-typed Voice value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
voice
final SpeechCreateParams.Body.Builder voice(String value)
Sets voice to an arbitrary String.
You should usually call voice with a well-typed Voice constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
instructions
final SpeechCreateParams.Body.Builder instructions(String instructions)
Control the voice of your generated audio with additional instructions. Does not work with
tts-1
ortts-1-hd
.
-
instructions
final SpeechCreateParams.Body.Builder instructions(JsonField<String> instructions)
Sets Builder.instructions to an arbitrary JSON value.
You should usually call Builder.instructions with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
responseFormat
final SpeechCreateParams.Body.Builder responseFormat(SpeechCreateParams.ResponseFormat responseFormat)
The format to audio in. Supported formats are
mp3
,opus
,aac
,flac
,wav
, andpcm
.
-
responseFormat
final SpeechCreateParams.Body.Builder responseFormat(JsonField<SpeechCreateParams.ResponseFormat> responseFormat)
Sets Builder.responseFormat to an arbitrary JSON value.
You should usually call Builder.responseFormat with a well-typed ResponseFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
speed
final SpeechCreateParams.Body.Builder speed(Double speed)
The speed of the generated audio. Select a value from
0.25
to4.0
.1.0
is the default.
-
speed
final SpeechCreateParams.Body.Builder speed(JsonField<Double> speed)
Sets Builder.speed to an arbitrary JSON value.
You should usually call Builder.speed with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final SpeechCreateParams.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final SpeechCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final SpeechCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final SpeechCreateParams.Body.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final SpeechCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final SpeechCreateParams.Body build()
Returns an immutable instance of Body.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.input() .model() .voice()
-
-
-
-