v51

latestOpenAPI 3.1.0proprietaryraw.githubusercontent.com2026-07-21411711.1 MB
/batches

Create a batch

Creates and executes a batch from an uploaded dataset of requests

post/v2/batches

Headers

X-Client-Namestring

The name of the project that is making the request.

Request body

idstring

read-only. Batch ID.

namestring required

Batch name (e.g. foobar).

creator_idstring

read-only. User ID of the creator.

org_idstring

read-only. Organization ID.

status'BATCH_STATUS_UNSPECIFIED' | 'BATCH_STATUS_QUEUED' | 'BATCH_STATUS_IN_PROGRESS' | 'BATCH_STATUS_CANCELING' | 'BATCH_STATUS_COMPLETED' | 'BATCH_STATUS_FAILED' | 'BATCH_STATUS_CANCELED'

The 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.
created_atstring date-time

read-only. Creation timestamp.

updated_atstring date-time

read-only. Latest update timestamp.

input_dataset_idstring required

ID of the dataset the batch reads inputs from.

output_dataset_idstring
input_tokensstring int64

read-only. The total number of input tokens in the batch.

output_tokensstring int64

read-only. The total number of output tokens in the batch.

modelstring required

The name of the model the batch uses.

num_recordsinteger

read-only. The total number of records in the batch.

num_successful_recordsinteger

read-only. The current number of successful records in the batch.

num_failed_recordsinteger

read-only. The current number of failed records in the batch.

status_reasonstring

read-only. More details about the reason for the status of a batch job.

Response

A successful response.