Upload a JSONL input file for the Batch API
Uploads a JSONL file of batch requests and returns its file object: the file id, size in bytes, purpose, and an expiry time 30 days after the upload. 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.
Required permission
Requires the batch.write permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl files upload <path>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
multipart/form-data- body
file*fileThe JSONL file contents.
binarypurpose*"batch""batch"OK
application/json- response
A file stored for the Batch API (OpenAI-compatible).
id*stringFile id (file-…). Pass it as input_file_id when creating a batch.
object*"file""file"bytes*integerFile size in bytes.
int64created_at*integerUnix timestamp (seconds).
int64expires_at?integerUnix timestamp (seconds); files are retained for 30 days.
int64filename*stringpurpose*string"batch" for inputs, "batch_output" / "batch_error" for result files.
curl -X POST 'https://inference.openrelay.inc/v1/files' \ -F 'file=string' \ -F 'purpose=batch'{ "id": "string", "object": "file", "bytes": 0, "created_at": 0, "expires_at": 0, "filename": "string", "purpose": "string"}Overview
Input and result files for the Batch API (JSONL, up to 200 MB and 50,000 records). Served by the inference endpoint (inference.openrelay.inc).
Mint a signed URL for a direct JSONL upload POST
For browser clients that upload the file straight to storage instead of through the API: returns a file id and a signed PUT URL (valid 15 minutes). After the PUT succeeds, register the file with the complete call. CLI and SDK clients should use the plain upload instead.