> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# 删除文件

> 删除批量文件、图像/参考文件绑定，或 Anthropic 模式文件。

## 概述

删除通过 `/v1/files` 创建的文件。不带 Anthropic 请求头时，此路由删除 TokenLab 批量文件，或已绑定的图像/参考文件绑定。带 `anthropic-beta: files-api-2025-04-14` 时，此路由按绑定工作区使用 Anthropic Files API 模式。

## 注意事项

* 删除批量文件会移除已存储的批量文件记录，并阻止之后的批量作业继续使用该文件 ID。
* 删除图像/参考文件会先请求所选提供商删除文件，提供商接受删除后再移除 TokenLab 文件绑定。
* Anthropic Files API 模式需要使用与上传、检索相同的 Anthropic 原生请求头。

## 示例

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.tokenlab.sh/v1/files/file_abc123" \
    -H "Authorization: Bearer sk-your-api-key"
  ```
</RequestExample>

## 请求 / 响应

使用上面的交互式 OpenAPI 面板获取精确 schema。

## 响应示例

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "file_abc123",
    "object": "file",
    "deleted": true
  }
  ```
</ResponseExample>

## 重要字段

<ResponseField name="id" type="string">被删除的文件标识符。</ResponseField>
<ResponseField name="deleted" type="boolean">删除请求是否成功。</ResponseField>
