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

# 删除单个文件

删除单个已经上传的文件

## 请求地址

`DELETE https://api.stepfun.com/v1/files/{file_id}`

## 路径参数

* `file_id` `string` ***required***

  文件的唯一标识 id

## 请求响应

返回单个[文件对象](https://platform.stepfun.com/docs/zh/api-reference/files/object.md)

## 示例

> [tab] python
>
> ```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> from openai import OpenAI
>
> client = OpenAI(api_key="YOUR_STEP_API_KEY", base_url="https://api.stepfun.com/v1")
>
> print(client.files.delete("file-stepabc"))
> ```

> [tab] js
>
> ```js theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> import OpenAI from "openai";
>
> const openai = new OpenAI({
>     apiKey: "YOUR_STEP_API_KEY",
>     baseURL: "https://api.stepfun.com/v1"
> });
>
> async function main() {
>     const file = await openai.files.del("file-stepabc");
>     console.log(file);
> }
>
> main();
> ```

> [tab] curl
>
> ```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
> curl https://api.stepfun.com/v1/files/file-abc123 \
>   -X DELETE \
>   -H "Authorization: Bearer $STEP_API_KEY"
> ```

```json filename="返回" theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
{
  "id": "file-stepabc",
  "object": "file",
  "deleted": true
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.