v2

latestOpenAPI 3.1.02026-08-07139158192.4 KB
Files

Upload a JSONL input file for the Batch API

Send multipart/form-data with a file part (the JSONL bytes, up to 200 MB and 50,000 records) and a purpose field set to batch. Each line is one request object with the BatchRequestRecord shape (including the optional openrelay.tool_config extension on chat bodies); the returned file id goes in input_file_id when creating a batch.

post/v1/files

Response

OK

bytesinteger required

File size in bytes.

created_atinteger required

Unix timestamp (seconds).

expires_atinteger

Unix timestamp (seconds); files are retained for 30 days.

filenamestring required
idstring required

File id (file-…). Pass it as input_file_id when creating a batch.

object'file' required
purposestring required

"batch" for inputs, "batch_output" / "batch_error" for result files.