---
title: "Files API: upload batch input and read batch output"
canonical: https://uncensoredllm.ai/docs/files
generated: 2026-11-23T06:12:08.847Z
source: https://uncensoredllm.ai/docs/files
base_url: https://api.uncensoredllm.ai/v1
---

# Files.

Updated November 22, 2026.

The files API at `https://api.uncensoredllm.ai/v1` holds the input you feed a batch and the output a batch produces, plus generated files from media routes. Every route takes a key except the generated-file route. You upload a JSONL input file, submit it to the [batches API](https://uncensoredllm.ai/docs/batches), and later read the output and error files the batch leaves behind.

[Get a key](https://app.uncensoredllm.ai/console)

## Upload and list

`POST /v1/files` uploads a batch input file; its `purpose` is batch, the content is JSONL, and the upload is rejected over 50 MB. `GET /v1/files` lists the organization’s files, newest first.

## A file and its content

`GET /v1/files/{file_id}` returns the file’s metadata and `GET /v1/files/{file_id}/content` returns its bytes, which for a batch output is JSONL. `DELETE /v1/files/{file_id}` removes a file. A separate route, `GET /v1/files/{path}`, serves a generated file from a media route by its path, with no key.

A batch file carries `id`, `object`, `bytes`, `filename`, `purpose` (batch or batch_output), `status`, `created_at` in Unix seconds, and `expires_at` set to 30 days after upload.

## Example

```bash
curl https://api.uncensoredllm.ai/v1/files \
  -H "Authorization: Bearer sk-ullm-live-…" \
  -F purpose=batch \
  -F file=@requests.jsonl
```

The response is the stored file with its `id`, which you then pass as a batch’s `input_file_id`.

## Status codes

`200` on upload, list, read, content and delete. A purpose other than batch, a missing file, or a line that is not a valid batch request is `400 invalid_request`, and an upload over 50 MB is `413 invalid_request`. A key that is missing or invalid gives `401 invalid_api_key`. No such file, or a generated file past its retention, is `404 not_found`.

## Files: questions

### What can I upload here?

A batch input file: purpose batch, JSONL content, up to 50 MB. Each line is one request: a custom_id, the method, the url and a body in the shape the batch’s endpoint expects.

### How long are files kept?

Thirty days from upload, recorded in expires_at. Generated files served by path are kept 30 days after their generation and return 404 once past it.

### How do I read a batch’s results?

Take the batch’s output_file_id (and error_file_id for failures) and call GET /v1/files/{file_id}/content, which returns the JSONL, one answer per line.

## Read next

- [MCP servers](https://uncensoredllm.ai/docs/mcp-servers)
- [Log export](https://uncensoredllm.ai/docs/exports)
- [Invoices](https://uncensoredllm.ai/docs/invoices)
- [Billing details](https://uncensoredllm.ai/docs/billing-details)
- [Statement signing key](https://uncensoredllm.ai/docs/statements-public-key)
- [Keys](https://uncensoredllm.ai/docs/keys)
- [Requests and receipts](https://uncensoredllm.ai/docs/requests)
- [Balance and spend limits](https://uncensoredllm.ai/docs/budgets)
- [Batches](https://uncensoredllm.ai/docs/batches)
- [Count tokens](https://uncensoredllm.ai/docs/count-tokens)
- [App usage stats](https://uncensoredllm.ai/docs/stats-apps)
- [Auth keys](https://uncensoredllm.ai/docs/auth-keys)
- [Webhook deliveries](https://uncensoredllm.ai/docs/webhooks-deliveries)
- [Docs: connect in two minutes](https://uncensoredllm.ai/docs)
