Overview
Fireworks provides a CLI tool to export rated dollar costs for serverless inference as a CSV. Rows are bucketed by UTC day and grouped by one dimension you choose — model, model tier, user, or API key — which makes it the fastest way to produce a chargeback or per-team spend report. The export is the CSV counterpart ofPOST /usageCosts:query.
- This page — rated dollar costs for serverless inference, as a CSV grouped by model, model tier, user, or API key.
- Exporting Billing Metrics — metered quantities (tokens, accelerator-seconds) for every usage type, one CSV row per usage event. No dollars.
- Usage & Cost Breakdown — the same data as ad-hoc CLI or HTTP API queries rather than a CSV, with richer grouping and filtering.
This export reports costs for the whole account, so it requires account administrator access. Non-admin users can read their own costs through
POST /usageCosts:query at SELF scope.Exporting usage costs
usage_costs.csv to the current directory.
Examples
Group costs by API key instead of model:Output format
The exported CSV always has these six columns, regardless of which dimension you group by:- account_id: Your Fireworks account ID
- date: UTC day bucket, as
YYYY-MM-DD - group_by_dimension: The dimension the row is grouped by —
model,model_tier,user, orapi_key - group_by_value: The value for that dimension (see below)
- subtotal_usd: Rated cost for that day and value, as an exact decimal with nine fractional digits
- currency: Currency code for
subtotal_usd, for exampleUSD
group_by_value depends on --group-by:
Two reserved values can appear in
group_by_value: unattributed, when the underlying billing
event carries no value for the requested dimension, and unknown_model, when a billing model
can’t be mapped to a public model. Days with an exact-zero subtotal are omitted rather than
written as 0.000000000 rows, so a dimension value only appears on days it actually cost money.Sample row
Automation
Eachfirectl billing export-usage-costs call supports a maximum 31-day time range, and
--start-time cannot be more than 100 days in the past. To export longer historical ranges, run
the command in multiple 31-day chunks and combine the CSV files in your downstream pipeline.
Coverage
- Serverless token usage only. Costs are priced from cached input, uncached input, and output tokens. Dedicated deployment and fine-tuning spend are not included — for those, use Exporting Billing Metrics or the account-level totals from
firectl billing get-usage --account-costs-only. - Subtotals are rated, not invoiced. They price usage with the subscription prices that apply to your account and exclude fixed fees, invoice-level discounts, minimums, credits, and taxes, so they may differ from the final invoice.
- One dimension at a time. Rows are always bucketed by day plus the single dimension passed to
--group-by. To combine dimensions, usePOST /usageCosts:query, which accepts up to two.
See also
POST /v1/accounts/{account_id}/usageCosts:query- The HTTP API behind this export- Exporting Billing Metrics - Raw per-event usage CSV across all usage types
- Usage & Cost Breakdown - Grouped usage and rated cost queries via
firectl billing get-usageand the billing APIs - Serverless pricing - Published per-token prices