Skip to main content
GET
https://api.cerebras.ai
/
v1
/
batches
/
{batch_id}
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

batch = client.batches.retrieve("batch_123")

print(batch)
{
  "id": "batch_5842ec7d8fb6",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file_456",
  "completion_window": "24h",
  "status": "in_progress",
  "output_file_id": null,
  "error_file_id": null,
  "created_at": 1766003277,
  "in_progress_at": 1766003300,
  "expires_at": 1766089677,
  "finalizing_at": null,
  "completed_at": null,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": null,
  "cancelled_at": null,
  "request_counts": {
    "total": 100,
    "completed": 75,
    "failed": 2
  },
  "metadata": {
    "custom_tags": ["legal-review", "q3"]
  }
}
Retrieves the status and progress of a batch job. Use this endpoint to monitor your batch job as it processes.

Path Parameters

batch_id
string
required
The ID of the batch job to retrieve.

Response

id
string
A unique identifier for the batch job.
object
string
The object type, which is always batch.
endpoint
string
The API endpoint used for batch processing.
errors
object | null
Information about any errors that occurred during batch processing.
input_file_id
string
The ID of the input file containing batch requests.
completion_window
string
The time window for batch completion. Always 24h.
status
string
The current status of the batch job. Possible values: validating, queued, in_progress, finalizing, completed, expired, failed, cancelled, cancelling.
output_file_id
string | null
The ID of the file containing batch results (available once processing is complete).
error_file_id
string | null
The ID of the file containing errors (if any errors occurred).
created_at
integer
The Unix timestamp (in seconds) of when the batch job was created.
in_progress_at
integer | null
The Unix timestamp (in seconds) of when the batch job started processing.
expires_at
integer | null
The Unix timestamp (in seconds) of when the batch job will expire.
finalizing_at
integer | null
The Unix timestamp (in seconds) of when the batch job started finalizing.
completed_at
integer | null
The Unix timestamp (in seconds) of when the batch job completed.
failed_at
integer | null
The Unix timestamp (in seconds) of when the batch job failed.
expired_at
integer | null
The Unix timestamp (in seconds) of when the batch job expired.
cancelling_at
integer | null
The Unix timestamp (in seconds) of when the batch job started cancelling.
cancelled_at
integer | null
The Unix timestamp (in seconds) of when the batch job was cancelled.
request_counts
object
Statistics about the requests in the batch.
metadata
object | null
Custom metadata associated with the batch job.
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

batch = client.batches.retrieve("batch_123")

print(batch)
{
  "id": "batch_5842ec7d8fb6",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file_456",
  "completion_window": "24h",
  "status": "in_progress",
  "output_file_id": null,
  "error_file_id": null,
  "created_at": 1766003277,
  "in_progress_at": 1766003300,
  "expires_at": 1766089677,
  "finalizing_at": null,
  "completed_at": null,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": null,
  "cancelled_at": null,
  "request_counts": {
    "total": 100,
    "completed": 75,
    "failed": 2
  },
  "metadata": {
    "custom_tags": ["legal-review", "q3"]
  }
}