---
title: "Upload a batch input file"
method: POST
path: "/v1/files"
tags: ["batch"]
---

# Upload a batch input file

`POST /v1/files`

Upload a JSONL file of chat-completion requests, one `BatchInputLine` per line, with `purpose: batch`. Up to 100 MB and 50,000 lines. Files are deleted 30 days after upload unless you set `expires_after`, or 24 hours on zero-data-retention accounts. Returns the file id to pass as `input_file_id`.

## Response `200`

The stored file.

- FileObject — A file you uploaded, or one a batch wrote for you.
  - `id` string, required — File identifier, `file_` prefixed. Pass it as `input_file_id` when creating a batch.
  - `object` string, required — Object type, always `file`.
  - `bytes` integer, required — Size of the file in bytes.
  - `created_at` integer, required — Unix timestamp (seconds) for when the file was uploaded.
  - `expires_at` integer, nullable, required — Unix timestamp (seconds) for when the file and its content are deleted. Defaults to 30 days after upload (24 hours on zero-data-retention accounts).
  - `filename` string, required — The filename you uploaded, or the generated name for batch output and error files.
  - `purpose` 'batch' | 'batch_output', required — `batch` for files you upload; `batch_output` for the output and error files a batch produces.
  - `status` 'uploaded' | 'processed' | 'error', required — Deprecated OpenAI field, kept for SDK compatibility. Always `uploaded`.

## Other responses

- `400` — Malformed request — missing or invalid fields.
- `401` — Missing or invalid API key.
- `429` — Rate limited — retry after the interval in the Retry-After header.
- `500` — Internal error — safe to retry with backoff.

## Changes

- **2026-09-02** `681b2f463d11` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/morphllm/apis/morph-api/changes/v1/files/post.md)

---

[API](https://skmtc.dev/morphllm/apis/morph-api.md) · [All operations](https://skmtc.dev/morphllm/apis/morph-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/morphllm/morph-api/revisions/681b2f463d11/schema)
