Upload a File
POST
/v1/filesOverview
Upload a JSONL batch input file as multipart/form-data with purpose=batch and a file field. Requires an API key with llm.write. Also available under /api/v1. Files are limited to 50 MB and are kept until you delete them. Refused under zero data retention, because a batch stores its requests and results.
Each line is {"custom_id", "method": "POST", "url", "body"}: custom_id is unique in the file, url is the batch's endpoint, and body is the request that endpoint takes.
Request Body
multipart/form-data
purposestringRequiredfilestringRequiredJSONL requests, at most 50 MB.
Responses
200The stored file.
application/json
idstringRequiredExample: "file-abc123"
objectstringRequiredbytesintegerRequiredcreated_atintegerRequiredUnix seconds.
filenamestringRequiredpurposestringRequiredValues: "batch""batch_output"
statusstringRequiredexpires_atnullFiles are kept until deleted.