Skip to content

Upload a File

POST/v1/files

Overview

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.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Request Body

multipart/form-data
purposestringRequired
filestringRequired

JSONL requests, at most 50 MB.

Responses

200The stored file.
application/json
idstringRequired

Example: "file-abc123"

objectstringRequired
bytesintegerRequired
created_atintegerRequired

Unix seconds.

filenamestringRequired
purposestringRequired

Values: "batch""batch_output"

statusstringRequired
expires_atnull

Files are kept until deleted.

400Missing file, empty file or another purpose.
401Invalid API key.
403Missing llm.write scope, or zero data retention is on.
413File larger than 50 MB.