admin

Run costs for one workspace

Recorded run cost and token use for one workspace in a time window of at most 93 days. Returns totals, groups, groups_truncated, rounds and conversations. group_by picks how groups splits the runs. automation gives one group per scheduled task, ordered by cost, and groups runs that no task started by trigger. trigger, model, actor and day group by that value, and model uses the model recorded on each run. rounds splits the first round of every run from its later rounds, each with uncached input, cache read, cache write and output tokens. conversations lists the most expensive conversations, each with its run count, cost, most expensive run and first user message cut to 240 characters. Costs are micro US dollars: 1,000,000 is 1 USD. Auxiliary model calls count in totals but not in rounds. rounds.complete is false when any included run used more rounds than its stored history holds. Reading first user messages is recorded against your staff account.

get/v1/admin/tenants/{tenant_id}/run-costs

Request

  • Base URL: https://api.patricia.app (the document declares no server; this is the origin it was published from)
  • URL: https://api.patricia.app/v1/admin/tenants/{tenant_id}/run-costs
  • Auth: HTTP bearer

Path parameters

tenant_idstring uuid required

The workspace id.

Query parameters

created_afterstring date-time required

Start of the window, an ISO 8601 date-time.

created_beforestring date-time

End of the window, an ISO 8601 date-time. Defaults to now. At most 93 days after created_after.

group_by'automation' | 'trigger' | 'model' | 'actor' | 'day'

How to split runs into groups: automation, trigger, model, actor or day. Defaults to automation.

group_limitinteger

How many groups to return, 1 to 50. Defaults to 10.

conversation_limitinteger

How many conversations to return, 1 to 25. Defaults to 10.

Response

Successful Response

groups_truncatedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.