Retrieve batch
GET/batches/{batch_id}
Retrieves a batch.
Path Parameters
batch_id: string
Returns
Retrieve batch
curl https://api.openai.com/v1/batches/$BATCH_ID \
-H "Authorization: Bearer $OPENAI_API_KEY"{
"id": "id",
"completion_window": "completion_window",
"created_at": 0,
"endpoint": "endpoint",
"input_file_id": "input_file_id",
"object": "batch",
"status": "validating",
"cancelled_at": 0,
"cancelling_at": 0,
"completed_at": 0,
"error_file_id": "error_file_id",
"errors": {
"data": [
{
"code": "code",
"line": 0,
"message": "message",
"param": "param"
}
],
"object": "object"
},
"expired_at": 0,
"expires_at": 0,
"failed_at": 0,
"finalizing_at": 0,
"in_progress_at": 0,
"metadata": {
"foo": "string"
},
"model": "model",
"output_file_id": "output_file_id",
"request_counts": {
"completed": 0,
"failed": 0,
"total": 0
},
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}Returns Examples
{
"id": "id",
"completion_window": "completion_window",
"created_at": 0,
"endpoint": "endpoint",
"input_file_id": "input_file_id",
"object": "batch",
"status": "validating",
"cancelled_at": 0,
"cancelling_at": 0,
"completed_at": 0,
"error_file_id": "error_file_id",
"errors": {
"data": [
{
"code": "code",
"line": 0,
"message": "message",
"param": "param"
}
],
"object": "object"
},
"expired_at": 0,
"expires_at": 0,
"failed_at": 0,
"finalizing_at": 0,
"in_progress_at": 0,
"metadata": {
"foo": "string"
},
"model": "model",
"output_file_id": "output_file_id",
"request_counts": {
"completed": 0,
"failed": 0,
"total": 0
},
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
}
}