File upload limitations depend on the plan you are using. For more information, see Pricing and limitations.
Upload a local file
You can upload a file to your assistant from your local device, as in the following example.2026-04 or later, upload, upsert, and delete responses return an operation object. Poll Describe an operation or List operations to track progress; when a file-ingestion operation completes, ingestion_units may be present on the operation. See Track file operations.
Upload is asynchronous and returns an operation ID. It may take several minutes for your assistant to process your file. You can track file operations to monitor progress, or check the status of your file to determine if it is ready to use.
Upload a file with metadata
You can upload a file with metadata. Metadata is a dictionary of key-value pairs that you can use to store additional information about the file. For example, you can use metadata to store the file’s name, document type, publish date, or any other relevant information.Upsert a file
This feature requires API version
2026-04 or later.Upsert a file with metadata
You can upsert a file with metadata by including it as a field in the multipart form:Upload a PDF with multimodal context
Assistants can gather context from images contained in PDF files. To learn more about this feature, see Multimodal context for assistants.Upload from a binary stream
You can upload a file directly from an in-memory binary stream using the Python SDK and the BytesIO class.When uploading text-based files (like .txt, .md, .json, etc.) through BytesIO streams, make sure the content is encoded in UTF-8 format.
Python