Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Delete file

files.delete(file_id) -> FileDeleted
DELETE
/files/{file_id}

Delete a file and remove it from all vector stores.

Parameters
file_id: str
Returns
class FileDeleted: …
id: str
deleted: bool
object: Literal["file"]

Delete file

from openai import OpenAI
client = OpenAI()

client.files.delete("file-abc123")
Response example
{
  "id": "file-abc123",
  "object": "file",
  "deleted": true
}
Returns Examples
Response example
{
  "id": "file-abc123",
  "object": "file",
  "deleted": true
}