Skip to main content
POST
Upload File

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

File to upload

expires_in_days
integer
default:30

Expiration in days (1-30)

Required range: 1 <= x <= 30
purpose
string
default:general

Purpose of the file

Required string length: 1 - 50

Response

Successful Response

Response for a successful file upload.

file_id
string<uuid>
required

Unique file identifier for use in API calls

file_name
string
required

Original filename

file_size
integer
required

File size in bytes

file_mimetype
string
required

Detected MIME type

purpose
string
required

Purpose of the file (e.g., 'general', 'assistants')

created_at
string<date-time>
required

Upload timestamp

metadata
Metadata · object

File metadata (e.g., page_count for PDFs/documents)

expires_at
string<date-time> | null

Expiration timestamp