Skip to main content
A file on this API is a PDF. You upload it, then attach the ID to a chat request. The file stays on your account until you delete it, or until an expiry you set has passed. Chat with files is how lume-omni reads it.

Upload

POST /v1/files needs the scope files:write. The body is multipart. purpose is user_data, and the file name ends in .pdf.
The response is the file object. id is what you send on the chat request. It is file- followed by 32 characters, using letters, digits, _, and -. status is processed. The response includes X-Request-Id.
A file can be up to 25 MiB, which is 25 × 1024 × 1024 bytes. Above that, the response is HTTP 413 and the message is File is too large. The name has to end in .pdf, and the bytes have to be a PDF. purpose accepts user_data. You can keep up to 1,000 files, and 100,000,000 bytes in total. An account can create 10 files a minute, and 1,000 files or 1 GiB on a UTC day. Past those limits, you’ll get HTTP 429. error.type is rate_limit_error. The code is rate_limit_exceeded with the message Create rate exceeded, storage_quota_exceeded with Storage quota exceeded, or ingestion_quota_exceeded with Ingestion quota exceeded.
To give a file an expiry, send expires_after[anchor] as created_at and expires_after[seconds] together. Seconds run from 3,600 through 30 days. The file object then includes expires_at. After that time the file is gone. Leave both fields out and the file stays until you delete it.

List, retrieve, and download

GET /v1/files needs the scope files:read. order is desc or asc, and it defaults to desc. limit defaults to 10,000, which is also the maximum. Pass after as a file ID from the page you already have. The body has object list, data, first_id, last_id, and has_more. GET /v1/files/{file_id} returns the same file object. GET /v1/files/{file_id}/content returns the PDF bytes, with Cache-Control: private, no-store. If the ID is missing, or it belongs to another account, you’ll get HTTP 404. The body does not say which of those it was.
An ID that does not match the file- pattern is HTTP 400, with the message Invalid file ID.

Delete

DELETE /v1/files/{file_id} needs the scope files:delete.

Next

Chat with files

Ask lume-omni about a PDF.

Authentication

See the files scopes on a key.