Skip to main content
POST
Create a vector store file by attaching a File to a vector store.

Path Parameters

string
required
The ID of the vector store.

Request Body

string
required
A File ID that the vector store should use. Useful for tools like file_search that can access files.
object
The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.
object
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format.Keys are strings with a maximum length of 64 characters. Values can be strings (max 512 characters), booleans, or numbers.

Response

Returns a VectorStoreFile object.
string
The identifier of the vector store file.
string
The object type, always vector_store.file.
string
The ID of the vector store that the file is attached to.
string
The status of the vector store file. One of:
  • in_progress
  • completed
  • cancelled
  • failed
integer
The Unix timestamp (in seconds) for when the vector store file was created.

List Vector Store Files

GET https://api.openai.com/v1/vector_stores/{vector_store_id}/files Returns a list of vector store files.

Query Parameters

integer
default:"20"
A limit on the number of objects to be returned. Limit can range between 1 and 100.
string
default:"desc"
Sort order by the created_at timestamp. asc for ascending order and desc for descending order.
string
A cursor for use in pagination.
string
A cursor for use in pagination.
string
Filter by file status. One of in_progress, completed, failed, cancelled.

Retrieve Vector Store File

GET https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} Retrieves a vector store file.

Delete Vector Store File

DELETE https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id} Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.