Skip to main content
DELETE
/
files
/
{file_id}
Delete a file
curl --request DELETE \
  --url https://openrouter.ai/api/v1/files/{file_id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "file_011CNha8iCJcU1wXNR6q4V8w",
  "type": "file_deleted"
}

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Path Parameters

file_id
string
required
Example:

"file_011CNha8iCJcU1wXNR6q4V8w"

Query Parameters

workspace_id
string<uuid>

Workspace to scope the request to. Defaults to the caller’s default workspace.

Example:

"a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7"

Response

The file was deleted.

Confirmation that a file was deleted.

id
string
required
type
enum<string>
required
Available options:
file_deleted