---
title: "Aggregate Billing"
method: GET
path: "/api/v1/billing"
tags: ["Billing"]
---

# Aggregate Billing

`GET /api/v1/billing`

Returns aggregate token counts and billed totals across all completed runs since server start.

## Response `200`

Aggregate billing data

- AggregateBilling — Aggregate token counts and billed totals across all runs since server start.
  - `totals` AggregateBillingTotals, required — Aggregate billing totals across all runs.
    - `runs` integer, required — Total number of completed runs.
    - `input_tokens` integer, required — Total input tokens.
    - `output_tokens` integer, required — Total output tokens.
    - `total_tokens` integer, required — Total tokens aggregated across all billing categories.
    - `reasoning_tokens` integer, required — Total reasoning tokens.
    - `cache_read_tokens` integer, required — Total cache read tokens.
    - `cache_write_tokens` integer, required — Total cache write tokens.
    - `total_usd_micros` integer, nullable — Total billed USD amount in micros.
    - `timing` RunTiming, required — Timing rollup for an entire run. Active fields sum work across stage visits, so `active_time_ms` can exceed `wall_time_ms` when parallel branches run concurrently. For a running run, stages still in flight contribute a live estimate rather than nothing, so wall and active both advance continuously. Unlike `StageTiming`, active is not clamped to wall here — concurrent branches can legitimately sum past run wall time.
      - `wall_time_ms` integer, required
      - `inference_time_ms` integer, required
      - `tool_time_ms` integer, required
      - `active_time_ms` integer, required — Equals `inference_time_ms + tool_time_ms`.
  - `by_model` BillingByModel[], required — Billing grouped by model.
    - `model` BillingModelRef, required — Provider-qualified billing model identity used for cost estimates.
      - `provider` string, required — LLM provider identifier.
      - `model_id` string, required
      - `speed` 'standard' | 'fast' — Optional provider-specific model speed tier used for cost estimates.
    - `stages` integer, required — Number of usage-bearing stage visits that used this model.
    - `billing` BilledTokenCounts, required — Token counts with optional billed USD micros totals.
      - `input_tokens` integer, required — Number of input tokens consumed.
      - `output_tokens` integer, required — Number of output tokens generated.
      - `total_tokens` integer, required — Total billable tokens aggregated across categories.
      - `reasoning_tokens` integer, required — Number of reasoning tokens.
      - `cache_read_tokens` integer, required — Number of cache read tokens.
      - `cache_write_tokens` integer, required — Number of cache write tokens.
      - `total_usd_micros` integer, nullable — Billed USD amount in micros.

---

[API](https://skmtc.net/fabro-sh/apis/fabro-run-api.md) · [All operations](https://skmtc.net/fabro-sh/apis/fabro-run-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fabro-sh/fabro-run-api/revisions/bee030053823/schema)
