Upload a file
Upload the file withmultipart/form-data.
The live OpenAPI spec requires file and purpose.
file object with an ID such as file-abc123.
Create a vector store
Create a vector store and attach one or more uploaded file IDs.vs_abc123.
Add more files later
You can add more files to an existing vector store without recreating it.status: "in_progress" while indexing runs.
Check the Files and Vector Stores endpoints in the API Reference if you need to poll for status.
Search the vector store
Use semantic search to retrieve the most relevant chunks for a user question.file_id, filename, score data, and chunk content.
Typical workflow
Use this sequence for most retrieval setups:- Upload the source file.
- Create a vector store with
file_ids, or attach the file later. - Wait for file processing to complete.
- Search the vector store when you need relevant context.