Skip to content
中文

Delete a file

Upload a file first, then replace the example file ID with its returned ID.

DELETE/anthropic/v1/files/{file_id}● Supported

Official Anthropic docs ↗

Request parameters

  • file_idstringrequired

    path:

Returns

200

Errors follow the Anthropic format — see error codes

Request

curl
# Upload a file first, then replace the example file ID with its returned ID.
curl -X DELETE https://api.deepraxis.com/anthropic/v1/files/file_123 \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01"
Python
# Upload a file first, then replace the example file ID with its returned ID.
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.deepraxis.com/anthropic",
    api_key="$PRAXIS_API_KEY",
)

client.files.delete("file_123")
TypeScript
// Upload a file first, then replace the example file ID with its returned ID.
import Anthropic from "@anthropic-ai/sdk";

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

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

Response 200

{
  "id": "file_dp_01M42FVDJD8QGPRQ0059E7V056",
  "type": "file_deleted"
}

Response

HTTP 200

Deleted

application/json

Name Type Description
id string ID of the deleted file.
type string Deleted object type. For file deletion, this is always "file_deleted".