SpyBara
Go Premium

cli/resources/files/methods/delete/index.md 2026-07-10 23:02 UTC to 2026-07-12 06:58 UTC

This page contains 1 addition and 1 deletion.

2026
Thu 9 20:58 Sun 12 06:58

Delete file

$ openai files delete

delete /files/{file_id}

Delete a file and remove it from all vector stores.

Parameters

  • --file-id: string

    The ID of the file to use for this request.

Returns

  • file_deleted: object { id, deleted, object }

    • id: string

    • deleted: boolean

    • object: "file"

Example

openai files delete \
  --api-key 'My API Key' \
  --file-id file_id

Response

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