v1

latestOpenAPI 3.0.2MIT2026-07-24141061.6 KB
Files

Upload file

Upload a file that can be used with the Batch API. The Batch API only supports .jsonl files with a specific required format.

post/files

Request body

filestring required

The <a href="https://w3c.github.io/FileAPI/#file-section" target="_blank">file object</a> (not file name) to be uploaded.

purposestring required

The intended purpose of the uploaded file. Currently, this value must be set to batch.

Response

Success

idstring

The file identifier.

objectstring

The object type, which is always file.

bytesinteger

The size of the file, in bytes.

created_atstring

RFC 3339 datetime string for when the file was created.

expires_atstring

RFC 3339 datetime string for when the file expires. Currently, this is 30 days after the file is created.

filenamestring

The name of the file.

purposestring

The intended purpose of the file. Supported values are batch, batch-output, and batch-error.