AI Gateway

POST /ai/v1/files

Changed on

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Request body multipart/form-data

filestring binary required

A JSONL batch input file: one request per line, every line targeting the same model and endpoint. At most 200 MB and 50,000 requests.

purposestring required

Must be batch.

Response

Uploaded file

bytesinteger
created_atinteger
filenamestring
idstring required
objectstring required

Always file

purposestring

batch for uploads, batch_output for batch results

Changes