Run Cost Estimates
Breyta run cost estimate guide for creator-facing average run cost, per-run breakdowns, fixed API costs, and LLM token pricing.
Quick Answer
Run cost estimates are advisory. Breyta records step-level cost estimates during a run, summarizes them on the flow page as Avg Estimated Run Cost, and exposes the same data through breyta runs show.
Add costs in two places:
| Cost type | Where to add it | Who owns it |
|---|---|---|
| Fixed API or tool request cost | :metering on the flow/step config | Flow author |
| LLM token cost | llm-pricing in breyta.flows.cost-estimates | Breyta platform code |
Use micros for money fields. One dollar is 1000000 micros, so $0.0020 is 2000 micros.
Fixed API Or Tool Costs
Use :metering when a step has a known per-call cost that Breyta cannot infer from the provider response.
(flow/step :http :get-users
{:connection :api
:path "/users"
:method :get
:metering {:unit :request
:unit-cost-micros 2000
:label "JSONPlaceholder request"}})
unit-cost-micros is the cost per completed step execution. The estimate line uses :label in creator-facing breakdowns, so make it readable.
Use this for:
- paid API requests with a known per-request fee
- enrichment providers with fixed lookup costs
- internal tools where the author wants a transparent estimate line
Do not use :metering for LLM token pricing. LLM costs come from provider/model usage.
LLM Token Costs
LLM and agent steps estimate token cost from provider/model usage returned by the step result. Rates live in llm-pricing in breyta.flows.cost-estimates.
Rates are stored as micros per 1 million tokens:
{:openai
{"gpt-5-mini" {:input-micros-per-mtok 250000
:cached-input-micros-per-mtok 25000
:output-micros-per-mtok 2000000}}}
This example means:
| Rate | Micros | Dollars |
|---|---|---|
| Input tokens | 250000 | $0.25 / 1M |
| Cached input tokens | 25000 | $0.025 / 1M |
| Output tokens | 2000000 | $2.00 / 1M |
If a model is not in the table, Breyta can still show usage but marks that estimate line as unpriced.
View Run Cost Data
The flow page shows the completed-run average as Avg Estimated Run Cost. Open the cost detail from the flow page to see the line-item breakdown.
The CLI uses the same run API response:
breyta runs show <workflow-id> --steps 0 --pretty
Look for:
data.run.costEstimatefor the aggregate run estimatedata.run.costEstimate.lineItemsfor the aggregate breakdowndata.run.steps[].costEstimatefor per-step estimates
Representative shape:
{
"costEstimate": {
"kind": "estimated",
"currency": "USD",
"amountMicros": 3500,
"estimatedUsd": "$0.0035",
"unknownLineCount": 0,
"lineItems": [
{
"source": "configured-metering",
"label": "JSONPlaceholder request",
"amountMicros": 2000,
"estimatedUsd": "$0.0020",
"unit": "request",
"quantity": 1
},
{
"source": "llm",
"provider": "openai",
"model": "gpt-5-mini",
"amountMicros": 1500,
"estimatedUsd": "$0.0015",
"usage": {
"inputTokens": 1000,
"outputTokens": 100,
"totalTokens": 1100
}
}
]
}
}
Notes And Limits
- Estimates are for creator visibility and pricing guidance. They are not a billing ledger.
- A run estimate can mix priced and unpriced line items. When that happens, the known total is shown with an unknown-line count.
- Average run cost is based on completed runs.
- Step-level
:meteringis a flow definition option, so changing it requires pushing and releasing the flow version you want users to run. - Token rates are platform code. Keep the pricing version updated when the table changes.