Skip to main content
Cohere

Search documentation

Type to search this documentation.

Retrieve a batch

GET/v2/batches/{id}Retrieve a batch

Retrieves a batch

Parameters

idstringpathrequired

The batch ID.

X-Client-Namestringheader

The name of the project that is making the request.

Responses

200A successful response.application/json
objectGetBatchResponse

Response to a request to get a batch.

batchobjectrequired

This resource represents a batch job.

Show child attributes
created_atstring · date-time

read-only. Creation timestamp.

creator_idstring

read-only. User ID of the creator.

idstring

read-only. Batch ID.

input_dataset_idstringrequired

ID of the dataset the batch reads inputs from.

input_tokensstring · int64

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

modelstringrequired

The name of the model the batch uses.

namestringrequired

Batch name (e.g. `foobar`).

num_failed_recordsinteger · int32

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

num_recordsinteger · int32

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

num_successful_recordsinteger · int32

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

org_idstring

read-only. Organization ID.

output_dataset_idstring
output_tokensstring · int64

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

statusstring

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.

one of "BATCH_STATUS_UNSPECIFIED", "BATCH_STATUS_QUEUED", "BATCH_STATUS_IN_PROGRESS", "BATCH_STATUS_CANCELING", "BATCH_STATUS_COMPLETED", "BATCH_STATUS_FAILED", "BATCH_STATUS_CANCELED" · default "BATCH_STATUS_UNSPECIFIED"

status_reasonstring

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

updated_atstring · date-time

read-only. Latest update timestamp.

Example response
{
  "batch": {
    "created_at": "2025-03-05T14:59:25.438936Z",
    "creator_id": "b5e1ffb9-49a1-4653-9927-94083316309d",
    "id": "9439e0e3-49a4-4336-93e3-485fc420bc18",
    "input_dataset_id": "my-requests-dataset",
    "input_tokens": "0",
    "model": "batch-command",
    "name": "my-batch",
    "num_failed_records": 0,
    "num_records": 5000,
    "num_successful_records": 8,
    "org_id": "62603116-1750-4c04-b1b6-9d5046764bc4",
    "output_dataset_id": "my-batch-output-c2waz1",
    "output_tokens": "0",
    "status": "BATCH_STATUS_IN_PROGRESS",
    "updated_at": "2025-03-05T15:00:26.126572Z"
  }
}
400Bad Requestapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
401Unauthorizedapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
403Forbiddenapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
404Not Foundapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
500Internal Server Errorapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
503Status Service Unavailableapplication/json
objectBatchError

Error is the response for any unsuccessful event.

messagestring

A developer-facing error message.

Example response
{
  "message": "string"
}
Documentation menu