Skip to main content
Use the Cost API to export what your organization spends on LLMs: cost, tokens and calls, broken down by model (or provider, user, agent, group or scope), by day or by month. It returns the same numbers as Monitoring → Cost, so exports match what admins see in the app.
The Cost API is part of the Enterprise Edition, like the Cost dashboard.

Authenticate

Send an API key from Profile → API Keys:
Authorization: Bearer bow_... also works. Add X-Organization-Id when the key’s user belongs to more than one organization. What the caller sees follows Monitoring access:

Monthly cost per model

The response holds the total, a month-by-month series for the organization, and one row per model with its own months:
The example is shortened. Each item also carries prompt_tokens, completion_tokens, cache_read_tokens, cache_creation_tokens, input_cost_usd, output_cost_usd and provider_type. The response also carries the same token totals for the whole range.

Parameters

How the numbers add up

  • Periods are UTC. Day buckets are keyed YYYY-MM-DD and month buckets YYYY-MM.
  • Every period is present. A period with no usage comes back with zeros, so you can chart or tabulate the series directly.
  • Partial months hold only the range. With start_date=2026-09-15, the 2026-09 bucket covers September 15 to 30.
  • Series reconcile with the totals. The timeseries sums to total_cost_usd, total_tokens and total_calls. Each item’s series sums to that item’s totals. For model, provider, user and scope, the items in a period add up to that period in timeseries.
  • data_source and group can count a call more than once. A call in a conversation that used two agents, or made by a user in two groups, counts in full under each. Their rows can add up to more than the total, which stays exact.
  • Tokens count cache once. tokens includes cache reads and writes for providers that report them separately, such as Anthropic. For providers that already include cached tokens in the prompt count, such as OpenAI, they are not added again.
  • Cost is fixed when the call is made. Each call is priced with the model’s rates at that time. Changing a model’s pricing later does not change past months.
Use granularity=month for ranges longer than about a year. Daily series stop at roughly 400 days.

Example: monthly spend by model as CSV

For totals by provider instead, use group_by=provider. To set spending caps, see Quotas and usage limits.