---
title: "Set Usage Price Rows"
method: POST
path: "/v1/usage/set-price"
tags: ["usage"]
---

# Set Usage Price Rows

`POST /v1/usage/set-price`

Set the cost of imported usage rows from manual per-1M rates (standalone).

Target either the current selection (``ids``) or everything matching a filter
(``by_filter: true``). Cost / billing meters / pricing breakdown are recomputed
from each row's own token counts at the supplied ``input`` / ``output`` /
``cache_read`` / ``cache_write`` per-1M rates (manual rates, not a recompute from
configured pricing). Only imported rows (``counts_toward_budget = false``) are
touched, so ``users.spend`` is never affected. Master-key only.

## Request body

- UsageSetPriceRequest — Selection of imported usage rows plus the manual per-1M rates to price them at. ``input`` and ``output`` are required (every row is charged for them); the cache rates are optional and, when omitted, those tokens fold into the fresh-input charge exactly as an unpriced cache rate does in normal metered pricing.
  - `api_key_id` union
    - string
    - string[]
  - `by_filter` boolean
  - `cache_read_price_per_million` number, nullable
  - `cache_write_price_per_million` number, nullable
  - `end_date` string, date-time, nullable
  - `endpoint` string, nullable
  - `ids` string[], nullable
  - `input_price_per_million` number, required
  - `model` union
    - string
    - string[]
  - `output_price_per_million` number, required
  - `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

- UsageSetPriceResult — Outcome of a manual repricing pass. ``matched`` imported rows were recomputed; ``updated`` had their stored cost changed and ``unchanged`` already matched the recomputed value.
  - `matched` integer
  - `unchanged` integer
  - `updated` 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/versions/9efeac9dd037/schema)
