> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novita.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload file

Upload the batch input file so that it can be correctly referenced when creating a batch.

## Request Headers

**Content-Type** `string` *required*

Enum: `application/json`

**Authorization** `string` *required*

Bearer authentication format, for example: Bearer \{\{API Key}}.

## Request Body

**file** `file` *required*

The batch input file to be uploaded should be in `.jsonl` format, with each line detailing an API inference request.

Each request must have a unique `custom_id` to identify inference results in the output file after batch processing. The parameters within the `body` field of each line are used as the actual inference request parameters for the endpoint.

> [!WARNING]
>
> All requests within a single batch JSONL file must target the same model. Do not mix requests for different models in one batch.

Here is an example of an input file containing two requests:

```JSON theme={"system"}
{"custom_id": "request-1", "body": {"model": "deepseek/deepseek-r1-0528", "messages": [{"role": "user", "content": "Hello, world!"}], "max_tokens": 400}}
{"custom_id": "request-2", "body": {"model": "deepseek/deepseek-r1-0528", "messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello world!"}],"max_tokens": 1000}}
```

**purpose** `string` *required*

The purpose of the uploaded file. For batch processing, this should be set to `batch`.

Enum: `batch`

## Response

**id** `string` *required*

The unique identifier of the uploaded file.

**object** `string` *required*

The object type, which is always `file`.

**bytes** `integer` *required*

The size of the uploaded file in bytes.

**created\_at** `integer` *required*

The Unix timestamp (in seconds) when the file was created.

**filename** `string` *required*

The name of the uploaded file.

**purpose** `string` *required*

The purpose of the uploaded file.

**metadata** `object`

Additional metadata about the uploaded file.

**properties**

**total\_requests** `integer` *required*

The total number of requests contained in the batch input file.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.