Skip to main content
POST
Upload file
Save the returned file_id and reuse it with:
  • POST /v1/batches
  • GET /v1/files/{file_id}
  • GET /v1/files/{file_id}/content
GET /v1/files is not currently supported on the shared gateway key, so the upload response is the canonical place to capture the file id.

Authorizations

Authorization
string
header
required

Bearer token authentication

Headers

x-ai-stats-provider
string

Header alternative to the provider query parameter.

Query Parameters

model
string

Model id used to infer the upstream batch file provider. Model identifier. This is a runtime string so newly released models can be used without waiting for an SDK update.

Example:

"ai21/jamba-1.5-large"

provider
enum<string>

Advanced provider override for the upstream file upload.

Available options:
openai,
groq,
together,
mistral

Body

multipart/form-data
file
file
required
purpose
string
required

Response

Uploaded file metadata

id
string
object
string
bytes
integer
created_at
integer
filename
string
purpose
string
status
string
status_details
object
Last modified on July 26, 2026