---
title: "Run costs for one workspace"
method: GET
path: "/v1/admin/tenants/{tenant_id}/run-costs"
tags: ["admin"]
---

# Run costs for one workspace

`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

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.

## Path parameters

- `tenant_id` string, uuid, required: The workspace id.

## Query parameters

- `created_after` string, date-time, required: Start of the window, an ISO 8601 date-time.
- `created_before` string, 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'
- `group_limit` integer: How many groups to return, 1 to 50. Defaults to 10.
- `conversation_limit` integer: How many conversations to return, 1 to 25. Defaults to 10.

## Response `200`

Successful Response

- RunCosts
  - `totals` RunCostFigures, required
    - `run_count` integer, required
    - `cost_micro_usd` integer, required
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `cache_read_tokens` integer, required
    - `cache_write_tokens` integer, required
  - `rounds` RunCostRounds, required
    - `first` RoundTokens, required
      - `input_tokens` integer, required
      - `cache_read_tokens` integer, required
      - `cache_write_tokens` integer, required
      - `output_tokens` integer, required
    - `later` RoundTokens, required
      - `input_tokens` integer, required
      - `cache_read_tokens` integer, required
      - `cache_write_tokens` integer, required
      - `output_tokens` integer, required
    - `complete` boolean, required
  - `conversations` RunCostConversation[], required
    - `conversation_id` string, uuid, required
    - `run_count` integer, required
    - `cost_micro_usd` integer, required
    - `most_expensive_run_id` string, uuid, required
    - `first_user_message` string, nullable, required
  - `groups` RunCostGroup[], required
    - `run_count` integer, required
    - `cost_micro_usd` integer, required
    - `input_tokens` integer, required
    - `output_tokens` integer, required
    - `cache_read_tokens` integer, required
    - `cache_write_tokens` integer, required
    - `key` string, required
    - `label` string, required
  - `groups_truncated` boolean, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/patricia/apis/patricia-api.md) · [All operations](https://skmtc.dev/patricia/apis/patricia-api/llms.txt) · [OpenAPI document](https://skmtc.dev/patricia/apis/patricia-api/revisions/0dfb44495ea1?raw)
