--- url: "https://developers.openai.com/api/docs/api-reference/batch" titulek: "Batches | OpenAI API Reference" h1: "Batches" popis: "" jazyk: "en" kanonicka: "https://developers.openai.com/api/reference/resources/batches/" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 09:53:46" znaku: 5156 slov: 617 kodovani: "utf-8" sha256: "c9e0d0907af8b832af4ed8bc62674e3256ce4bffcdadae8c06128e387833a2ac" --- ##### ModelsExpand Collapse Batch object { id, completion_window, created_at, 19 more } id: stringcompletion_window: stringThe time frame within which the batch should be processed.created_at: numberThe Unix timestamp (in seconds) for when the batch was created.formatunixtimeendpoint: stringThe OpenAI API endpoint used by the batch.input_file_id: stringThe ID of the input file for the batch.object: "batch"The object type, which is always `batch`.status: "validating" or "failed" or "in_progress" or 5 moreThe current status of the batch.One of the following:"validating""failed""in_progress""finalizing""completed""expired""cancelling""cancelled"cancelled_at: optional numberThe Unix timestamp (in seconds) for when the batch was cancelled.formatunixtimecancelling_at: optional numberThe Unix timestamp (in seconds) for when the batch started cancelling.formatunixtimecompleted_at: optional numberThe Unix timestamp (in seconds) for when the batch was completed.formatunixtimeerror_file_id: optional stringThe ID of the file containing the outputs of requests with errors.errors: optional object { data, object } data: optional array of [BatchError](/api/reference/resources/batches#(resource)%20batches%20%3E%20(model)%20batch_error%20%3E%20(schema)) { code, line, message, param } code: optional stringAn error code identifying the error type.line: optional number or nullThe line number of the input file where the error occurred, if applicable.message: optional stringA human-readable message providing more details about the error.param: optional string or nullThe name of the parameter that caused the error, if applicable.object: optional stringThe object type, which is always `list`.expired_at: optional numberThe Unix timestamp (in seconds) for when the batch expired.formatunixtimeexpires_at: optional numberThe Unix timestamp (in seconds) for when the batch will expire.formatunixtimefailed_at: optional numberThe Unix timestamp (in seconds) for when the batch failed.formatunixtimefinalizing_at: optional numberThe Unix timestamp (in seconds) for when the batch started finalizing.formatunixtimein_progress_at: optional numberThe Unix timestamp (in seconds) for when the batch started processing.formatunixtimemetadata: optional [Metadata](/api/reference/resources/$shared#(resource)%20%24shared%20%3E%20(model)%20metadata%20%3E%20(schema)) or nullSet 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.model: optional stringModel ID used to process the batch, like `gpt-6-astra`. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the [model guide](/api/docs/models) to browse and compare available models.output_file_id: optional stringThe ID of the file containing the outputs of successfully executed requests.request_counts: optional [BatchRequestCounts](/api/reference/resources/batches#(resource)%20batches%20%3E%20(model)%20batch_request_counts%20%3E%20(schema)) { completed, failed, total } The request counts for different statuses within the batch.usage: optional [BatchUsage](/api/reference/resources/batches#(resource)%20batches%20%3E%20(model)%20batch_usage%20%3E%20(schema)) { input_tokens, input_tokens_details, output_tokens, 2 more } 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. BatchError object { code, line, message, param } code: optional stringAn error code identifying the error type.line: optional number or nullThe line number of the input file where the error occurred, if applicable.message: optional stringA human-readable message providing more details about the error.param: optional string or nullThe name of the parameter that caused the error, if applicable. BatchRequestCounts object { completed, failed, total } The request counts for different statuses within the batch.completed: numberNumber of requests that have been completed successfully.failed: numberNumber of requests that have failed.total: numberTotal number of requests in the batch. BatchUsage object { input_tokens, input_tokens_details, output_tokens, 2 more } 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.input_tokens: numberThe number of input tokens.input_tokens_details: object { cached_tokens } A detailed breakdown of the input tokens.cached_tokens: numberThe number of tokens that were retrieved from the cache. [More on prompt caching](/api/docs/guides/prompt-caching).output_tokens: numberThe number of output tokens.output_tokens_details: object { reasoning_tokens } A detailed breakdown of the output tokens.reasoning_tokens: numberThe number of reasoning tokens.total_tokens: numberThe total number of tokens used.