Upload, manage, and retrieve documents for RAG integration
POST /v1/files
multipart/form-data
Request Parameters:
file
: The file to upload (required)purpose
: The intended use of the file (required)
assistants
, batch
, fine_tune
, vision
, user_data
, evals
GET /v1/files
Query Parameters:
purpose
: Filter files by purpose (optional)limit
: Maximum number of files to return (default: 100, range: 1-100)order
: Sort order by creation timestamp (asc
or desc
, default: desc
)after
: Return files after this ID for pagination (optional)GET /v1/files/{file_id}
Path Parameters:
file_id
: The ID of the file to retrieve (required)GET /v1/files/{file_id}/content
Path Parameters:
file_id
: The ID of the file to retrieve (required)DELETE /v1/files/{file_id}
Path Parameters:
file_id
: The ID of the file to delete (required)Upload a File
Create a Vector Store
Add the File to Vector Store
Search for Content
Document Naming Conventions
Document Structure
File Size Optimization
purpose
parameter to categorize files based on their intended use