---
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[]
  - `workspace_id` string, uuid, nullable

## 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

## Changes

> 127 revisions in range; 1 not diffed.

- **2026-08-19** `3945cde96091` — 1 info
  - added the new optional request property `workspace_id`
- **2026-08-06** `6a81ed6c41ee` — 3 info
  - request property `api_key_id` list-of-types was widened by adding types `array` to media type `application/json`
  - request property `model` list-of-types was widened by adding types `array` to media type `application/json`
  - request property `user_id` list-of-types was widened by adding types `array` to media type `application/json`
- **2026-08-05** `c339f3aee928` — 1 info
  - added the new optional request property `tool`
- **2026-08-03** `18e6c426d62c` — 2 info
  - added the new optional request property `provider`
  - added the new optional request property `source_label`
- **2026-07-24** `fa738a5ab2a5` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/mozilla-ai/apis/otari/changes/v1/usage/set-price/post.md)

---

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