> ## 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>
