Skip to main content
GET
/
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_abc123")

print(batch)
{
  "id": "batch_abc123",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file_abc123",
  "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"]
  }
}

Documentation Index

Fetch the complete documentation index at: https://inference-docs.cerebras.ai/llms.txt

Use this file to discover all available pages before exploring further.

This feature is in Private Preview. For access or more information, contact us or reach out to your account representative.
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_abc123")

print(batch)
{
  "id": "batch_abc123",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file_abc123",
  "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"]
  }
}