---
title: "Files API · upload batch inputs, stored in the EU"
description: "Upload, list, download and delete files with an OpenAI-compatible files API. Use them for batch jobs and tools; stored in EU data centres."
canonical: "https://inference.eu/api/files/"
language: "en"
---

POST /v1/files

# Files API: upload and manage files, stored in the EU

The files endpoints store the inputs and outputs of work that does not fit in a single request. You upload a JSONL file of requests for a batch job, download the results when it finishes, and delete both when you are done. The endpoints follow the OpenAI files API, and files are stored in European data centres.

[Contact sales](https://inference.eu/contact/)[Example request](#example)

1.  01API format: OpenAI
2.  02EU data centres
3.  03Covered by one DPA

POST /v1/files

```
# Upload a JSONL file of requests for a batch job
curl https://api.inference.eu/v1/files \
  -H "Authorization: Bearer $INFERENCE_EU_API_KEY" \
  -F purpose="batch" \
  -F file="@ticket-classification.jsonl"

# {"id": "file-7f3c2a", "object": "file", "bytes": 482113, "created_at": 1793620800,
#  "filename": "ticket-classification.jsonl", "purpose": "batch"}
```

## What the endpoints do

`POST /v1/files` uploads a file as `multipart/form-data` with two fields: `file` and `purpose`. Use `purpose` `batch` for batch input, or `user_data` for files a tool such as code execution should read. The response is a file object with an `id`, `bytes`, `filename`, `purpose` and `created_at`. You refer to the file by its `id` everywhere else.

`GET /v1/files` lists your files, `GET /v1/files/{file_id}` returns one file object, `GET /v1/files/{file_id}/content` downloads the contents, and `DELETE /v1/files/{file_id}` removes it. Batch output and error files appear in the same list with `purpose` `batch_output`.

## Preparing a batch input file

A batch input file is JSON Lines: one request per line, each with a `custom_id` you choose, a `method` of `POST`, the `url` such as `/v1/chat/completions` or `/v1/embeddings`, and a `body` that is exactly what you would send to that endpoint. All lines in one file should target the same endpoint.

Make `custom_id` meaningful, for example a ticket number or document id, because results can come back in any order and you match them using that value. Validate the file before upload: every line must be valid JSON, and a single malformed line can make the whole batch fail validation.

## Storage, retention and clean-up

Files are stored in European data centres, are only accessible with keys from your organisation, and are never used to train models. Treat them like any other copy of your data: delete input files once the batch has completed and you have downloaded the results, and delete output files once they are processed.

A short clean-up step at the end of each job is enough, and it keeps the list readable as well as limiting how much sensitive data sits in storage. How long files are kept if you do not delete them depends on your contract, and we confirm it with you.

## Errors and edge cases

An upload without `purpose`, or with a value that is not supported, returns a 400 error. Files above the maximum size also return an error; split large inputs into several files and batches. The size limit depends on your plan, and we confirm it with you.

Requesting a file id that does not exist, or that belongs to another organisation, returns 404. Downloading the content of a file still being written, such as batch output before the batch has finished, is not possible; wait until the batch status is `completed`. Deleting a file that a running batch uses can make that batch fail, so delete inputs only afterwards.

## Files

Endpoint

POST /v1/files

Category

Endpoints

API format

OpenAI

Base URL

api.inference.eu/v1

Processing

EU data centres

Training on your data

Never

## Files: common questions

The questions buyers, developers and legal teams ask us most. Something missing? Ask us directly.

Yes. Upload, list, retrieve, download and delete follow the OpenAI files API, with the same multipart fields and file object. \`client.files.create\`, \`client.files.content\` and \`client.files.delete\` in the OpenAI SDKs work with the inference.eu base URL and key.

Use \`batch\` for JSONL batch input and \`user\_data\` for files a tool should read, such as a spreadsheet passed to code execution. Output and error files that a batch creates have the purpose \`batch\_output\`. Fine-tuning purposes are not part of the public API; ask us if you need custom models.

In European data centres. Files are only accessible with API keys from your organisation and are never used to train models. Delete them when you no longer need them; retention for files you do not delete depends on your contract and is confirmed with you in writing.

The maximum upload size and total storage depend on your plan, and we confirm them with you. For very large jobs, split the input into several JSONL files and submit one batch for each. This also makes it easier to retry a part that fails.

When a batch reaches \`completed\`, its \`output\_file\_id\` points to a JSONL file with one result per line. Call \`GET /v1/files/{output\_file\_id}/content\` to download it. If some requests failed, \`error\_file\_id\` points to a separate file with the error for each failed \`custom\_id\`.

JSON Lines, one request per line. Each line contains \`custom\_id\`, \`method\` (\`POST\`), \`url\` (for example \`/v1/chat/completions\`) and \`body\`, which is the normal request body for that endpoint. Use the same endpoint and model for every line in a file.

You can upload files with the \`user\_data\` purpose for tools that read them. If you want the text of a PDF or Office document, use the document conversion tool, which turns it into Markdown that you can chunk, embed or put into a prompt.

List them with \`GET /v1/files\`, then call \`DELETE /v1/files/{file\_id}\` for each one. Each delete returns an object with the \`id\` and \`deleted: true\`. Run this as the final step of a batch job so that inputs and outputs do not stay in storage longer than needed.

[Ask a question](https://inference.eu/contact/)

## Related

[API overview](https://inference.eu/api/)

-   [BatchesRun thousands of chat or embedding requests as one asynchronous job with an OpenAI-compatible batch API. Upload JSONL, collect results, all in the EU.Endpoints](https://inference.eu/api/batches/)
-   [Document conversionConvert PDF, Word, PowerPoint and Excel files to clean Markdown for RAG and LLM prompts. Tables, headings and scanned pages, processed in the EU.Tools](https://inference.eu/api/document-conversion/)
-   [Code executionLet open models write and run Python in a sandbox with the OpenAI Responses code\_interpreter tool. Data analysis, calculations and files, run in the EU.Tools](https://inference.eu/api/code-execution/)

## Move your AI workloads to EU infrastructure

Tell us which models you use and roughly how much traffic you have. We reply within one working day with pricing and next steps.

-   Reply within one working day
-   Pricing for your volume
-   DPA ready to sign
