Skip to content
Primary navigation

Delete vector store file

vector_stores.files.delete(strfile_id, FileDeleteParams**kwargs) -> VectorStoreFileDeleted
DELETE/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.

ParametersExpand Collapse
vector_store_id: str
file_id: str
ReturnsExpand Collapse
class VectorStoreFileDeleted:
id: str
deleted: bool
object: Literal["vector_store.file.deleted"]

Delete vector store file

from openai import OpenAI
client = OpenAI()

deleted_vector_store_file = client.vector_stores.files.delete(
    vector_store_id="vs_abc123",
    file_id="file-abc123"
)
print(deleted_vector_store_file)
{
  id: "file-abc123",
  object: "vector_store.file.deleted",
  deleted: true
}
Returns Examples
{
  id: "file-abc123",
  object: "vector_store.file.deleted",
  deleted: true
}