Batch Inference

Active Models

get

List currently available models.

Responses
200
Successful Response
application/json
get
GET /v1/active-models HTTP/1.1
Host: 
Accept: */*
200

Successful Response

{
  "active_models": [
    "text"
  ]
}

Get All Batches V1

get

List your batch jobs, ordered by creation time (most recent first).

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
get
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 Batch Job V1

post

Create and execute a batch job from an uploaded JSONL file.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Body
input_file_idstringRequired

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'.

Responses
200
Successful Response
application/json
post
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
  }
}

Get Files V1

get

List your files, ordered by creation time (most recent first).

Query parameters
limitinteger · min: 1 · max: 10000Optional

A limit on the number of objects to be returned. Limit can range between 1 and 10,000; the default is 1000.

Default: 1000
afterstringOptional

A cursor for use in pagination. 'after' is an object ID that defines your place in the list.

orderstringOptional

Sort order by the created_at timestamp of the objects. 'asc' for ascending order and 'desc' for descending order.

Pattern: ^(asc|desc)$
Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
get
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 File V1

post

Upload a file that can be used with batch jobs. Accepts JSONL files.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Body
filestring · binaryRequired

The file object (not filename) to be uploaded. Currently, only JSONL files are supported for batch jobs.

Responses
200
Successful Response
application/json
post
POST /v1/files HTTP/1.1
Host: 
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17

{
  "file": "binary"
}
{
  "id": "text",
  "filename": "text",
  "bytes": 1,
  "created_at": "2025-08-05T03:04:46.569Z"
}

Get Batch Job

get

Retrieve a batch job by its ID.

Path parameters
job_idstringRequired

The ID of the batch job to retrieve.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
get
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
  }
}

Delete Batch Job

delete

Attempt to cancel an in-progress batch job.

Path parameters
job_idstringRequired

The ID of the batch job to delete.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
delete
DELETE /v1/batches/{job_id} HTTP/1.1
Host: 
Accept: */*
{
  "message": "text"
}

Cancel Batch Job

post

Attempt to cancel an in-progress batch job.

Path parameters
job_idstringRequired

The ID of the batch job to cancel.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
post
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
  }
}

Get Batch Job Output

get

Retrieve the contents of the specified file.

Path parameters
file_idstringRequired

The ID of the file to retrieve.

Header parameters
Authorizationany ofOptional
stringOptional
or
nullOptional
Responses
200
Successful Response
application/json
Responseany
get
GET /v1/files/{file_id}/content HTTP/1.1
Host: 
Accept: */*

No content