Skip to main content
DELETE
https://api.cerebras.ai
/
v1
/
files
/
{file_id}
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

result = client.files.delete("file_123")

print(result)
{
  "id": "file_123",
  "object": "file",
  "deleted": true
}
Deletes a file before its automatic expiration. This removes the file from storage immediately.

Path Parameters

file_id
string
required
The ID of the file to delete.

Response

id
string
The ID of the deleted file.
object
string
The object type, which is always file.
deleted
boolean
Confirms whether the file was successfully deleted.
Deleting a file removes it from storage before its automatic expiration date. Files are automatically deleted after their retention period expires (7 days by default).
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

result = client.files.delete("file_123")

print(result)
{
  "id": "file_123",
  "object": "file",
  "deleted": true
}