Class Batch
- 
                    
                    - All Implemented Interfaces:
 
 public final class Batch
- 
                
                    
                    - 
                                
                            
                                Nested Class SummaryNested Classes Modifier and Type Class Description public final classBatch.BuilderA builder for Batch. public final classBatch.StatusThe current status of the batch. public final classBatch.Errorspublic final classBatch.MetadataSet 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. 
 - 
                                
                            
                                Method SummaryModifier and Type Method Description final Stringid()final StringcompletionWindow()The time frame within which the batch should be processed. final LongcreatedAt()The Unix timestamp (in seconds) for when the batch was created. final Stringendpoint()The OpenAI API endpoint used by the batch. final StringinputFileId()The ID of the input file for the batch. final JsonValue_object_()The object type, which is always batch.final Batch.Statusstatus()The current status of the batch. final Optional<Long>cancelledAt()The Unix timestamp (in seconds) for when the batch was cancelled. final Optional<Long>cancellingAt()The Unix timestamp (in seconds) for when the batch started cancelling. final Optional<Long>completedAt()The Unix timestamp (in seconds) for when the batch was completed. final Optional<String>errorFileId()The ID of the file containing the outputs of requests with errors. final Optional<Batch.Errors>errors()final Optional<Long>expiredAt()The Unix timestamp (in seconds) for when the batch expired. final Optional<Long>expiresAt()The Unix timestamp (in seconds) for when the batch will expire. final Optional<Long>failedAt()The Unix timestamp (in seconds) for when the batch failed. final Optional<Long>finalizingAt()The Unix timestamp (in seconds) for when the batch started finalizing. final Optional<Long>inProgressAt()The Unix timestamp (in seconds) for when the batch started processing. final Optional<Batch.Metadata>metadata()Set of 16 key-value pairs that can be attached to an object. final Optional<String>model()Model ID used to process the batch, like gpt-5-2025-08-07.final Optional<String>outputFileId()The ID of the file containing the outputs of successfully executed requests. final Optional<BatchRequestCounts>requestCounts()The request counts for different statuses within the batch. final Optional<BatchUsage>usage()Represents token usage details including input tokens, output tokens, a breakdown of output tokens, and the total tokens used. final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<String>_completionWindow()Returns the raw JSON value of completionWindow. final JsonField<Long>_createdAt()Returns the raw JSON value of createdAt. final JsonField<String>_endpoint()Returns the raw JSON value of endpoint. final JsonField<String>_inputFileId()Returns the raw JSON value of inputFileId. final JsonField<Batch.Status>_status()Returns the raw JSON value of status. final JsonField<Long>_cancelledAt()Returns the raw JSON value of cancelledAt. final JsonField<Long>_cancellingAt()Returns the raw JSON value of cancellingAt. final JsonField<Long>_completedAt()Returns the raw JSON value of completedAt. final JsonField<String>_errorFileId()Returns the raw JSON value of errorFileId. final JsonField<Batch.Errors>_errors()Returns the raw JSON value of errors. final JsonField<Long>_expiredAt()Returns the raw JSON value of expiredAt. final JsonField<Long>_expiresAt()Returns the raw JSON value of expiresAt. final JsonField<Long>_failedAt()Returns the raw JSON value of failedAt. final JsonField<Long>_finalizingAt()Returns the raw JSON value of finalizingAt. final JsonField<Long>_inProgressAt()Returns the raw JSON value of inProgressAt. final JsonField<Batch.Metadata>_metadata()Returns the raw JSON value of metadata. final JsonField<String>_model()Returns the raw JSON value of model. final JsonField<String>_outputFileId()Returns the raw JSON value of outputFileId. final JsonField<BatchRequestCounts>_requestCounts()Returns the raw JSON value of requestCounts. final JsonField<BatchUsage>_usage()Returns the raw JSON value of usage. final Map<String, JsonValue>_additionalProperties()final Batch.BuildertoBuilder()final Batchvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Batch.Builderbuilder()Returns a mutable builder for constructing an instance of Batch. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        completionWindowfinal String completionWindow() The time frame within which the batch should be processed. 
 - 
                                        inputFileIdfinal String inputFileId() The ID of the input file for the batch. 
 - 
                                        _object_final JsonValue _object_() The object type, which is always batch.Expected to always return the following: JsonValue.from("batch")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value). 
 - 
                                        statusfinal Batch.Status status() The current status of the batch. 
 - 
                                        cancelledAtfinal Optional<Long> cancelledAt() The Unix timestamp (in seconds) for when the batch was cancelled. 
 - 
                                        cancellingAtfinal Optional<Long> cancellingAt() The Unix timestamp (in seconds) for when the batch started cancelling. 
 - 
                                        completedAtfinal Optional<Long> completedAt() The Unix timestamp (in seconds) for when the batch was completed. 
 - 
                                        errorFileIdfinal Optional<String> errorFileId() The ID of the file containing the outputs of requests with errors. 
 - 
                                        errorsfinal Optional<Batch.Errors> errors() 
 - 
                                        expiredAtfinal Optional<Long> expiredAt() The Unix timestamp (in seconds) for when the batch expired. 
 - 
                                        expiresAtfinal Optional<Long> expiresAt() The Unix timestamp (in seconds) for when the batch will expire. 
 - 
                                        finalizingAtfinal Optional<Long> finalizingAt() The Unix timestamp (in seconds) for when the batch started finalizing. 
 - 
                                        inProgressAtfinal Optional<Long> inProgressAt() The Unix timestamp (in seconds) for when the batch started processing. 
 - 
                                        metadatafinal Optional<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. 
 - 
                                        modelfinal Optional<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.
 - 
                                        outputFileIdfinal Optional<String> outputFileId() The ID of the file containing the outputs of successfully executed requests. 
 - 
                                        requestCountsfinal Optional<BatchRequestCounts> requestCounts() The request counts for different statuses within the batch. 
 - 
                                        usagefinal Optional<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. 
 - 
                                        _idfinal JsonField<String> _id() Returns the raw JSON value of id. Unlike id, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _completionWindowfinal JsonField<String> _completionWindow() Returns the raw JSON value of completionWindow. Unlike completionWindow, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _createdAtfinal JsonField<Long> _createdAt() Returns the raw JSON value of createdAt. Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _endpointfinal JsonField<String> _endpoint() Returns the raw JSON value of endpoint. Unlike endpoint, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _inputFileIdfinal JsonField<String> _inputFileId() Returns the raw JSON value of inputFileId. Unlike inputFileId, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _statusfinal JsonField<Batch.Status> _status() Returns the raw JSON value of status. Unlike status, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _cancelledAtfinal JsonField<Long> _cancelledAt() Returns the raw JSON value of cancelledAt. Unlike cancelledAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _cancellingAtfinal JsonField<Long> _cancellingAt() Returns the raw JSON value of cancellingAt. Unlike cancellingAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _completedAtfinal JsonField<Long> _completedAt() Returns the raw JSON value of completedAt. Unlike completedAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _errorFileIdfinal JsonField<String> _errorFileId() Returns the raw JSON value of errorFileId. Unlike errorFileId, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _errorsfinal JsonField<Batch.Errors> _errors() Returns the raw JSON value of errors. Unlike errors, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _expiredAtfinal JsonField<Long> _expiredAt() Returns the raw JSON value of expiredAt. Unlike expiredAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _expiresAtfinal JsonField<Long> _expiresAt() Returns the raw JSON value of expiresAt. Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _failedAtfinal JsonField<Long> _failedAt() Returns the raw JSON value of failedAt. Unlike failedAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _finalizingAtfinal JsonField<Long> _finalizingAt() Returns the raw JSON value of finalizingAt. Unlike finalizingAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _inProgressAtfinal JsonField<Long> _inProgressAt() Returns the raw JSON value of inProgressAt. Unlike inProgressAt, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _metadatafinal JsonField<Batch.Metadata> _metadata() Returns the raw JSON value of metadata. Unlike metadata, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _modelfinal JsonField<String> _model() Returns the raw JSON value of model. Unlike model, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _outputFileIdfinal JsonField<String> _outputFileId() Returns the raw JSON value of outputFileId. Unlike outputFileId, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _requestCountsfinal JsonField<BatchRequestCounts> _requestCounts() Returns the raw JSON value of requestCounts. Unlike requestCounts, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _usagefinal JsonField<BatchUsage> _usage() Returns the raw JSON value of usage. Unlike usage, this method doesn't throw if the JSON field has an unexpected type. 
 - 
                                        _additionalPropertiesfinal Map<String, JsonValue> _additionalProperties() 
 - 
                                        toBuilderfinal Batch.Builder toBuilder() 
 - 
                                        builderfinal static Batch.Builder builder() Returns a mutable builder for constructing an instance of Batch. The following fields are required: .id() .completionWindow() .createdAt() .endpoint() .inputFileId() .status()
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-