Files

Deletes a file owned by the requesting workspace. Deletion is irreversible.

delete/files/{file_id}

Request

  • Base URL: https://openrouter.ai/api/v1
  • URL: https://openrouter.ai/api/v1/files/{file_id}
  • Auth: HTTP bearer

Path parameters

file_idstring required
Example:or_file_011CNha8iCJcU1wXNR6q4V8w

Query parameters

workspace_idstring uuid

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

Example:a103d8b6-42f0-4e50-9a3c-bf41e2c3c1a7
provider'openai' | 'anthropic'

Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.

Example:openai

Response

The file was deleted.

OR
OR

Example response

{
  "_shape": "openrouter",
  "id": "or_file_011CNha8iCJcU1wXNR6q4V8w",
  "type": "file_deleted"
}

Changes

    • breaking

      for the path request parameter file_id, the minLength was increased from 0 to 1

    • breaking

      added the pattern ^[\w-]+$ to the path request parameter file_id

    • warning

      for the path request parameter file_id, the maxLength was set to 256

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      added the new optional query request parameter provider

    • info

      added response discriminator for the response status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status