/v2/batchesCreate a batchCreates and executes a batch from an uploaded dataset of requests
Parameters
X-Client-NamestringheaderThe name of the project that is making the request.
Request body
requiredInformation about the batch. Must contain name, input_dataset_id, and model. Output-only fields are ignored.
application/json
This resource represents a batch job.
created_atstring · date-timeread-only. Creation timestamp.
creator_idstringread-only. User ID of the creator.
idstringread-only. Batch ID.
input_dataset_idstringrequiredID of the dataset the batch reads inputs from.
input_tokensstring · int64read-only. The total number of input tokens in the batch.
modelstringrequiredThe name of the model the batch uses.
namestringrequiredBatch name (e.g. `foobar`).
num_failed_recordsinteger · int32read-only. The current number of failed records in the batch.
num_recordsinteger · int32read-only. The total number of records in the batch.
num_successful_recordsinteger · int32read-only. The current number of successful records in the batch.
org_idstringread-only. Organization ID.
output_dataset_idstringoutput_tokensstring · int64read-only. The total number of output tokens in the batch.
statusstringThe possible stages of a batch life-cycle. - BATCH_STATUS_UNSPECIFIED: Unspecified status. - BATCH_STATUS_QUEUED: The batch has been queued. - BATCH_STATUS_IN_PROGRESS: The batch is in-progress. - BATCH_STATUS_CANCELING: The batch is being canceled. - BATCH_STATUS_COMPLETED: The batch has been completed. - BATCH_STATUS_FAILED: The batch has failed. - BATCH_STATUS_CANCELED: The batch has been canceled.
status_reasonstringread-only. More details about the reason for the status of a batch job.
updated_atstring · date-timeread-only. Latest update timestamp.
{
"input_dataset_id": "string",
"model": "string",
"name": "string"
}Responses
Response to request to create a batch.
batchobjectrequiredThis resource represents a batch job.
Show child attributes
created_atstring · date-timeread-only. Creation timestamp.
creator_idstringread-only. User ID of the creator.
idstringread-only. Batch ID.
input_dataset_idstringrequiredID of the dataset the batch reads inputs from.
input_tokensstring · int64read-only. The total number of input tokens in the batch.
modelstringrequiredThe name of the model the batch uses.
namestringrequiredBatch name (e.g. `foobar`).
num_failed_recordsinteger · int32read-only. The current number of failed records in the batch.
num_recordsinteger · int32read-only. The total number of records in the batch.
num_successful_recordsinteger · int32read-only. The current number of successful records in the batch.
org_idstringread-only. Organization ID.
output_dataset_idstringoutput_tokensstring · int64read-only. The total number of output tokens in the batch.
statusstringThe possible stages of a batch life-cycle. - BATCH_STATUS_UNSPECIFIED: Unspecified status. - BATCH_STATUS_QUEUED: The batch has been queued. - BATCH_STATUS_IN_PROGRESS: The batch is in-progress. - BATCH_STATUS_CANCELING: The batch is being canceled. - BATCH_STATUS_COMPLETED: The batch has been completed. - BATCH_STATUS_FAILED: The batch has failed. - BATCH_STATUS_CANCELED: The batch has been canceled.
status_reasonstringread-only. More details about the reason for the status of a batch job.
updated_atstring · date-timeread-only. Latest update timestamp.
{
"batch": {
"created_at": "2026-06-09T00:00:00Z",
"creator_id": "string",
"id": "string",
"input_dataset_id": "string",
"input_tokens": "string",
"model": "string",
"name": "string",
"num_failed_records": 0,
"num_records": 0,
"num_successful_records": 0,
"org_id": "string",
"output_dataset_id": "string",
"output_tokens": "string",
"status": "BATCH_STATUS_UNSPECIFIED",
"status_reason": "string",
"updated_at": "2026-06-09T00:00:00Z"
}
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}Error is the response for any unsuccessful event.
messagestringA developer-facing error message.
{
"message": "string"
}