POST
/
openai
/
v1
/
files
Upload file
curl --request POST \
  --url https://api.novita.ai/openai/v1/files \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '{
  "purpose": "<string>"
}'
{
  "id": "<string>",
  "object": "<string>",
  "bytes": 123,
  "created_at": 123,
  "filename": "<string>",
  "purpose": "<string>",
  "metadata": {
    "total_requests": 123
  }
}
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.Here is an example of an input file containing two requests:
{"custom_id": "request-1", "body": {"model": "deepseek/deepseek-v3-0324", "messages": [{"role": "user", "content": "Hello, world!"}], "max_tokens": 400}}
{"custom_id": "request-2", "body": {"model": "deepseek/deepseek-v3-0324", "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.