Skip to main content
DELETE
https://api.keywordsai.co
/
api
/
files
/
{file_id}
import requests

file_id = "file-abc123"
url = f"https://api.keywordsai.co/api/files/{file_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.delete(url, headers=headers)
print(response.json())
{
  "id": "file-abc123",
  "object": "file",
  "deleted": true
}
Delete a file from OpenAI’s storage. This is useful for cleanup and managing storage costs.
Important: Deleting a file is permanent and cannot be undone. Make sure you no longer need the file or have downloaded its contents before deletion.
Customer credentials required: This endpoint requires your own OpenAI API key configured in Keywords AI dashboard (Settings → Providers).

Path parameters

file_id
string
required
The unique identifier of the file to delete. Format: file-xxxxx
file-abc123

Response

Returns a confirmation object indicating the file was deleted.
{
  "id": "file-abc123",
  "object": "file",
  "deleted": true
}
import requests

file_id = "file-abc123"
url = f"https://api.keywordsai.co/api/files/{file_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.delete(url, headers=headers)
print(response.json())