v54

OpenAPI 3.1.0raw.githubusercontent.com2026-08-038690315.6 KB
usage

Set Usage Price Rows

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.

post/v1/usage/set-price

Request body

api_key_idstring nullable
by_filterboolean
cache_read_price_per_millionnumber nullable
cache_write_price_per_millionnumber nullable
end_datestring date-time nullable
endpointstring nullable
idsstring[] nullable
input_price_per_millionnumber required
modelstring nullable
output_price_per_millionnumber required
pricedboolean nullable
providerstring nullable
sourcestring nullable
source_labelstring nullable
start_datestring date-time nullable
statusstring nullable
user_idstring nullable

Response

Successful Response

matchedinteger
unchangedinteger
updatedinteger