Skip to main content
The files endpoints store documents for reuse across chat requests. Files are scoped to the workspace that uploaded them; another workspace’s file id returns 404.

Upload

The upload takes the bytes in a file part and a purpose string (user_data for documents you will reference from chat messages) and returns the stored file object, including the id used in later requests.

List, fetch, download, delete

In the SDKs these are client.files.list(), client.files.retrieve(id), client.files.content(id), and client.files.delete(id) (Node client.files.del(id) on older versions).

Use a file in a request

Reference the uploaded file from a chat message as a file content part, and add the file-parser plugin so models without native document input can read it. See multimodal.