Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.28 KB

delete.md

File metadata and controls

66 lines (45 loc) · 1.28 KB

Delete vector store file

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.

Path Parameters

  • vector_store_id: string

    The ID of the vector store that the file belongs to.

  • file_id: string

    The ID of the file to delete.

Returns

  • VectorStoreFileDeleted object { id, deleted, object }

    • id: string

    • deleted: boolean

    • object: "vector_store.file.deleted"

      • "vector_store.file.deleted"

Example

curl https://api.openai.com/v1/vector_stores/$VECTOR_STORE_ID/files/$FILE_ID \
    -X DELETE \
    -H 'OpenAI-Beta: assistants=v2' \
    -H "Authorization: Bearer $OPENAI_API_KEY"

200 — Example

{
  "id": "id",
  "deleted": true,
  "object": "vector_store.file.deleted"
}

Example

curl https://api.openai.com/v1/vector_stores/vs_abc123/files/file-abc123 \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "OpenAI-Beta: assistants=v2" \
  -X DELETE

Response example

{
  "id": "file-abc123",
  "object": "vector_store.file.deleted",
  "deleted": true
}