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

# Upload a file

`POST /v1/files`

Upload a JSONL file with `purpose=batch` (max 100 MB). Use the returned `id` as `input_file_id` when creating a batch.

## Headers

- `x-project-id` string

## Response `200`

File uploaded

- File
  - `id` string — Prefixed with `file-`.
  - `object` 'file'
  - `bytes` integer
  - `created_at` integer
  - `filename` string
  - `purpose` 'batch' | 'batch_output' — Uploads use `batch`; batch results use `batch_output`.
  - `status` 'uploaded' | 'processed' | 'error'
  - `status_details` string
  - `expires_at` integer
  - `is_error` boolean — ZeroGPU extension. `true` on batch error output files only.

## Other responses

- `400` — Invalid multipart, purpose, or empty file
- `401` — Missing authentication headers
- `403` — Invalid credentials
- `413` — File exceeds 100 MB
- `429` — Insufficient quota
- `500` — Internal server error

---

[API](https://skmtc.dev/zerogpu/apis/zerogpu-batch-files-api.md) · [All operations](https://skmtc.dev/zerogpu/apis/zerogpu-batch-files-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zerogpu/zerogpu-batch-files-api/revisions/f7371035d1a2/schema)
