Skip to content

Taskbase — Usage Trends

Reference for tracking and analyzing token usage and costs across runs, tasks, and organizations. Built on ADR-0008, which explains the design and semantics.


Concepts

Term Meaning
Usage Token counts, turns, and cost from a completed run
Tier Requested model size: small, medium, large (tier names), explicit (a specific model id), or unknown when not recorded
Persona The task's assigned agent type, or for review runs the project's current review persona, or for session turns the session's persona (e.g. request-builder)
Role implementation, review, or session for the turns of agent sessions (see Session turns)
Group by Aggregation dimension: day, model, tier, persona, project, runner, escalation or role (comma-separated; default day)
First-pass rate The headline effectiveness indicator: of the tasks completed in a rolling 7 days with a round-1 review verdict, the share that passed first time (see First-pass rate)
Effectiveness index Delivered points per million effective tokens of the tasks completed in the period — what tokens bought, not just what they cost (see Delivery fields). Kept beside the first-pass rate
Effective tokens Fresh input + output + cache write + 0.1 × cache read. For the codex adapter, input includes cached input, so fresh input = input − cache read, floored at 0
Model effectiveness Per-task figures by the model, persona or requested tier that did the work (see Model effectiveness)

Usage per Run

Every completed run reports usage when it finishes. Stored fields:

Field Type Meaning
input_tokens integer Tokens sent to the model. For Claude this excludes cache reads; Codex's figure includes its cached input, which it also reports as cache_read_tokens
output_tokens integer Tokens the model generated
cache_read_tokens integer Input tokens served from the provider's prompt cache
cache_write_tokens integer Input tokens written to the prompt cache
turns integer Model turns the agent took
cost_usd decimal Cost as the provider reports it, or null for unknown. For subscriptions, an API-equivalent figure
models array The same numbers per model, when one run used multiple models

null vs zero: Fields are null when unknown (never 0). An adapter that cannot read usage reports none; a run that crashed or timed out has usage: null.

Session turns

The turns of agent sessions cost subscription usage outside tasks (ADR-0013). Each turn a runner claimed counts as one run with the usage its runner reported:

  • In usage trends a turn has role session, the session's persona (request-builder or attention-helper), the session's project, and the runner, model and requested model of the turn. It counts in its own session totals beside implementation and review, and in total. A turn that expired counts as cancelled. Turns that nobody claimed are not counted.
  • On the request or the task. Once a request session is confirmed, its turns belong to the request task it filed. A session about a task (ADR-0015) belongs to that task from its first turn, confirmed or not. Either way GET /api/tasks/{id}/usage has a session line beside task and reviews (not the task's inline usage), and top_tasks[] shows it. The turns of a session that was never confirmed count in the organization's totals but belong to no task.
  • General chats belong to no organization. A general chat (ADR-0016 §1) has no organization or project, so its turns are in no organization's usage trends (neither GET /api/organizations/{id}/usage nor get_usage with an organization_id) and on no task. They are reported per person and per runner instead: see General chats' usage.
  • Not in effectiveness figures. Context reuse cohorts, the delivery fields and model effectiveness compare task work and leave session turns out.

Per-model breakdown

When a run uses multiple models, models is an array of:

{
  "model": "claude-haiku-4-5",
  "input_tokens": 1200,
  "output_tokens": 300,
  "cache_read_tokens": 50000,
  "cache_write_tokens": 4000,
  "cost_usd": 0.12
}

REST API: Organization Usage

GET /api/organizations/{orgId}/usage

Aggregates usage across runs in an organization, grouped and filtered as requested.

Query parameters:

Parameter Type Default Meaning
from string 30 days ago Start of range: YYYY-MM-DD (UTC) or RFC 3339
to string today End of range: YYYY-MM-DD (UTC, inclusive) or RFC 3339 (exclusive)
group_by string day Aggregation: one dimension, or two joined by a comma, of day, model, tier, persona, project, runner, escalation, role (implementation, review or session), cohort, complexity (delivered points) and class (the task's dependency.class for a dependency_update task, none for all other work; task #1177)

Constraints:

  • Date range can be at most 366 days.
  • If both from and to are YYYY-MM-DD, to is inclusive.
  • If either is RFC 3339 datetime, to becomes exclusive (standard for ranges).
  • Default range is the last 30 days.

Response:

{
  "total": {
    "implementation": { "runs": 10, "runs_with_usage": 10, "input_tokens": 30000, "output_tokens": 15000, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 40, "cost_usd": 1.8 },
    "review": { "runs": 2, "runs_with_usage": 2, "input_tokens": 3000, "output_tokens": 1000, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 5, "cost_usd": 0.3 },
    "total": { "runs": 12, "runs_with_usage": 12, "input_tokens": 33000, "output_tokens": 16000, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 45, "cost_usd": 2.1 },
    "tokens": 49000,
    "tasks": 15,
    "succeeded": 13,
    "runs_with_cost": 12,
    "success_rate": 0.87,
    "tokens_per_run": 4083,
    "cost_per_run": 0.175,
    "tokens_per_task": 3267,
    "cost_per_task": 0.14,
    "implemented_tasks": 10,
    "review_rounds_per_task": 1.5,
    "completed_tasks": 6,
    "delivered_points": 11,
    "unsized_completed_tasks": 1,
    "effective_tokens": 42000.0,
    "effectiveness_index": 261.9,
    "points_per_usd": 2.75
  },
  "groups": [
    {
      "keys": ["2026-09-29", "claude-haiku-4-5"],
      "implementation": { "runs": 2, "runs_with_usage": 2, "input_tokens": 5000, "output_tokens": 2500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 8, "cost_usd": 0.3 },
      "review": { "runs": 0, "runs_with_usage": 0, "input_tokens": 0, "output_tokens": 0, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 0, "cost_usd": 0.0 },
      "total": { "runs": 2, "runs_with_usage": 2, "input_tokens": 5000, "output_tokens": 2500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 8, "cost_usd": 0.3 },
      "tokens": 7500,
      "tasks": 3,
      "succeeded": 3,
      "runs_with_cost": 2,
      "success_rate": 1.0,
      "tokens_per_run": 3750,
      "cost_per_run": 0.15,
      "tokens_per_task": 2500,
      "cost_per_task": 0.1,
      "implemented_tasks": 3,
      "review_rounds_per_task": 0.0,
      "runs_with_wait": 2,
      "median_wait_seconds": 95.5,
      "p90_wait_seconds": 312.0
    },
    { "keys": [...], ... }
  ],
  "top_tasks": [
    { "task_id": 42, "title": "Implement auth module", "project_id": 5, "project_name": "Platform", "implementation": { "runs": 3, "runs_with_usage": 3, "input_tokens": 15000, "output_tokens": 8000, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 20, "cost_usd": 1.8 }, "review": { "runs": 1, "runs_with_usage": 1, "input_tokens": 2000, "output_tokens": 500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 3, "cost_usd": 0.15 }, "total": { "runs": 4, "runs_with_usage": 4, "input_tokens": 17000, "output_tokens": 8500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 23, "cost_usd": 1.95 }, "tokens": 25500 },
    { "task_id": 39, "title": "Fix database migration", "project_id": 5, "project_name": "Platform", "implementation": { "runs": 2, "runs_with_usage": 2, "input_tokens": 8000, "output_tokens": 4000, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 12, "cost_usd": 1.0 }, "review": { "runs": 2, "runs_with_usage": 2, "input_tokens": 4000, "output_tokens": 1500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 5, "cost_usd": 0.4 }, "total": { "runs": 4, "runs_with_usage": 4, "input_tokens": 12000, "output_tokens": 5500, "cache_read_tokens": 0, "cache_write_tokens": 0, "turns": 17, "cost_usd": 1.4 }, "tokens": 17500 }
  ]
}

Response fields:

Field Meaning
total Totals across all runs: four nested UsageTotals objects (implementation, review, session, total) each with runs, runs_with_usage, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, turns, cost_usd; plus derived group-level stats: tokens, tasks, succeeded, runs_with_cost (runs with a cost figure), success_rate (0–1), tokens_per_run, cost_per_run, tokens_per_task, cost_per_task, implemented_tasks, review_rounds_per_task; plus the queue wait fields; plus the delivery fields below, always present
groups[] Aggregated results per combination of keys. Same structure as total, split by the group_by dimensions. The delivery fields are present only when group_by is day alone (see below)
keys Positional array of grouped dimension values (e.g. ["2026-09-29", "claude-haiku-4-5"] when grouping by day,model)
top_tasks[] Top 10 most expensive tasks by cost descending (tokens as tiebreaker): task_id, title, project_id, project_name, implementation (UsageTotals), review (UsageTotals), session (UsageTotals: the turns of the session the request was built in), total (UsageTotals), tokens (cost summary)

Queue wait fields

Every group and the total say how long tasks waited for a runner before these runs claimed them — each run's wait_seconds (Listing runs):

Field Meaning
runs_with_wait Runs whose queue wait is known. Runs from before migration 050 and runs started without a claim have none and are left out
median_wait_seconds Median wait of those runs, in seconds; null when runs_with_wait is 0
p90_wait_seconds 90th percentile wait, interpolated linearly between the closest ranks; null when runs_with_wait is 0

Like every usage figure, a run counts on the UTC day it finished, not the day it was queued or claimed. group_by=day,role gives the figures per day for implementation and review apart, so periods before and after a change — such as a runner's second slot (ADR-0011) — can be compared.

Delivery fields

Introduced by ADR-0008:

Field Meaning
completed_tasks Tasks whose done_at falls in the period and that have at least one agent run (implementation or review); a task a person finished without ever handing it to a runner is not counted
delivered_points Sum of those tasks' points: each task's complexity_points override when a person set one, else its own model tier at completion (small 1, medium 3, large 8) — never a tier a run escalated to
unsized_completed_tasks Of completed_tasks, how many have no tier to read points from (an explicit model id, or no model) and no override — they count as completed but contribute 0 points
effective_tokens fresh input + output + cache_write + 0.1 × cache_read, summed over every run — implementation and review, whenever it ran — of the tasks in completed_tasks. Fresh input is input − cache_read (floored at 0) for the codex adapter, whose input includes its cached input, and input otherwise. The cohorts' effective tokens use the same formula
effectiveness_index delivered_points per million effective_tokens. null, not 0, when completed_tasks is 0 or effective_tokens is 0
points_per_usd delivered_points divided by the cost of those same runs. null unless every one of those runs reported a cost (a Codex subscription run with none makes it null even though its tokens still count toward effective_tokens)

These six fields are always present on total, for the whole range. On groups[] they are present only when group_by is exactly day — grouping by anything else, including day paired with a second dimension (as in the ["2026-09-29", "claude-haiku-4-5"] example above), omits them from that group entirely, since a task's full value cannot be split across a dimension like model or persona without double-counting it.

First-pass rate

The headline effectiveness indicator, chosen by the owner in Taskbase #449 from the analysis in #448 (ADR-0008):

  • A task passed first time when it had one implementation attempt, which succeeded, no run of it was escalated, and its round-1 review approved it. A run that failed within 60 seconds is not an attempt. A blocked verdict counts as not approved.
  • Rate = tasks that passed first time ÷ completed tasks with a round-1 verdict. Completed tasks are those counted in completed_tasks: done_at in the window and at least one agent run. Tasks without a round-1 verdict are left out of the rate and counted as unreviewed_tasks.
  • Rework token share = effective tokens of implementation runs after the first attempt and of review runs after round 1, ÷ effective tokens of all runs of those tasks. Lower is better. Cost is not used, so runs that report none (Codex) count fully.

The response carries it three ways:

Field Window
first_pass The 7 days up to to: the headline
first_pass_daily[] Present only when group_by is day alone: for each day of the range, the 7 days ending with that day, oldest first; day names it
total.first_pass The tasks completed in the whole range
first_pass_window_days The window length, 7

Each is an object with from, to, completed_tasks (= reviewed_tasks + unreviewed_tasks), reviewed_tasks, unreviewed_tasks, first_pass_tasks, rate (null without reviewed tasks), effective_tokens, rework_effective_tokens and rework_token_share (null when no usage is known).

How to read it: higher is better. Read it with its n (reviewed_tasks): daily counts are small and swing. Its known weaknesses: it depends on how strictly the reviewing model judges, so a change of review model moves it; it ignores cost; and it says nothing about tasks that are never reviewed.

Semantics:

  • tier: The requested model when it is a tier name (small, medium, large); explicit when a specific model id was named; unknown when nothing was recorded.
  • escalation: escalated for a run whose escalated_from is set (a review or retry moved it up a tier, ADR-0007); not escalated otherwise.
  • persona: The task's agent assignee, or for review runs the project's current review persona. (Note: the persona name at run time is not stored; a later change to the project's persona will appear in historical queries.)
  • Runs from legacy review tasks: Count toward the task under review — including in completed_tasks and effective_tokens: a legacy review task's own runs are attributed to the task it reviewed, not counted as a second completion.
  • Averages: null when there is nothing to divide by (e.g., tokens_per_run is null if runs_with_cost is 0).
  • Cost averages: Skip runs that reported no cost (e.g., Codex subscriptions). Only runs with a cost figure are counted in runs_with_cost.

Access control:

  • Admins: Can reach every organization.
  • Agents (acting for a run): Can reach only their own organization.
  • Regular users: Must be granted access to the organization.

Error responses:

  • 403 — forbidden: no access to this organization (no grant, or an agent asking about another organization than its run's).
  • 400 — invalid date range or group_by parameter.

The endpoint does not check that the organization exists: a caller allowed to reach any organization (an admin) gets 200 with an empty report for an unknown id.


REST API: General chats' usage

GET /api/usage/general-chats

The usage of general chats, which belong to no organization (see Session turns). ADR-0016 §2 keeps a general chat's usage on the subscription of the runner the person chose, so the report is per person and per runner.

Query parameters:

Parameter Type Default Description
from, to, group_by As for organization usage
runner_id integer — Every general chat on this runner, whoever owns the chat
all boolean false true: every person's general chats

Scope: without runner_id or all, the caller's own general chats (sessions they own). runner_id wins over all when both are given.

Response: scope (mine, runner or all), runner_id (only with runner_id), from, to, group_by, total and groups[] with the same group fields as organization usage. There is no top_tasks. Every turn counts as session usage (role session) with the session's persona, the turn's runner and model, and the project key General chats: group_by=project gives one line, and group_by=runner puts the usage on the chosen runner's subscription.

Access control: people only; agents acting for a run get 403.

  • Own chats: any signed-in person.
  • runner_id: the runner's owners and administrators.
  • all=true: administrators.

Error responses:

  • 400 — invalid date range, group_by, runner_id or all; or a caller without a person's subject asked for its own chats (use runner_id or all=true).
  • 403 — an agent; runner_id for a runner the caller can see but does not own; all=true from a non-administrator.
  • 404 — runner not found: the runner does not exist or the caller cannot see it.

Where the UI shows it

General chats are not on any organization's Usage page; the Taskbase UI shows them in three places, all from GET /api/usage/general-chats with group_by=day:

  • Settings → General chats usage: the signed-in person's own general chats over a From/To range (last 30 UTC days, today included, by default). A total line gives turns, tokens and cost (API-equivalent), "not counted in any organization", followed by a table by UTC day, newest first. Turns that reported no usage count as turns only, with a note saying how many.
  • Settings → Everyone's general chats: the same view of every person's general chats (all=true), shown to administrators only.
  • Runner Settings drawer → General chats: that runner's general chat turns, by anyone, by day (runner_id=). It is shown only to the runner's owners and administrators (can_manage); others see no section and send no request.

An API refusal (for example a 403) is shown with its reason in place of the table.


MCP: get_usage

Agents and people can query organization usage through the MCP server without writing REST calls.

Tool: get_usage

get_usage(
  organization_id?: integer,
  from?: string,
  to?: string,
  group_by?: string,
  cutover?: string,
  general_chats?: boolean,
  runner_id?: integer,
  all?: boolean
) -> { total, groups, top_tasks }

Parameters:

  • organization_id — Organization to query. Required unless general_chats is true.
  • from, to — Optional. Date range (see REST API above). Defaults to last 30 days.
  • group_by — Optional. Aggregation dimensions (comma-separated). Default: day.
  • general_chats — Optional. true reports general chats' usage instead of an organization's; organization_id and cutover are then ignored.
  • runner_id — With general_chats: every general chat on this runner, for its owners and administrators.
  • all — With general_chats: every person's general chats, for administrators.

Returns: Same structure as the REST API response, including the queue wait fields on every group and the total.

Authorization: Scoped by the agent's organization grants. An agent can only query organizations it was granted. General chats' usage is for people: an agent acting for a run is refused.


Usage Page

Each organization's page in the Taskbase UI has a Usage tab (/organizations/{id}/usage) for viewing and analyzing that organization's trends. There is no separate, organization-wide Usage page.

Access

  • Organization tab: On each organization's page, the Usage tab.
  • Old bookmarks: /usage?org=N redirects to organization N's Usage tab; /usage without org redirects to /.
  • From a task: each row in the top-tasks table links to that task on its project board (see Task deep links).

Query interface

  • Date range picker: Set from and to (defaults: last 30 days); a shortcut resets to the last 30 days.
  • By selector: Switches the breakdown table beneath the chart between persona, role, tier, escalation, model, complexity and class. project and runner are available through the REST API and MCP (see above) but not this selector.

Display

  • Tabs: Overview (everything below), Models (Model effectiveness) and Upgrades (Upgrade metrics).
  • Tiles: tokens, cost (API-equivalent), implementation + review runs, cost per task, and the delivery figures for the range — completed tasks, delivered points, the effectiveness index, and points per dollar (API-equivalent cost).
  • First-pass panel: the first-pass rate of the 7 days up to the range's end as "First-pass rate · n=… · 7d", the rework token share, how many completed tasks without a round-1 verdict were left out, the whole range's rate, a daily line of the rolling 7-day value, and a "How to read this" note with the definition.
  • Chart — tokens and delivered points per day: tokens stacked by model (left axis, top 5 models plus "Other"), with delivered points per day as a line of points on a right axis. A Table toggle shows the same days as rows, with a column for each day's effectiveness index.
  • Tooltip: hovering a day shows its tokens by model, plus that day's completed tasks, delivered points and effectiveness index.
  • Context reuse cohorts: for the selected range, and in an observational before/after comparison of complete 30-day windows around a cut-over date. Cohort totals can overlap because a task can have implementation, revision and review runs.
  • "How is this calculated?" note: states the definitions in brief (completion, tier points and the override, effective tokens, attribution) and links to this page.
  • Days with no completions: the delivered-points line shows a gap and the effectiveness index is blank, not zero — a quiet day is not the same as a day with no value.
  • By-dimension table: results for the selected dimension, with totals per group. It has no delivery columns: those populate only when grouped by day alone (see Delivery fields above).
  • Top tasks: Server-sorted table of 10 most expensive tasks by cost descending, with tokens as tiebreaker.
  • Per-run breakdown: Drilling into a task shows each run's usage, model, outcome, and cost.

Setting the complexity override

The complexity points override (1–13) is set from a task's dialog, not the Usage page itself — next to the model picker, which shows each tier's points (small 1, medium 3, large 8) and, once a model or override is chosen, the task's effective points (the override if set, else the tier's, else unsized). Only a person can set it through the task API, MCP or UI; an agent's attempt is refused, since it would be grading its own work.

Context reuse measurement

The Usage page reports context reuse by role/persona and across five cohorts: first implementation, revision, first review, later review, and linked follow-up. Cohort results include run count, median turns per run, fresh input, cache write/read, effective tokens per completed task, review rounds, effectiveness index, and success rate. Runs without usage are shown as a count and excluded from token averages. A task with multiple run classes can contribute to more than one cohort, so cohort totals can overlap.

Context reuse counters show candidate, selected, stale and truncated digest totals; imported input tokens; prompt-prefix cache hits when the adapter reports them (shown against the number measured); and claims that consulted linked tasks. Taskbase stores and aggregates the counters; values will reflect runtime use after runner reporting merges (see Runners and Runs). The counters describe what the runner reported, not proof that a digest reduced total cost or improved delivery. Compare the same cohorts over complete 30-day windows before and after the selected cut-over date. Unless there is a holdout, treat the comparison as observational. Continue to watch success, review rounds and delivery quality beside token use. get_usage accepts an optional cutover date for the comparison; it returns complete 30-day UTC windows before and after that date. See ADR-0009 for the measurement rationale.

Each task in the Usage page's top-tasks table links to its project board with a task query parameter:

https://taskbase.skatzi.com/organizations/{orgId}/projects/{projectId}?task=42

The board opens that task's dialog once, showing the task's full run history and usage (GET /api/tasks/{id}/usage). It is not filtered by the Usage page's date range or grouping. The same ?task=<id> link works from anywhere, not only from the Usage page. The dialog opens once per navigation, so following a link to the task the URL already names (for example from a task's Links section) opens it again.


Model effectiveness

Which model, persona or requested tier (size) delivers best, per task (Taskbase #426, with the first-pass rate added by #450). The source is api/internal/runner/effectiveness.go in the Taskbase repository.

GET /api/organizations/{orgId}/effectiveness

Parameter Default Meaning
from, to last 30 days As for /usage
group_by model model, persona or tier
project_id all projects Limit to one project's tasks
model_choice all tasks preferred, fallback or tier: keep the tasks whose attributing run chose its model that way (Preferred models). Runs from before migration 062 match none
interval none week adds a weekly series per group

Attribution: a task belongs to the model, persona or requested tier of its first succeeded implementation run that opened a pull request. Its whole life counts there: every implementation and review run (legacy review tasks included), revisions, escalations, and runs outside the date range. The date range picks tasks by when that attributing run finished. A task with no such run is not counted. tier is the requested tier, explicit for a model id, or unknown.

Failed fast: failed runs shorter than 60 s (fast_fail_seconds) are counted in failed_fast_runs and left out of runs, minutes, escalation and review figures. Their reported tokens and cost still count, but a missing cost on one of them does not make the cost partial.

Response: organization_id, project_id, from, to, group_by, model_choice (when set), interval, fast_fail_seconds, a total group and groups[] (most tasks first). Each group has a key and these figures; averages are null when there is nothing to divide by:

Field Meaning
tasks Tasks attributed to the group
reviewed_tasks, first_review_approved, first_review_approval_rate Round-1 approved ÷ tasks with a round-1 verdict. blocked counts as not approved; unreviewed tasks are excluded
first_pass_tasks, first_pass_rate Of the reviewed tasks, those that passed first time, done or not, ÷ reviewed_tasks
review_rounds_per_task Averaged over tasks reviewed at least once
runs, runs_per_task Implementation and review runs, without fast failures
failed_fast_runs See above
escalated_runs, escalated_tasks Runs with escalated_from set, and tasks with one
median_implementation_minutes Median over tasks of their implementation runs' minutes
minutes_per_task All runs' minutes, per task
tasks_with_usage and fresh_input_tokens_per_task, output_tokens_per_task, cache_read_tokens_per_task, cache_write_tokens_per_task, effective_tokens_per_task Token averages over tasks with any known usage. Effective tokens = fresh input + output + cache write + 0.1 × cache read; for codex, fresh input = input − cache read
tasks_with_cost, cost_per_task Known cost ÷ tasks with any known cost
cost_coverage complete, partial (some counted runs reported no cost) or unknown (none did)
outcomes { done, needs_attention, open }: where the tasks stand now
context_reuse See below
weeks[] With interval=week: week (its Monday, UTC), tasks, first_review_approval_rate, first_pass_rate, cost_per_task, by when the attributing run finished; empty weeks are null

Context reuse split (ADR-0009): context_reuse.with_digest holds the same figures for tasks whose runs after the first had a selected prior-run digest, and without_digest for tasks whose later runs reported context reuse but selected none. Tasks with no report are in neither group; reported_tasks counts the two together. Runners report it from agent-runner v0.5.9 on.

Cost is the provider's API-equivalent estimate (subscriptions are flat-rate), and Codex reports none.

Access: organization readers. Agents reach it within their run's organization, as with /usage. 400 for an invalid range, group_by, project_id, model_choice or interval.

The MCP tool get_model_effectiveness(organization_id, from?, to?, group_by?, project_id?, model_choice?, interval?) returns the same report (MCP Server).

Models tab

The Usage page's Models tab shows this report with From, To, Project and model-choice filters (Preferred, Fallback, Size only) and a Model / Persona / Size selector. Its table has a sortable column per figure: tasks, first-review approval, first pass, review rounds, runs per task, escalated tasks, failed fast, median implementation minutes, minutes per task, effective tokens per task (hover for the split), cost per task (* when partial, unknown when no run reported one) and done / attention / open. Two sparklines show each group's weekly approval rate and cost per task. Below it, the Context reuse table compares "prior-run digest" with "none" per group, or says "no data yet" until runners report it (agent-runner ≥ v0.5.9). A "How to read this" note gives the attribution rule and definitions.

The Queue wait table below it reads the queue wait fields of GET /api/organizations/{orgId}/usage?group_by=day,role for the tab's From and To (not its Project filter): one row per UTC day and role with a known wait, newest day first, giving runs, median wait and p90 wait. A note under it gives the whole range's median and p90. Without known waits in the range it says so instead.

Upgrade metrics

Whether automatic dependency upgrades work, per dependency class: the success measures of the Renovate ADR §15 (Taskbase task #1177, PR #528). They cover the dependency_update tasks of the organization whose pull request merged in the date range. The sources are api/internal/runner/upgrades.go and upgrades_pg.go in the Taskbase repository (read 2026-10-19).

For the tokens and runs of those tasks by class, use /usage with group_by=class.

GET /api/organizations/{orgId}/usage/upgrades

Parameter Default Meaning
from, to last 30 days As for /usage; they bound the merge time, from inclusive, to exclusive

Which upgrades count: a dependency_update task in one of the organization's projects whose dependency.merged_at falls in the range. The merge webhook sets merged_at, so an upgrade closed without merging, autoclosed or closed as won't do is never counted, and neither is one merged before task #1177 was deployed, since it has no merged_at.

Response: organization_id, from, to, a total and classes[]. classes[] always lists standard, breaking, stateful and core, in that order, then any other class seen. class is empty on the total. Ratios are null when there is nothing to divide by.

Field Meaning
merged_upgrades Upgrades merged in the range
merged_with_release_date, median_days_release_to_merge Median, in days, of the time from release to merge, over the upgrades with a release time. An upgrade's release time is the newest released_at among its dependency.packages; packages without a valid one are skipped, and an upgrade with none is left out
merged_without_person, no_person_share Upgrades that Needs attention never raised an item on (tasks.attention_raised_at is NULL, migration 075), and their share of merged_upgrades
cost_usd, merged_with_cost, cost_per_merged_upgrade cost_usd sums the reported cost of all the upgrades' implementation and review runs, whenever they ran (runs of a legacy review task count for the task under review). merged_with_cost counts the upgrades whose runs reported any cost; cost_per_merged_upgrade = cost_usd ÷ merged_with_cost, so upgrades with unknown cost do not look free
post_merge_failures, rollback_rate Post-merge failure tasks (rows in deploy_failures) linked follow_up_of the upgrade, whenever they came; rollback_rate = post_merge_failures ÷ merged_upgrades. These tasks come from the Flux and promote-prod endpoint

Example, from organization 2 on 2026-10-19 through MCP, with no upgrade merged yet (one class shown; breaking, stateful and core look the same):

{
  "organization_id": 2,
  "from": "2026-09-20T00:00:00Z",
  "to": "2026-10-20T00:00:00Z",
  "total": {"class": "", "merged_upgrades": 0, "merged_with_release_date": 0, "median_days_release_to_merge": null,
            "merged_without_person": 0, "no_person_share": null, "cost_usd": 0, "merged_with_cost": 0,
            "cost_per_merged_upgrade": null, "post_merge_failures": 0, "rollback_rate": null},
  "classes": [
    {"class": "standard", "merged_upgrades": 0, "merged_with_release_date": 0, "median_days_release_to_merge": null,
     "merged_without_person": 0, "no_person_share": null, "cost_usd": 0, "merged_with_cost": 0,
     "cost_per_merged_upgrade": null, "post_merge_failures": 0, "rollback_rate": null}
  ]
}

Access: organization readers, and agents within their run's organization, as with /usage. 400 for an invalid organization id or range.

The MCP tool get_upgrade_metrics(organization_id, from?, to?) returns the same report (MCP Server).

Upgrades tab

The Usage page's Upgrades tab shows this report with From and To filters. Its table has one row per class and a total, with columns Class, Merged, Median days release → merge (with "(n known)" when only some upgrades have a release time), No person, Cost per upgrade and Rollback rate; — stands for a null value. A "How is this calculated?" note under it gives the definitions above in brief.

Open questions

  • Release to merge stays null for pull requests opened before the shared Renovate preset began writing released_at into the taskbase:dep note (Taskbase task #1239).

Querying usage

Common queries

Cost per tier (last 30 days):

GET /api/organizations/2/usage?group_by=tier

Usage per project, by day:

GET /api/organizations/2/usage?group_by=day,project

Queue wait per day, implementation and review apart:

GET /api/organizations/2/usage?group_by=day,role
→ Each group has runs_with_wait, median_wait_seconds and p90_wait_seconds.

Approval and cost by size, weekly:

GET /api/organizations/2/effectiveness?group_by=tier&interval=week

Most expensive tasks in September:

GET /api/organizations/2/usage?from=2026-09-01&to=2026-09-30
→ Response includes top_tasks.

A single task's full history:

GET /api/tasks/42/usage
→ Returns { task, reviews, total } totals for that task and its reviews. (See Runners and Runs.)


Implementation notes

  • Usage is computed on read, so queries are responsive. Heavy usage analysis is deferred to rollup tables if queries become slow.
  • All timestamps are in UTC.
  • Runs from tasks deleted after they ran are still counted in organization totals.
  • Review runs are attributed to their review persona at query time, not at run time. A project's review persona changing does not retroactively change historical data attribution, but future queries will group them differently.