Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
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; the returned file id goes in `input_file_id` when creating a batch.

POST
/v1/files
AuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer vl_….

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/files" \  -F file="string" \  -F purpose="batch"
{
  "id": "string",
  "object": "file",
  "bytes": 0,
  "created_at": 0,
  "expires_at": 0,
  "filename": "string",
  "purpose": "string"
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}
{
  "error": {
    "message": "string",
    "type": "string",
    "code": "string"
  }
}

Command line

The orl CLI wraps this endpoint:

orl files upload