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

# Delete a file

`DELETE /api/files/{file_id}/`

Delete a file from the upstream OpenAI Files API.

## Path parameters

- `file_id` string, required

## Query parameters

- `provider_id` string, required

## Headers

- `Authorization` string, required

## Response `200`

Deleted file.

- OpenAIBatchDeleteFileResponse200
  - `id` string, required
  - `object` string
  - `deleted` boolean, required

## Other responses

- `401` — Unauthorized - Missing or invalid authentication
- `404` — Not Found

## Changes

- **2026-08-13** `4e064cf81dae` — 1 breaking, 3 info
  - added the new required `query` request parameter `provider_id`
  - added the media type `application/json` for the response with the status `200`
  - added the non-success response with the status `401`
  - added the non-success response with the status `404`
- **2026-07-31** `c26d550029f8` — 1 breaking, 2 info
  - removed the media type `application/json` for the response with the status `200`
  - removed the non-success response with the status `401`
  - removed the non-success response with the status `404`

[Change history](https://skmtc.dev/keywordsai/apis/api-reference/changes/api/files/:file_id/delete.md)

---

[API](https://skmtc.dev/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.dev/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/c61efaf24756/schema)
