---
title: "Upload a JSONL input file for the Batch API"
method: POST
path: "/v1/files"
tags: ["Files"]
---

# Upload a JSONL input file for the Batch API

`POST /v1/files`

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.

## Response `200`

OK

- FileObject — A file stored for the Batch API (OpenAI-compatible).
  - `bytes` integer, required — File size in bytes.
  - `created_at` integer, required — Unix timestamp (seconds).
  - `expires_at` integer — Unix timestamp (seconds); files are retained for 30 days.
  - `filename` string, required
  - `id` string, required — File id (file-…). Pass it as input_file_id when creating a batch.
  - `object` 'file', required
  - `purpose` string, required — "batch" for inputs, "batch_output" / "batch_error" for result files.

## Other responses

- `400` — The request is invalid
- `401` — Missing or invalid API key
- `404` — Not found (also returned when the organization does not have Batch API access)
- `413` — The upload exceeds the 200 MB limit
- `429` — Too many concurrent uploads; retry shortly

---

[API](https://skmtc.net/openrelay/apis/openrelay-api.md) · [All operations](https://skmtc.net/openrelay/apis/openrelay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrelay/openrelay-api/versions/32905b8f44f8/schema)
