batch

List files

Page through your uploaded input files and generated output files, newest first by default.

get/v1/files

Query parameters

purpose'batch' | 'batch_output'

Only return files with this purpose.

Example:batch

Filter to uploads (batch) or generated results (batch_output).

order'asc' | 'desc'

Sort by created_at. Default desc.

Example:desc

Oldest first (asc) or newest first (desc).

limitinteger

Files per page. Default 20, max 10,000.

Example:20

How many files to return in this page.

afterinteger

Offset cursor: how many files to skip. Add limit to it for each next page.

Example:20

Pagination offset into your files. An integer count, not an object id, so page manually rather than with the SDK auto-paginator.

Response

The requested page of files.

objectstring required

Object type, always list.

first_idstring required

Id of the first file in this page. Empty when the page is empty.

last_idstring required

Id of the last file in this page. Empty when the page is empty.

has_moreboolean required

Whether another page exists after this one.

Example response

{
  "object": "list",
  "data": [
    {
      "id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
      "object": "file",
      "bytes": 48211,
      "created_at": 1780000000,
      "expires_at": 1782592000,
      "filename": "requests.jsonl",
      "purpose": "batch",
      "status": "uploaded"
    }
  ],
  "first_id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
  "last_id": "file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f",
  "has_more": false
}

Changes