Class ChatCompletionCreateParams.Body.Builder
- 
                    
                    - All Implemented Interfaces:
 
 public final class ChatCompletionCreateParams.Body.BuilderA builder for Body. 
- 
                
                    
                    - 
                                
                            
                                Method Summary- 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        messagesfinal ChatCompletionCreateParams.Body.Builder messages(List<ChatCompletionMessageParam> messages) A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, images, and audio. 
 - 
                                        messagesfinal ChatCompletionCreateParams.Body.Builder messages(JsonField<List<ChatCompletionMessageParam>> messages) Sets Builder.messages to an arbitrary JSON value. You should usually call Builder.messages with a well-typed List<ChatCompletionMessageParam>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionMessageParam message) Adds a single ChatCompletionMessageParam to messages. 
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionDeveloperMessageParam developer) Alias for calling addMessage with ChatCompletionMessageParam.ofDeveloper(developer).
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionSystemMessageParam system) Alias for calling addMessage with ChatCompletionMessageParam.ofSystem(system).
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionUserMessageParam user) Alias for calling addMessage with ChatCompletionMessageParam.ofUser(user).
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionAssistantMessageParam assistant) Alias for calling addMessage with ChatCompletionMessageParam.ofAssistant(assistant).
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionMessage assistant) Alias for calling addMessage with assistant.toParam().
 - 
                                        addMessagefinal ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionToolMessageParam tool) Alias for calling addMessage with ChatCompletionMessageParam.ofTool(tool).
 - 
                                        addMessage@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder addMessage(ChatCompletionFunctionMessageParam function) Alias for calling addMessage with ChatCompletionMessageParam.ofFunction(function).
 - 
                                        addDeveloperMessagefinal ChatCompletionCreateParams.Body.Builder addDeveloperMessage(ChatCompletionDeveloperMessageParam.Content content) Alias for calling addMessage with the following: ChatCompletionDeveloperMessageParam.builder() .content(content) .build()
 - 
                                        addDeveloperMessagefinal ChatCompletionCreateParams.Body.Builder addDeveloperMessage(String text) Alias for calling addDeveloperMessage with ChatCompletionDeveloperMessageParam.Content.ofText(text).
 - 
                                        addDeveloperMessageOfArrayOfContentPartsfinal ChatCompletionCreateParams.Body.Builder addDeveloperMessageOfArrayOfContentParts(List<ChatCompletionContentPartText> arrayOfContentParts) Alias for calling addDeveloperMessage with ChatCompletionDeveloperMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts).
 - 
                                        addSystemMessagefinal ChatCompletionCreateParams.Body.Builder addSystemMessage(ChatCompletionSystemMessageParam.Content content) Alias for calling addMessage with the following: ChatCompletionSystemMessageParam.builder() .content(content) .build()
 - 
                                        addSystemMessagefinal ChatCompletionCreateParams.Body.Builder addSystemMessage(String text) Alias for calling addSystemMessage with ChatCompletionSystemMessageParam.Content.ofText(text).
 - 
                                        addSystemMessageOfArrayOfContentPartsfinal ChatCompletionCreateParams.Body.Builder addSystemMessageOfArrayOfContentParts(List<ChatCompletionContentPartText> arrayOfContentParts) Alias for calling addSystemMessage with ChatCompletionSystemMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts).
 - 
                                        addUserMessagefinal ChatCompletionCreateParams.Body.Builder addUserMessage(ChatCompletionUserMessageParam.Content content) Alias for calling addMessage with the following: ChatCompletionUserMessageParam.builder() .content(content) .build()
 - 
                                        addUserMessagefinal ChatCompletionCreateParams.Body.Builder addUserMessage(String text) Alias for calling addUserMessage with ChatCompletionUserMessageParam.Content.ofText(text).
 - 
                                        addUserMessageOfArrayOfContentPartsfinal ChatCompletionCreateParams.Body.Builder addUserMessageOfArrayOfContentParts(List<ChatCompletionContentPart> arrayOfContentParts) Alias for calling addUserMessage with ChatCompletionUserMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts).
 - 
                                        addAssistantMessagefinal ChatCompletionCreateParams.Body.Builder addAssistantMessage(ChatCompletionAssistantMessageParam.Content content) Alias for calling addMessage with the following: ChatCompletionAssistantMessageParam.builder() .content(content) .build()
 - 
                                        addAssistantMessagefinal ChatCompletionCreateParams.Body.Builder addAssistantMessage(Optional<ChatCompletionAssistantMessageParam.Content> content) Alias for calling addAssistantMessage with content.orElse(null).
 - 
                                        addAssistantMessagefinal ChatCompletionCreateParams.Body.Builder addAssistantMessage(String text) Alias for calling addAssistantMessage with ChatCompletionAssistantMessageParam.Content.ofText(text).
 - 
                                        addAssistantMessageOfArrayOfContentPartsfinal ChatCompletionCreateParams.Body.Builder addAssistantMessageOfArrayOfContentParts(List<ChatCompletionAssistantMessageParam.Content.ChatCompletionRequestAssistantMessageContentPart> arrayOfContentParts) Alias for calling addAssistantMessage with ChatCompletionAssistantMessageParam.Content.ofArrayOfContentParts(arrayOfContentParts).
 - 
                                        modelfinal ChatCompletionCreateParams.Body.Builder model(ChatModel model) Model ID used to generate the response, like gpt-4ooro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
 - 
                                        modelfinal ChatCompletionCreateParams.Body.Builder model(JsonField<ChatModel> model) Sets Builder.model to an arbitrary JSON value. You should usually call Builder.model with a well-typed ChatModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        modelfinal ChatCompletionCreateParams.Body.Builder model(String value) Sets model to an arbitrary String. You should usually call model with a well-typed ChatModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        audiofinal ChatCompletionCreateParams.Body.Builder audio(ChatCompletionAudioParam audio) Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
 - 
                                        audiofinal ChatCompletionCreateParams.Body.Builder audio(Optional<ChatCompletionAudioParam> audio) Alias for calling Builder.audio with audio.orElse(null).
 - 
                                        audiofinal ChatCompletionCreateParams.Body.Builder audio(JsonField<ChatCompletionAudioParam> audio) Sets Builder.audio to an arbitrary JSON value. You should usually call Builder.audio with a well-typed ChatCompletionAudioParam value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        frequencyPenaltyfinal ChatCompletionCreateParams.Body.Builder frequencyPenalty(Double frequencyPenalty) Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. 
 - 
                                        frequencyPenaltyfinal ChatCompletionCreateParams.Body.Builder frequencyPenalty(Double frequencyPenalty) Alias for Builder.frequencyPenalty. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        frequencyPenaltyfinal ChatCompletionCreateParams.Body.Builder frequencyPenalty(Optional<Double> frequencyPenalty) Alias for calling Builder.frequencyPenalty with frequencyPenalty.orElse(null).
 - 
                                        frequencyPenaltyfinal ChatCompletionCreateParams.Body.Builder frequencyPenalty(JsonField<Double> frequencyPenalty) Sets Builder.frequencyPenalty to an arbitrary JSON value. You should usually call Builder.frequencyPenalty with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        functionCall@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functionCall(ChatCompletionCreateParams.FunctionCall functionCall) Deprecated in favor of tool_choice.Controls which (if any) function is called by the model. nonemeans the model will not call a function and instead generates a message.automeans the model can pick between generating a message or calling a function.Specifying a particular function via {"name": "my_function"}forces the model to call that function.noneis the default when no functions are present.autois the default if functions are present.
 - 
                                        functionCall@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functionCall(JsonField<ChatCompletionCreateParams.FunctionCall> functionCall) Sets Builder.functionCall to an arbitrary JSON value. You should usually call Builder.functionCall with a well-typed FunctionCall value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        functionCall@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functionCall(ChatCompletionCreateParams.FunctionCall.FunctionCallMode mode) Alias for calling functionCall with FunctionCall.ofMode(mode).
 - 
                                        functionCall@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functionCall(ChatCompletionFunctionCallOption functionCallOption) Alias for calling functionCall with FunctionCall.ofFunctionCallOption(functionCallOption).
 - 
                                        functions@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functions(List<ChatCompletionCreateParams.Function> functions) Deprecated in favor of tools.A list of functions the model may generate JSON inputs for. 
 - 
                                        functions@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder functions(JsonField<List<ChatCompletionCreateParams.Function>> functions) Sets Builder.functions to an arbitrary JSON value. You should usually call Builder.functions with a well-typed List<Function>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 - 
                                        addFunction@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder addFunction(ChatCompletionCreateParams.Function function) 
 - 
                                        logitBiasfinal ChatCompletionCreateParams.Body.Builder logitBias(ChatCompletionCreateParams.LogitBias logitBias) Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. 
 - 
                                        logitBiasfinal ChatCompletionCreateParams.Body.Builder logitBias(Optional<ChatCompletionCreateParams.LogitBias> logitBias) Alias for calling Builder.logitBias with logitBias.orElse(null).
 - 
                                        logitBiasfinal ChatCompletionCreateParams.Body.Builder logitBias(JsonField<ChatCompletionCreateParams.LogitBias> logitBias) Sets Builder.logitBias to an arbitrary JSON value. You should usually call Builder.logitBias with a well-typed LogitBias value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        logprobsfinal ChatCompletionCreateParams.Body.Builder logprobs(Boolean logprobs) Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the contentofmessage.
 - 
                                        logprobsfinal ChatCompletionCreateParams.Body.Builder logprobs(Boolean logprobs) Alias for Builder.logprobs. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        logprobsfinal ChatCompletionCreateParams.Body.Builder logprobs(Optional<Boolean> logprobs) Alias for calling Builder.logprobs with logprobs.orElse(null).
 - 
                                        logprobsfinal ChatCompletionCreateParams.Body.Builder logprobs(JsonField<Boolean> logprobs) Sets Builder.logprobs to an arbitrary JSON value. You should usually call Builder.logprobs with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        maxCompletionTokensfinal ChatCompletionCreateParams.Body.Builder maxCompletionTokens(Long maxCompletionTokens) An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. 
 - 
                                        maxCompletionTokensfinal ChatCompletionCreateParams.Body.Builder maxCompletionTokens(Long maxCompletionTokens) Alias for Builder.maxCompletionTokens. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        maxCompletionTokensfinal ChatCompletionCreateParams.Body.Builder maxCompletionTokens(Optional<Long> maxCompletionTokens) Alias for calling Builder.maxCompletionTokens with maxCompletionTokens.orElse(null).
 - 
                                        maxCompletionTokensfinal ChatCompletionCreateParams.Body.Builder maxCompletionTokens(JsonField<Long> maxCompletionTokens) Sets Builder.maxCompletionTokens to an arbitrary JSON value. You should usually call Builder.maxCompletionTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        maxTokens@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder maxTokens(Long maxTokens) The maximum number of /tokenizer that can be generated in the chat completion. This value can be used to control costs for text generated via API. This value is now deprecated in favor of max_completion_tokens, and is not compatible with o-series models.
 - 
                                        maxTokens@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder maxTokens(Long maxTokens) Alias for Builder.maxTokens. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        maxTokens@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder maxTokens(Optional<Long> maxTokens) Alias for calling Builder.maxTokens with maxTokens.orElse(null).
 - 
                                        maxTokens@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder maxTokens(JsonField<Long> maxTokens) Sets Builder.maxTokens to an arbitrary JSON value. You should usually call Builder.maxTokens with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        metadatafinal ChatCompletionCreateParams.Body.Builder metadata(ChatCompletionCreateParams.Metadata metadata) Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. 
 - 
                                        metadatafinal ChatCompletionCreateParams.Body.Builder metadata(Optional<ChatCompletionCreateParams.Metadata> metadata) Alias for calling Builder.metadata with metadata.orElse(null).
 - 
                                        metadatafinal ChatCompletionCreateParams.Body.Builder metadata(JsonField<ChatCompletionCreateParams.Metadata> metadata) Sets Builder.metadata to an arbitrary JSON value. You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        modalitiesfinal ChatCompletionCreateParams.Body.Builder modalities(List<ChatCompletionCreateParams.Modality> modalities) Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]The gpt-4o-audio-previewmodel can also be used to generate audio. To request that this model generate both text and audio responses, you can use:["text", "audio"]
 - 
                                        modalitiesfinal ChatCompletionCreateParams.Body.Builder modalities(Optional<List<ChatCompletionCreateParams.Modality>> modalities) Alias for calling Builder.modalities with modalities.orElse(null).
 - 
                                        modalitiesfinal ChatCompletionCreateParams.Body.Builder modalities(JsonField<List<ChatCompletionCreateParams.Modality>> modalities) Sets Builder.modalities to an arbitrary JSON value. You should usually call Builder.modalities with a well-typed List<Modality>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 - 
                                        addModalityfinal ChatCompletionCreateParams.Body.Builder addModality(ChatCompletionCreateParams.Modality modality) Adds a single Modality to modalities. 
 - 
                                        nfinal ChatCompletionCreateParams.Body.Builder n(Long n) How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep nas1to minimize costs.
 - 
                                        nfinal ChatCompletionCreateParams.Body.Builder n(Long n) Alias for Builder.n. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        nfinal ChatCompletionCreateParams.Body.Builder n(Optional<Long> n) Alias for calling Builder.n with n.orElse(null).
 - 
                                        nfinal ChatCompletionCreateParams.Body.Builder n(JsonField<Long> n) Sets Builder.n to an arbitrary JSON value. You should usually call Builder.n with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        parallelToolCallsfinal ChatCompletionCreateParams.Body.Builder parallelToolCalls(Boolean parallelToolCalls) Whether to enable parallel function calling during tool use. 
 - 
                                        parallelToolCallsfinal ChatCompletionCreateParams.Body.Builder parallelToolCalls(JsonField<Boolean> parallelToolCalls) Sets Builder.parallelToolCalls to an arbitrary JSON value. You should usually call Builder.parallelToolCalls with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        predictionfinal ChatCompletionCreateParams.Body.Builder prediction(ChatCompletionPredictionContent prediction) Static predicted output content, such as the content of a text file that is being regenerated. 
 - 
                                        predictionfinal ChatCompletionCreateParams.Body.Builder prediction(Optional<ChatCompletionPredictionContent> prediction) Alias for calling Builder.prediction with prediction.orElse(null).
 - 
                                        predictionfinal ChatCompletionCreateParams.Body.Builder prediction(JsonField<ChatCompletionPredictionContent> prediction) Sets Builder.prediction to an arbitrary JSON value. You should usually call Builder.prediction with a well-typed ChatCompletionPredictionContent value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        presencePenaltyfinal ChatCompletionCreateParams.Body.Builder presencePenalty(Double presencePenalty) Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. 
 - 
                                        presencePenaltyfinal ChatCompletionCreateParams.Body.Builder presencePenalty(Double presencePenalty) Alias for Builder.presencePenalty. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        presencePenaltyfinal ChatCompletionCreateParams.Body.Builder presencePenalty(Optional<Double> presencePenalty) Alias for calling Builder.presencePenalty with presencePenalty.orElse(null).
 - 
                                        presencePenaltyfinal ChatCompletionCreateParams.Body.Builder presencePenalty(JsonField<Double> presencePenalty) Sets Builder.presencePenalty to an arbitrary JSON value. You should usually call Builder.presencePenalty with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        promptCacheKeyfinal ChatCompletionCreateParams.Body.Builder promptCacheKey(String promptCacheKey) Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the userfield. Learn more.
 - 
                                        promptCacheKeyfinal ChatCompletionCreateParams.Body.Builder promptCacheKey(JsonField<String> promptCacheKey) Sets Builder.promptCacheKey to an arbitrary JSON value. You should usually call Builder.promptCacheKey with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        reasoningEffortfinal ChatCompletionCreateParams.Body.Builder reasoningEffort(ReasoningEffort reasoningEffort) Constrains effort on reasoning for reasoning models. Currently supported values are minimal,low,medium, andhigh. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.Note: The gpt-5-promodel defaults to (and only supports)highreasoning effort.
 - 
                                        reasoningEffortfinal ChatCompletionCreateParams.Body.Builder reasoningEffort(Optional<ReasoningEffort> reasoningEffort) Alias for calling Builder.reasoningEffort with reasoningEffort.orElse(null).
 - 
                                        reasoningEffortfinal ChatCompletionCreateParams.Body.Builder reasoningEffort(JsonField<ReasoningEffort> reasoningEffort) Sets Builder.reasoningEffort to an arbitrary JSON value. You should usually call Builder.reasoningEffort with a well-typed ReasoningEffort value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        responseFormatfinal ChatCompletionCreateParams.Body.Builder responseFormat(ChatCompletionCreateParams.ResponseFormat responseFormat) An object specifying the format that the model must output. Setting to { "type": "json_schema", "json_schema": {...} }enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.Setting to { "type": "json_object" }enables the older JSON mode, which ensures the message the model generates is valid JSON. Usingjson_schemais preferred for models that support it.
 - 
                                        responseFormatfinal ChatCompletionCreateParams.Body.Builder responseFormat(JsonField<ChatCompletionCreateParams.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. 
 - 
                                        responseFormatfinal ChatCompletionCreateParams.Body.Builder responseFormat(ResponseFormatText text) Alias for calling responseFormat with ResponseFormat.ofText(text).
 - 
                                        responseFormatfinal ChatCompletionCreateParams.Body.Builder responseFormat(ResponseFormatJsonSchema jsonSchema) Alias for calling responseFormat with ResponseFormat.ofJsonSchema(jsonSchema).
 - 
                                        responseFormatfinal ChatCompletionCreateParams.Body.Builder responseFormat(ResponseFormatJsonObject jsonObject) Alias for calling responseFormat with ResponseFormat.ofJsonObject(jsonObject).
 - 
                                        safetyIdentifierfinal ChatCompletionCreateParams.Body.Builder safetyIdentifier(String safetyIdentifier) A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. Learn more. 
 - 
                                        safetyIdentifierfinal ChatCompletionCreateParams.Body.Builder safetyIdentifier(JsonField<String> safetyIdentifier) Sets Builder.safetyIdentifier to an arbitrary JSON value. You should usually call Builder.safetyIdentifier with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        seed@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder seed(Long seed) This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seedand parameters should return the same result. Determinism is not guaranteed, and you should refer to thesystem_fingerprintresponse parameter to monitor changes in the backend.
 - 
                                        seed@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder seed(Long seed) Alias for Builder.seed. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        seed@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder seed(Optional<Long> seed) Alias for calling Builder.seed with seed.orElse(null).
 - 
                                        seed@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder seed(JsonField<Long> seed) Sets Builder.seed to an arbitrary JSON value. You should usually call Builder.seed with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        serviceTierfinal ChatCompletionCreateParams.Body.Builder serviceTier(ChatCompletionCreateParams.ServiceTier serviceTier) Specifies the processing type used for serving the request. - If set to 'auto', then the request will be processed with the service tier configured in the Project settings. Unless otherwise configured, the Project will use 'default'. 
- If set to 'default', then the request will be processed with the standard pricing and performance for the selected model. 
- If set to 'flex' or 'priority', then the request will be processed with the corresponding service tier. 
- When not set, the default behavior is 'auto'. 
 When the service_tierparameter is set, the response body will include theservice_tiervalue based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter.
 - 
                                        serviceTierfinal ChatCompletionCreateParams.Body.Builder serviceTier(Optional<ChatCompletionCreateParams.ServiceTier> serviceTier) Alias for calling Builder.serviceTier with serviceTier.orElse(null).
 - 
                                        serviceTierfinal ChatCompletionCreateParams.Body.Builder serviceTier(JsonField<ChatCompletionCreateParams.ServiceTier> serviceTier) Sets Builder.serviceTier to an arbitrary JSON value. You should usually call Builder.serviceTier with a well-typed ServiceTier value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        stopfinal ChatCompletionCreateParams.Body.Builder stop(ChatCompletionCreateParams.Stop stop) Not supported with latest reasoning models o3ando4-mini.Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. 
 - 
                                        stopfinal ChatCompletionCreateParams.Body.Builder stop(Optional<ChatCompletionCreateParams.Stop> stop) Alias for calling Builder.stop with stop.orElse(null).
 - 
                                        stopfinal ChatCompletionCreateParams.Body.Builder stop(JsonField<ChatCompletionCreateParams.Stop> stop) Sets Builder.stop to an arbitrary JSON value. You should usually call Builder.stop with a well-typed Stop value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        stopfinal ChatCompletionCreateParams.Body.Builder stop(String string) Alias for calling stop with Stop.ofString(string).
 - 
                                        stopOfStringsfinal ChatCompletionCreateParams.Body.Builder stopOfStrings(List<String> strings) Alias for calling stop with Stop.ofStrings(strings).
 - 
                                        storefinal ChatCompletionCreateParams.Body.Builder store(Boolean store) Whether or not to store the output of this chat completion request for use in our model distillation or evals products. Supports text and image inputs. Note: image inputs over 8MB will be dropped. 
 - 
                                        storefinal ChatCompletionCreateParams.Body.Builder store(Boolean store) Alias for Builder.store. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        storefinal ChatCompletionCreateParams.Body.Builder store(Optional<Boolean> store) Alias for calling Builder.store with store.orElse(null).
 - 
                                        storefinal ChatCompletionCreateParams.Body.Builder store(JsonField<Boolean> store) Sets Builder.store to an arbitrary JSON value. You should usually call Builder.store with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        streamOptionsfinal ChatCompletionCreateParams.Body.Builder streamOptions(ChatCompletionStreamOptions streamOptions) Options for streaming response. Only set this when you set stream: true.
 - 
                                        streamOptionsfinal ChatCompletionCreateParams.Body.Builder streamOptions(Optional<ChatCompletionStreamOptions> streamOptions) Alias for calling Builder.streamOptions with streamOptions.orElse(null).
 - 
                                        streamOptionsfinal ChatCompletionCreateParams.Body.Builder streamOptions(JsonField<ChatCompletionStreamOptions> streamOptions) Sets Builder.streamOptions to an arbitrary JSON value. You should usually call Builder.streamOptions with a well-typed ChatCompletionStreamOptions value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        temperaturefinal ChatCompletionCreateParams.Body.Builder temperature(Double temperature) What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_pbut not both.
 - 
                                        temperaturefinal ChatCompletionCreateParams.Body.Builder temperature(Double temperature) Alias for Builder.temperature. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        temperaturefinal ChatCompletionCreateParams.Body.Builder temperature(Optional<Double> temperature) Alias for calling Builder.temperature with temperature.orElse(null).
 - 
                                        temperaturefinal ChatCompletionCreateParams.Body.Builder temperature(JsonField<Double> temperature) Sets Builder.temperature to an arbitrary JSON value. You should usually call Builder.temperature with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(ChatCompletionToolChoiceOption toolChoice) Controls which (if any) tool is called by the model. nonemeans the model will not call any tool and instead generates a message.automeans the model can pick between generating a message or calling one or more tools.requiredmeans the model must call one or more tools. Specifying a particular tool via{"type": "function", "function": {"name": "my_function"}}forces the model to call that tool.noneis the default when no tools are present.autois the default if tools are present.
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(JsonField<ChatCompletionToolChoiceOption> toolChoice) Sets Builder.toolChoice to an arbitrary JSON value. You should usually call Builder.toolChoice with a well-typed ChatCompletionToolChoiceOption value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(ChatCompletionToolChoiceOption.Auto auto) Alias for calling toolChoice with ChatCompletionToolChoiceOption.ofAuto(auto).
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(ChatCompletionAllowedToolChoice allowedToolChoice) Alias for calling toolChoice with ChatCompletionToolChoiceOption.ofAllowedToolChoice(allowedToolChoice).
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(ChatCompletionNamedToolChoice namedToolChoice) Alias for calling toolChoice with ChatCompletionToolChoiceOption.ofNamedToolChoice(namedToolChoice).
 - 
                                        toolChoicefinal ChatCompletionCreateParams.Body.Builder toolChoice(ChatCompletionNamedToolChoiceCustom namedToolChoiceCustom) Alias for calling toolChoice with ChatCompletionToolChoiceOption.ofNamedToolChoiceCustom(namedToolChoiceCustom).
 - 
                                        toolsfinal ChatCompletionCreateParams.Body.Builder tools(List<ChatCompletionTool> tools) A list of tools the model may call. You can provide either custom tools or function tools. 
 - 
                                        toolsfinal ChatCompletionCreateParams.Body.Builder tools(JsonField<List<ChatCompletionTool>> tools) Sets Builder.tools to an arbitrary JSON value. You should usually call Builder.tools with a well-typed List<ChatCompletionTool>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 - 
                                        addToolfinal ChatCompletionCreateParams.Body.Builder addTool(ChatCompletionTool tool) Adds a single ChatCompletionTool to tools. 
 - 
                                        addToolfinal ChatCompletionCreateParams.Body.Builder addTool(ChatCompletionFunctionTool function) Alias for calling addTool with ChatCompletionTool.ofFunction(function).
 - 
                                        addToolfinal ChatCompletionCreateParams.Body.Builder addTool(ChatCompletionCustomTool custom) Alias for calling addTool with ChatCompletionTool.ofCustom(custom).
 - 
                                        addFunctionToolfinal ChatCompletionCreateParams.Body.Builder addFunctionTool(FunctionDefinition function) Alias for calling addTool with the following: ChatCompletionFunctionTool.builder() .function(function) .build()
 - 
                                        addCustomToolfinal ChatCompletionCreateParams.Body.Builder addCustomTool(ChatCompletionCustomTool.Custom custom) Alias for calling addTool with the following: ChatCompletionCustomTool.builder() .custom(custom) .build()
 - 
                                        topLogprobsfinal ChatCompletionCreateParams.Body.Builder topLogprobs(Long topLogprobs) An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobsmust be set totrueif this parameter is used.
 - 
                                        topLogprobsfinal ChatCompletionCreateParams.Body.Builder topLogprobs(Long topLogprobs) Alias for Builder.topLogprobs. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        topLogprobsfinal ChatCompletionCreateParams.Body.Builder topLogprobs(Optional<Long> topLogprobs) Alias for calling Builder.topLogprobs with topLogprobs.orElse(null).
 - 
                                        topLogprobsfinal ChatCompletionCreateParams.Body.Builder topLogprobs(JsonField<Long> topLogprobs) Sets Builder.topLogprobs to an arbitrary JSON value. You should usually call Builder.topLogprobs with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        topPfinal ChatCompletionCreateParams.Body.Builder topP(Double topP) An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperaturebut not both.
 - 
                                        topPfinal ChatCompletionCreateParams.Body.Builder topP(Double topP) Alias for Builder.topP. This unboxed primitive overload exists for backwards compatibility. 
 - 
                                        topPfinal ChatCompletionCreateParams.Body.Builder topP(Optional<Double> topP) Alias for calling Builder.topP with topP.orElse(null).
 - 
                                        topPfinal ChatCompletionCreateParams.Body.Builder topP(JsonField<Double> topP) Sets Builder.topP to an arbitrary JSON value. You should usually call Builder.topP with a well-typed Double value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        user@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder user(String user) This field is being replaced by safety_identifierandprompt_cache_key. Useprompt_cache_keyinstead to maintain caching optimizations. A stable identifier for your end-users. Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. Learn more.
 - 
                                        user@Deprecated(message = "deprecated") final ChatCompletionCreateParams.Body.Builder user(JsonField<String> user) Sets Builder.user to an arbitrary JSON value. You should usually call Builder.user with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        verbosityfinal ChatCompletionCreateParams.Body.Builder verbosity(ChatCompletionCreateParams.Verbosity verbosity) Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses. Currently supported values are low,medium, andhigh.
 - 
                                        verbosityfinal ChatCompletionCreateParams.Body.Builder verbosity(Optional<ChatCompletionCreateParams.Verbosity> verbosity) Alias for calling Builder.verbosity with verbosity.orElse(null).
 - 
                                        verbosityfinal ChatCompletionCreateParams.Body.Builder verbosity(JsonField<ChatCompletionCreateParams.Verbosity> verbosity) Sets Builder.verbosity to an arbitrary JSON value. You should usually call Builder.verbosity with a well-typed Verbosity value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        webSearchOptionsfinal ChatCompletionCreateParams.Body.Builder webSearchOptions(ChatCompletionCreateParams.WebSearchOptions webSearchOptions) This tool searches the web for relevant results to use in a response. Learn more about the web search tool. 
 - 
                                        webSearchOptionsfinal ChatCompletionCreateParams.Body.Builder webSearchOptions(JsonField<ChatCompletionCreateParams.WebSearchOptions> webSearchOptions) Sets Builder.webSearchOptions to an arbitrary JSON value. You should usually call Builder.webSearchOptions with a well-typed WebSearchOptions value instead. This method is primarily for setting the field to an undocumented or not yet supported value. 
 - 
                                        additionalPropertiesfinal ChatCompletionCreateParams.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties) 
 - 
                                        putAdditionalPropertyfinal ChatCompletionCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value) 
 - 
                                        putAllAdditionalPropertiesfinal ChatCompletionCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties) 
 - 
                                        removeAdditionalPropertyfinal ChatCompletionCreateParams.Body.Builder removeAdditionalProperty(String key) 
 - 
                                        removeAllAdditionalPropertiesfinal ChatCompletionCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys) 
 - 
                                        buildfinal ChatCompletionCreateParams.Body build() Returns an immutable instance of Body. Further updates to this Builder will not mutate the returned instance. The following fields are required: .messages() .model()
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-