Skip to main content

Overview

Deletes a file created through /v1/files. Without Anthropic headers, the route deletes TokenLab batch files or bound image/reference file bindings. With anthropic-beta: files-api-2025-04-14, it uses Anthropic Files API mode for the bound workspace.

Notes

  • Batch file deletion removes the stored batch file record and prevents future batch jobs from using that file ID.
  • Image/reference file deletion asks the selected provider to delete the file, then removes the TokenLab file binding after the provider accepts the deletion.
  • Anthropic Files API mode requires the same Anthropic-native headers used for upload and retrieval.

Example

curl -X DELETE "https://api.tokenlab.sh/v1/files/file_abc123" \
  -H "Authorization: Bearer sk-your-api-key"

Request / Response

Use the interactive OpenAPI panel above for the exact schema.

Response example

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

Important fields

id
string
File identifier that was deleted.
deleted
boolean
Whether the delete request succeeded.