Class Batch.Builder
- 
                    
                    
- All Implemented Interfaces:
 
public final class Batch.BuilderA builder for Batch.
 
- 
                
                    
                    
- 
                                
                            
                                
Method Summary
Modifier and Type Method Description final Batch.Builderid(String id)final Batch.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final Batch.BuildercompletionWindow(String completionWindow)The time frame within which the batch should be processed. final Batch.BuildercompletionWindow(JsonField<String> completionWindow)Sets Builder.completionWindow to an arbitrary JSON value. final Batch.BuildercreatedAt(Long createdAt)The Unix timestamp (in seconds) for when the batch was created. final Batch.BuildercreatedAt(JsonField<Long> createdAt)Sets Builder.createdAt to an arbitrary JSON value. final Batch.Builderendpoint(String endpoint)The OpenAI API endpoint used by the batch. final Batch.Builderendpoint(JsonField<String> endpoint)Sets Builder.endpoint to an arbitrary JSON value. final Batch.BuilderinputFileId(String inputFileId)The ID of the input file for the batch. final Batch.BuilderinputFileId(JsonField<String> inputFileId)Sets Builder.inputFileId to an arbitrary JSON value. final Batch.Builderobject_(JsonValue object_)Sets the field to an arbitrary JSON value. final Batch.Builderstatus(Batch.Status status)The current status of the batch. final Batch.Builderstatus(JsonField<Batch.Status> status)Sets Builder.status to an arbitrary JSON value. final Batch.BuildercancelledAt(Long cancelledAt)The Unix timestamp (in seconds) for when the batch was cancelled. final Batch.BuildercancelledAt(JsonField<Long> cancelledAt)Sets Builder.cancelledAt to an arbitrary JSON value. final Batch.BuildercancellingAt(Long cancellingAt)The Unix timestamp (in seconds) for when the batch started cancelling. final Batch.BuildercancellingAt(JsonField<Long> cancellingAt)Sets Builder.cancellingAt to an arbitrary JSON value. final Batch.BuildercompletedAt(Long completedAt)The Unix timestamp (in seconds) for when the batch was completed. final Batch.BuildercompletedAt(JsonField<Long> completedAt)Sets Builder.completedAt to an arbitrary JSON value. final Batch.BuildererrorFileId(String errorFileId)The ID of the file containing the outputs of requests with errors. final Batch.BuildererrorFileId(JsonField<String> errorFileId)Sets Builder.errorFileId to an arbitrary JSON value. final Batch.Buildererrors(Batch.Errors errors)final Batch.Buildererrors(JsonField<Batch.Errors> errors)Sets Builder.errors to an arbitrary JSON value. final Batch.BuilderexpiredAt(Long expiredAt)The Unix timestamp (in seconds) for when the batch expired. final Batch.BuilderexpiredAt(JsonField<Long> expiredAt)Sets Builder.expiredAt to an arbitrary JSON value. final Batch.BuilderexpiresAt(Long expiresAt)The Unix timestamp (in seconds) for when the batch will expire. final Batch.BuilderexpiresAt(JsonField<Long> expiresAt)Sets Builder.expiresAt to an arbitrary JSON value. final Batch.BuilderfailedAt(Long failedAt)The Unix timestamp (in seconds) for when the batch failed. final Batch.BuilderfailedAt(JsonField<Long> failedAt)Sets Builder.failedAt to an arbitrary JSON value. final Batch.BuilderfinalizingAt(Long finalizingAt)The Unix timestamp (in seconds) for when the batch started finalizing. final Batch.BuilderfinalizingAt(JsonField<Long> finalizingAt)Sets Builder.finalizingAt to an arbitrary JSON value. final Batch.BuilderinProgressAt(Long inProgressAt)The Unix timestamp (in seconds) for when the batch started processing. final Batch.BuilderinProgressAt(JsonField<Long> inProgressAt)Sets Builder.inProgressAt to an arbitrary JSON value. final Batch.Buildermetadata(Batch.Metadata metadata)Set of 16 key-value pairs that can be attached to an object. final Batch.Buildermetadata(Optional<Batch.Metadata> metadata)Alias for calling Builder.metadata with metadata.orElse(null).final Batch.Buildermetadata(JsonField<Batch.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final Batch.Buildermodel(String model)Model ID used to process the batch, like gpt-5-2025-08-07.final Batch.Buildermodel(JsonField<String> model)Sets Builder.model to an arbitrary JSON value. final Batch.BuilderoutputFileId(String outputFileId)The ID of the file containing the outputs of successfully executed requests. final Batch.BuilderoutputFileId(JsonField<String> outputFileId)Sets Builder.outputFileId to an arbitrary JSON value. final Batch.BuilderrequestCounts(BatchRequestCounts requestCounts)The request counts for different statuses within the batch. final Batch.BuilderrequestCounts(JsonField<BatchRequestCounts> requestCounts)Sets Builder.requestCounts to an arbitrary JSON value. final Batch.Builderusage(BatchUsage usage)Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. final Batch.Builderusage(JsonField<BatchUsage> usage)Sets Builder.usage to an arbitrary JSON value. final Batch.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final Batch.BuilderputAdditionalProperty(String key, JsonValue value)final Batch.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final Batch.BuilderremoveAdditionalProperty(String key)final Batch.BuilderremoveAllAdditionalProperties(Set<String> keys)final Batchbuild()Returns an immutable instance of Batch. - 
                    
                    
                    
- 
                                
                            
                                
Method Detail
- 
                                        
id
final Batch.Builder id(String id)
 
- 
                                        
id
final Batch.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
completionWindow
final Batch.Builder completionWindow(String completionWindow)
The time frame within which the batch should be processed.
 
- 
                                        
completionWindow
final Batch.Builder completionWindow(JsonField<String> completionWindow)
Sets Builder.completionWindow to an arbitrary JSON value.
You should usually call Builder.completionWindow with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
createdAt
final Batch.Builder createdAt(Long createdAt)
The Unix timestamp (in seconds) for when the batch was created.
 
- 
                                        
createdAt
final Batch.Builder createdAt(JsonField<Long> createdAt)
Sets Builder.createdAt to an arbitrary JSON value.
You should usually call Builder.createdAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
endpoint
final Batch.Builder endpoint(String endpoint)
The OpenAI API endpoint used by the batch.
 
- 
                                        
endpoint
final Batch.Builder endpoint(JsonField<String> endpoint)
Sets Builder.endpoint to an arbitrary JSON value.
You should usually call Builder.endpoint with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
inputFileId
final Batch.Builder inputFileId(String inputFileId)
The ID of the input file for the batch.
 
- 
                                        
inputFileId
final Batch.Builder inputFileId(JsonField<String> inputFileId)
Sets Builder.inputFileId to an arbitrary JSON value.
You should usually call Builder.inputFileId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
object_
final Batch.Builder object_(JsonValue object_)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("batch")This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
status
final Batch.Builder status(Batch.Status status)
The current status of the batch.
 
- 
                                        
status
final Batch.Builder status(JsonField<Batch.Status> status)
Sets Builder.status to an arbitrary JSON value.
You should usually call Builder.status with a well-typed Status value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
cancelledAt
final Batch.Builder cancelledAt(Long cancelledAt)
The Unix timestamp (in seconds) for when the batch was cancelled.
 
- 
                                        
cancelledAt
final Batch.Builder cancelledAt(JsonField<Long> cancelledAt)
Sets Builder.cancelledAt to an arbitrary JSON value.
You should usually call Builder.cancelledAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
cancellingAt
final Batch.Builder cancellingAt(Long cancellingAt)
The Unix timestamp (in seconds) for when the batch started cancelling.
 
- 
                                        
cancellingAt
final Batch.Builder cancellingAt(JsonField<Long> cancellingAt)
Sets Builder.cancellingAt to an arbitrary JSON value.
You should usually call Builder.cancellingAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
completedAt
final Batch.Builder completedAt(Long completedAt)
The Unix timestamp (in seconds) for when the batch was completed.
 
- 
                                        
completedAt
final Batch.Builder completedAt(JsonField<Long> completedAt)
Sets Builder.completedAt to an arbitrary JSON value.
You should usually call Builder.completedAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
errorFileId
final Batch.Builder errorFileId(String errorFileId)
The ID of the file containing the outputs of requests with errors.
 
- 
                                        
errorFileId
final Batch.Builder errorFileId(JsonField<String> errorFileId)
Sets Builder.errorFileId to an arbitrary JSON value.
You should usually call Builder.errorFileId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
errors
final Batch.Builder errors(Batch.Errors errors)
 
- 
                                        
errors
final Batch.Builder errors(JsonField<Batch.Errors> errors)
Sets Builder.errors to an arbitrary JSON value.
You should usually call Builder.errors with a well-typed Errors value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
expiredAt
final Batch.Builder expiredAt(Long expiredAt)
The Unix timestamp (in seconds) for when the batch expired.
 
- 
                                        
expiredAt
final Batch.Builder expiredAt(JsonField<Long> expiredAt)
Sets Builder.expiredAt to an arbitrary JSON value.
You should usually call Builder.expiredAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
expiresAt
final Batch.Builder expiresAt(Long expiresAt)
The Unix timestamp (in seconds) for when the batch will expire.
 
- 
                                        
expiresAt
final Batch.Builder expiresAt(JsonField<Long> expiresAt)
Sets Builder.expiresAt to an arbitrary JSON value.
You should usually call Builder.expiresAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
failedAt
final Batch.Builder failedAt(Long failedAt)
The Unix timestamp (in seconds) for when the batch failed.
 
- 
                                        
failedAt
final Batch.Builder failedAt(JsonField<Long> failedAt)
Sets Builder.failedAt to an arbitrary JSON value.
You should usually call Builder.failedAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
finalizingAt
final Batch.Builder finalizingAt(Long finalizingAt)
The Unix timestamp (in seconds) for when the batch started finalizing.
 
- 
                                        
finalizingAt
final Batch.Builder finalizingAt(JsonField<Long> finalizingAt)
Sets Builder.finalizingAt to an arbitrary JSON value.
You should usually call Builder.finalizingAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
inProgressAt
final Batch.Builder inProgressAt(Long inProgressAt)
The Unix timestamp (in seconds) for when the batch started processing.
 
- 
                                        
inProgressAt
final Batch.Builder inProgressAt(JsonField<Long> inProgressAt)
Sets Builder.inProgressAt to an arbitrary JSON value.
You should usually call Builder.inProgressAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
metadata
final Batch.Builder metadata(Batch.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.
 
- 
                                        
metadata
final Batch.Builder metadata(Optional<Batch.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null). 
- 
                                        
metadata
final Batch.Builder metadata(JsonField<Batch.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.
 
- 
                                        
model
final Batch.Builder model(String model)
Model ID used to process the batch, like
gpt-5-2025-08-07. 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. 
- 
                                        
model
final Batch.Builder model(JsonField<String> model)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
outputFileId
final Batch.Builder outputFileId(String outputFileId)
The ID of the file containing the outputs of successfully executed requests.
 
- 
                                        
outputFileId
final Batch.Builder outputFileId(JsonField<String> outputFileId)
Sets Builder.outputFileId to an arbitrary JSON value.
You should usually call Builder.outputFileId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
requestCounts
final Batch.Builder requestCounts(BatchRequestCounts requestCounts)
The request counts for different statuses within the batch.
 
- 
                                        
requestCounts
final Batch.Builder requestCounts(JsonField<BatchRequestCounts> requestCounts)
Sets Builder.requestCounts to an arbitrary JSON value.
You should usually call Builder.requestCounts with a well-typed BatchRequestCounts value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
usage
final Batch.Builder usage(BatchUsage usage)
Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. Only populated on batches created after September 7, 2025.
 
- 
                                        
usage
final Batch.Builder usage(JsonField<BatchUsage> usage)
Sets Builder.usage to an arbitrary JSON value.
You should usually call Builder.usage with a well-typed BatchUsage value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
 
- 
                                        
additionalProperties
final Batch.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
 
- 
                                        
putAdditionalProperty
final Batch.Builder putAdditionalProperty(String key, JsonValue value)
 
- 
                                        
putAllAdditionalProperties
final Batch.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
 
- 
                                        
removeAdditionalProperty
final Batch.Builder removeAdditionalProperty(String key)
 
- 
                                        
removeAllAdditionalProperties
final Batch.Builder removeAllAdditionalProperties(Set<String> keys)
 
 - 
                                        
 
 - 
                                
                            
                                
 
 - 
                    
                    
                    
 
 -