Batch Inference
List currently available models with detailed information.
Successful Response
GET /v1/model-config HTTP/1.1
Host:
Accept: */*
Successful Response
{
"active_models": [
{
"id": "text",
"name": "text",
"description": "text",
"input_price_cents": 1,
"output_price_cents": 1,
"model_code": "text",
"num_parameters_billions": 1,
"num_experts": 1,
"context_length": 1,
"display_order": 1,
"license_url": "text",
"created_at": "2025-09-29T21:47:53.119Z",
"updated_at": "2025-09-29T21:47:53.119Z",
"status": "active"
}
]
}
List your batch jobs, ordered by creation time (most recent first).
Successful Response
Validation error
Rate limit exceeded
GET /v1/batches HTTP/1.1
Host:
Accept: */*
{
"data": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"object": "text",
"first_id": "text",
"last_id": "text",
"has_more": true
}
Create and execute a batch job from an uploaded JSONL file.
The ID of an uploaded file that contains requests for the new batch job. Your input file must be formatted as a JSONL file and must be uploaded with purpose 'batch'.
Successful Response
Validation error
Rate limit exceeded
POST /v1/batches HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 24
{
"input_file_id": "text"
}
{
"id": "text",
"object": "text",
"endpoint": "text",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"input_file_id": "text",
"completion_window": "text",
"status": "text",
"output_file_id": "text",
"error_file_id": "text",
"created_at": 1,
"in_progress_at": 1,
"expires_at": 1,
"completed_at": 1,
"failed_at": 1,
"expired_at": 1,
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"request_counts": {
"total": 1,
"completed": 1,
"failed": 1
}
}
List your files, ordered by creation time (most recent first).
A limit on the number of objects to be returned. Limit can range between 1 and 10,000; the default is 1000.
1000
A cursor for use in pagination. 'after' is an object ID that defines your place in the list.
Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order.
^(asc|desc)$
Successful Response
Validation error
Rate limit exceeded
GET /v1/files HTTP/1.1
Host:
Accept: */*
{
"data": [
{
"id": "text",
"object": "text",
"bytes": 1,
"created_at": 1,
"filename": "text",
"purpose": "text"
}
],
"object": "text"
}
Upload a file that can be used with batch jobs. Accepts JSONL files.
The file object (not filename) to be uploaded. Currently, only JSONL files are supported for batch jobs.
Uploaded file purpose. For batch jobs, use 'batch'.
batch
Successful Response
Validation error
Rate limit exceeded
POST /v1/files HTTP/1.1
Host:
Content-Type: multipart/form-data
Accept: */*
Content-Length: 35
{
"file": "binary",
"purpose": "batch"
}
{
"id": "text",
"filename": "text",
"bytes": 1,
"created_at": "2025-09-29T21:47:53.119Z"
}
Retrieve a batch job by its ID.
The ID of the batch job to retrieve.
Successful Response
Resource not found
Validation error
Rate limit exceeded
GET /v1/batches/{job_id} HTTP/1.1
Host:
Accept: */*
{
"id": "text",
"object": "text",
"endpoint": "text",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"input_file_id": "text",
"completion_window": "text",
"status": "text",
"output_file_id": "text",
"error_file_id": "text",
"created_at": 1,
"in_progress_at": 1,
"expires_at": 1,
"completed_at": 1,
"failed_at": 1,
"expired_at": 1,
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"request_counts": {
"total": 1,
"completed": 1,
"failed": 1
}
}
Attempt to cancel an in-progress batch job.
The ID of the batch job to delete.
Successful Response
Resource not found
Validation error
Rate limit exceeded
DELETE /v1/batches/{job_id} HTTP/1.1
Host:
Accept: */*
{
"message": "text"
}
Attempt to cancel an in-progress batch job.
The ID of the batch job to cancel.
Successful Response
Resource not found
Validation error
Rate limit exceeded
POST /v1/batches/{job_id}/cancel HTTP/1.1
Host:
Accept: */*
{
"id": "text",
"object": "text",
"endpoint": "text",
"errors": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"input_file_id": "text",
"completion_window": "text",
"status": "text",
"output_file_id": "text",
"error_file_id": "text",
"created_at": 1,
"in_progress_at": 1,
"expires_at": 1,
"completed_at": 1,
"failed_at": 1,
"expired_at": 1,
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"request_counts": {
"total": 1,
"completed": 1,
"failed": 1
}
}
Retrieve the contents of the specified file.
The ID of the file to retrieve.
Successful Response
Validation error
Rate limit exceeded
GET /v1/files/{file_id}/content HTTP/1.1
Host:
Accept: */*
No content