Start from daily cost, not the invoice

Anthropic's Usage and Cost documentation says the Cost API returns USD cost reports with daily granularity only (1d buckets), reported as decimal strings in cents, and that the daily limit is a maximum of 31 buckets per request. Usage and cost data typically appears within 5 minutes of a request completing. OpenAI's Costs reference says bucket_width currently supports only 1d.

Two consequences follow. A forecast built on cost data works at day resolution, so a spike inside one day is invisible until the day closes. And the cost endpoints can miss spend that exists elsewhere: Anthropic states that Priority Tier costs are not available in the cost endpoint and that code execution appears in the cost endpoint but not the usage endpoint. If you use either, reconcile the totals against your invoice before trusting the series.

For finer shape, both vendors offer a usage endpoint with smaller buckets. Anthropic's usage endpoint supports 1m, 1h, and 1d buckets, and OpenAI's usage endpoints accept 1m, 1h, or 1d. Usage is tokens, not dollars, so convert it with the price table for the model you ran.

Worked example: three projections from 14 days of data

The numbers below are a hypothetical team, chosen to show the arithmetic. Say the first 14 days of a 31-day month cost $2,200 in total: $1,000 in week one and $1,200 in week two. Seventeen days remain.

  • Flat at the 14-day average: $2,200 / 14 = $157.14 per day. Times 17 remaining days is $2,671. Month total about $4,871.
  • Flat at the latest week: $1,200 / 7 = $171.43 per day. Times 17 is $2,914. Month total about $5,114.
  • Growth at 10% per week: week three $1,320, week four $1,452, and the last 3 days at week four's daily rate, $622. Month total about $5,594.
  • Stress at 20% per week: week three $1,440, week four $1,728, last 3 days $741. Month total about $6,109.

Choose the growth rate from your own series

Week-over-week growth is the easiest rate to defend: in the example, $1,200 against $1,000 is 20%. Use it as your stress case, and use half of it as the growth case. Do not extrapolate a single week's growth for a quarter. Check whether the increase came from more requests, longer prompts, or a model change by grouping the usage endpoint by model, which Anthropic's usage API supports along with workspace and service tier.

Separate rows for user traffic, background jobs, and evaluation runs keep a nightly batch from reading as product growth. A batch job that doubles in size shifts the forecast without a single new user.

Adjust for events the trend cannot see

A trailing trend assumes nothing changes. Three things usually do. A planned launch or campaign changes request volume, so add the expected extra requests multiplied by your measured cost per request. A model swap changes the price per token, so multiply that line item by the ratio of new to old price from the provider's pricing page on the day you forecast. A prompt change that lengthens context changes input tokens per request, which shows up in the usage endpoint before it shows up in a daily cost total.

Then compare forecast to actuals every week and change the assumption that failed, not just the total. When the actual daily cost crosses the stress line, treat it as an alert and review the drivers that day rather than at month end.

Frequently asked questions

How accurate can an LLM bill forecast be?

Accuracy depends on how stable your traffic and prompts are. With a steady series, a run-rate projection is close. With a launch or a model change in the window, the spread between flat and stress cases is the honest answer, which is why this guide reports a range rather than one number.

Can I get hourly cost from the Anthropic or OpenAI cost APIs?

No. On 2026-10-15, Anthropic's Cost API supports daily buckets only and OpenAI's Costs endpoint supports 1d only. Hourly and per-minute buckets exist on the usage endpoints, which report tokens, so you convert to dollars with the price table.

Why does my cost API total differ from my invoice?

Anthropic's documentation states that Priority Tier costs are not available in the cost endpoint. Differences can also come from usage outside the endpoint's scope, so reconcile one past month against the invoice before using the series for planning.

Sources and further reading

  1. Anthropic Usage and Cost API (verified 2026-10-15)
  2. OpenAI Costs API reference (verified 2026-10-15)
  3. OpenAI cookbook: Usage API and Cost API (verified 2026-10-15)

FrugalAI uses primary documentation and published research where possible. Product capabilities and prices can change; verify vendor details before procurement or production changes.