---
title: "Delete Usage Rows"
method: DELETE
path: "/v1/usage"
tags: ["usage"]
---

# Delete Usage Rows

`DELETE /v1/usage`

Delete imported usage rows by explicit ids or by filter (standalone).

Target either the current selection (``ids``) or everything matching a filter
(``by_filter: true`` plus optional ``source`` / ``model`` / ``user_id`` /
``status`` / date range / ``priced``). Only imported rows
(``counts_toward_budget = false``) are ever removed: enforced gateway rows and
the spend ledger (``users.spend``) are untouched, so a delete can never desync a
budget. Master-key only.

## Request body

- UsageDeleteRequest — Selection of imported usage rows to delete.
  - `api_key_id` union
    - string
    - string[]
  - `by_filter` boolean
  - `end_date` string, date-time, nullable
  - `endpoint` string, nullable
  - `ids` string[], nullable
  - `model` union
    - string
    - string[]
  - `priced` boolean, nullable
  - `provider` string, nullable
  - `source` string, nullable
  - `source_label` string, nullable
  - `start_date` string, date-time, nullable
  - `status` string, nullable
  - `tool` string, nullable
  - `user_id` union
    - string
    - string[]

## Response `200`

Successful Response

- UsageDeleteResult — How many imported rows the delete removed.
  - `deleted` integer

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/otari.md) · [All operations](https://skmtc.net/mozilla-ai/apis/otari/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/otari/revisions/c05befed4db4/schema)
