---
title: "Delete a file"
method: DELETE
path: "/files/{file_id}"
tags: ["Files"]
---

# Delete a file

`DELETE /files/{file_id}`

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

## Path parameters

- `file_id` string, required

## Query parameters

- `workspace_id` string, uuid — Workspace to scope the request to. Defaults to the caller’s default workspace.
- `provider` 'openai' | 'anthropic' — Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.

## Response `200`

The file was deleted.

- union — Confirmation that a file was deleted, in the negotiated shape.
  - OpenRouterFileDeleted — Deletion result in the OpenRouter shape.
    - `_shape` 'openrouter', required
    - `id` string, required
    - `type` 'file_deleted', required
  - OpenAIFileDeleted — Deletion result in OpenAI's shape.
    - `_shape` 'openai', required
    - `deleted` true, required
    - `id` string, required
    - `object` 'file', required
  - AnthropicFileDeleted — Deletion result in Anthropic's shape.
    - `_shape` 'anthropic', required
    - `id` string, required
    - `type` 'file_deleted', required

## Other responses

- `401` — Unauthorized - Authentication required or invalid credentials
- `403` — Forbidden - Authentication successful but insufficient permissions
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - Unexpected server error
- `502` — Bad Gateway - Provider/upstream API failure
- `503` — Service Unavailable - Service temporarily unavailable

---

[API](https://skmtc.net/openrouterteam/apis/openrouter-api.md) · [All operations](https://skmtc.net/openrouterteam/apis/openrouter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openrouterteam/openrouter-api/versions/f3788187f5b7/schema)
