Skip to main content
DELETE
Delete File
Deletes a previously uploaded file. Once deleted, the file no longer counts against your storage quota and cannot be used in chat completions or Batch requests.
showLineNumbers
The delete file endpoint returns a JSON object with the following fields:Response Example
Deletion is permanent. Uploaded files count toward the organization’s total storage quota, which is 10 GiB by default. New uploads are rejected when the quota is reached; delete files you no longer need to free up quota.
If the file does not exist or has already been deleted, the endpoint returns a 404 error. Please verify that the file_id is correct.

Authorizations

Authorization
string
header
required

The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.

Path Parameters

file_id
string
required

The file identifier

Response

Deletion result

id
string
required

Deleted file identifier

object
string
required
Example:

"file"

deleted
boolean
required

Whether the file was deleted successfully