Quick start
Make sure tracing is enabled, run a workflow, then check what it cost:--verbose for a per-call breakdown showing individual steps, token counts, and usage details:
How it works
The cost calculator walks the trace tree and extracts two kinds of billable events:- LLM calls — Reads the model from the loaded prompt config and the token usage (input, output, cached, reasoning). Multiplies each by the model’s per-million-token price.
- HTTP calls — Matches the request URL against known service patterns in the pricing config. Calculates cost from token usage, API units, per-request pricing, or a cost field in the response body, depending on the service type.
Pricing configuration
Output ships with built-in pricing for common LLM models (Anthropic, OpenAI, Google, Perplexity) and API services (Jina, Tavily, Semrush, Exa, DataForSEO). For most workflows, this works out of the box. To add or override pricing, createconfig/costs.yml in your project root:
Model pricing
Each entry undermodels maps a model identifier to its per-million-token prices:
costs.yml
Model names are matched by exact key first, then by prefix —
claude-sonnet-4 matches both claude-sonnet-4 and claude-sonnet-4-20250514.
Service pricing
Each entry underservices defines how to calculate cost for HTTP calls to a specific API. The url_pattern field matches against the request URL, and the type determines the calculation method.
Four pricing types are supported:
token — Price per million tokens
For APIs that report token usage in their response (like Jina Reader):
costs.yml
costs.yml
unit — Price per API unit
For APIs that charge by units (like Semrush):
costs.yml
request — Fixed price per request
For APIs with simple per-request pricing (like Tavily):
costs.yml
response_cost — Cost reported in response
For APIs that return the actual cost in their response (like Exa):
costs.yml
Service config reference
Unknown models
When the calculator encounters a model that isn’t in the pricing config, it reports the cost as $0 and prints a warning:config/costs.yml to include it in future calculations.
CLI reference
Seeoutput workflow cost for the full command reference.