跳转到内容
EN

删除文件

先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。

DELETE/file/v1/files/{file_id}● 支持

请求参数

  • file_idstring必填

    path: ID of a tenant-owned live file, as returned by upload or list; starts with file-.

返回

200 file

错误按 OpenAI 格式返回,参见 错误码

请求示例

curl
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
curl -X DELETE https://api.deepraxis.com/file/v1/files/file_123 \
  -H "Authorization: Bearer $PRAXIS_API_KEY"
Python
# 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepraxis.com/file/v1",
    api_key="$PRAXIS_API_KEY",
)

client.files.delete("file_123")
TypeScript
// 先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepraxis.com/file/v1",
  apiKey: "$PRAXIS_API_KEY",
});

await client.files.delete("file_123");

响应示例 200

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

响应

HTTP 200

OK

application/json

名称 类型 说明
id string File identifier: file- followed by 24 base62 characters. Use the ID returned by upload or list.
object string Object type; always file.
deleted boolean Always true; the file can no longer be read, though downloads already authorized may finish.