---
title: "DELETE /ai/v1/files/{file_id}"
method: DELETE
path: "/ai/v1/files/{file_id}"
tags: ["AI Gateway"]
---

# DELETE /ai/v1/files/{file_id}

`DELETE /ai/v1/files/{file_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/v1/files/{file_id}`
- Auth: HTTP bearer

## Path parameters

- `file_id` string, required

## Response `200`

File deleted

- FileDeletedResponse: Reply of `DELETE /ai/v1/files/{file_id}`.
  - `deleted` boolean, required
  - `id` string, required
  - `object` string, required: Always `file`

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions (requires ai_gateway:write)
- `404`: No such file created by the caller

## Changes

- **2026-10-20** `7ee3ab1b2020`: 1 info
  - added the non-success response with the status `403`
- **2026-10-05** `2d395ffb4f03`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/v1/files/:file_id/delete.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
