Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
API ReferenceInferenceFiles

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>
POST
/v1/files

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Request Body

multipart/form-data
  1. body
file*file

The JSONL file contents.

Formatbinary
purpose*"batch"
Value in"batch"

Response Body

OK

application/json
  1. response

A file stored for the Batch API (OpenAI-compatible).

id*string

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

object*"file"
Value in"file"
bytes*integer

File size in bytes.

Formatint64
created_at*integer

Unix timestamp (seconds).

Formatint64
expires_at?integer

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

Formatint64
filename*string
purpose*string

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

Example Request
curl -X POST 'https://inference.openrelay.inc/v1/files' \  -F 'file=string' \  -F 'purpose=batch'
Example Response
{  "id": "string",  "object": "file",  "bytes": 0,  "created_at": 0,  "expires_at": 0,  "filename": "string",  "purpose": "string"}