MyBotBoxMyBotBox
Billing & Usage

Usage

Inspect per-execution token + cost usage and export to CSV.

The Usage page (/workspace/<id>/usage) shows every workflow execution in your workspace with the tokens used, the model selected, and the cost. It's the lowest-level view available — for plan limits and aggregates, use the Spending page.

Date-range filters

The toolbar exposes five preset windows plus a custom range:

PresetWhat it shows
1dLast 24 hours
7dLast 7 days
30dLast 30 days
MTDMonth-to-date (1st of the current month → now)
Last monthPrevious calendar month

Clicking a preset re-queries /api/billing/usage with from and to set to the chosen window. Pagination is cursor-based (Stripe-style) — Prev / Next walk through 100 rows at a time.

Columns

ColumnMeaning
DateWhen the execution started
TypeIncluded while cumulative cost ≤ your monthly limit; On-Demand once you cross it
WorkflowWorkflow name (linked when available)
ModelThe AI model used for that execution
TokensTotal tokens (input + output)
CostDollar cost; shows Included for rows that didn't increase your billable On-Demand

The Type is derived at read time from the cumulative running total versus your userStats.currentUsageLimit — there's no type column in the database, just one source of truth (cost) compared to one limit.

Export CSV

The Export CSV button downloads up to 10,000 rows for the current range as a CSV with these columns:

Date,Execution,Workflow,Trigger,Model,Tokens,Cost (USD)

Filename pattern: usage-<workspaceId>-<YYYY-MM-DD>.csv.

Export ignores the table's pagination — it streams every row in the selected range up to the 10K cap. For larger queries, narrow the date range or call /api/billing/usage with a cursor.

Where the data comes from

Each row maps to a workflow_execution_logs record (one per execution). Per-call cost lives in the cost JSONB column populated by the executor (apps/sat/lib/logs/execution/logger.ts). The Usage page projects {model, tokens, total} out of that JSONB on read.

The query is workspace-scoped and joins permissions to enforce access checks — you only see executions in workspaces you have access to.

API access

Everything visible on this page is also available programmatically. See the API reference:

  • GET /api/billing/usage — paginated rows with cursor-based pagination
  • GET /api/billing/usage/export — CSV stream of the same query