BeefAPI Get started

Check the cost.
Then read the record.

BeefAPI records what happened to each request and, once settlement is established, the USD amount it cost. This page shows which unit each model class uses, how cached tokens are counted, and how to read the amounts back.

USAGE RECORDS · TOKEN UNITS · CACHE

VERIFY A REQUEST COST

BEEFAPI
COST CHECK

How do I check what an API request actually cost?

Where the number comes from

Each request is recorded in the Usage log with its model, time, request ID and outcome, and with a USD amount once that amount is established. The readable price list and the machine-readable pricing.usd.json read the same global USD pricebook, so the rate you compare is the rate the catalog publishes.

A record is not always complete at the moment you look. Settlement can arrive after the response, an amount can be pending, a measurement can be flagged as estimated, and a record can be missing from the window you queried. Treat a gap as "not established yet", then check the date range, the key, any filter, and the request ID before drawing a conclusion.

Match the unit before you multiply

  • Text: input_usd and output_usd are USD per million tokens. cache_read_usd and cache_write_usd apply where the catalog publishes them.
  • Images: per_request_usd with unit image is USD per generated image.
  • Video: per_second_usd is keyed by output resolution, plus reference_image_usd for each reference image.
  • A missing cache_read_usd or cache_write_usd means the catalog does not publish that rate. It does not mean the rate is zero.

Read the published units for every model

curl --fail-with-body https://global.beefapi.com/pricing.usd.json

Worked example: an illustrative text estimate

Illustrative arithmetic only. It is not a quote for your account, and the three rates below are placeholders: replace them with the current values published for your model in pricing.usd.json.
ComponentTokensUSD / 1MCost
Input (ordinary)2,000$0.60$0.001200
Input (cache reads)10,000$0.12$0.001200
Output800$2.40$0.001920
Request total12,800 tokens$0.004320

The 12,000 prompt tokens split into 2,000 ordinary input tokens and 10,000 cache reads. The same tokens are not charged twice: the cached portion belongs to the cache category, not to ordinary input as well. One unit is one million tokens, so each line above is tokens / 1,000,000 x rate.

Read it back programmatically

  • GET /v1/usage uses the same Bearer API key as a model call and returns settled_amount, pending_amount, refunded_amount, unknown_records, by_model and daily UTC totals as decimal strings.
  • settled_amount is already net of recorded refunds. Do not subtract refunded_amount again.
  • records counts usage records, not unique HTTP requests: one request can produce both an error record and a charge record.
  • GET /v1/usage/requests?request_id=... looks up one request. A standalone refund adjustment appears as a negative amount.

Usage summary for the last 30 days

curl --fail-with-body 'https://global.beefapi.com/v1/usage' \
  --header "Authorization: Bearer $BEEFAPI_KEY"
What a record does and does not establishBOUNDARIES

A charge record shows that an amount was accounted for; it does not by itself show that your client received a successful response. result describes the outcome and billing_status describes settlement, and the two can disagree. usage_estimated: true means the usage measurement was estimated, which is separate from settlement, so a settled charge can still rest on an estimated measurement. An error record without an amount does not prove the request was free, because settlement can arrive later. Long-context adjustments can raise the rates that apply to a specific text request. Raw quota fields are accounting units, not USD amounts.

Still deciding

Can I know the exact cost before sending the request?

You can estimate it from the published unit and your expected input and output size, as in the worked example above. The recorded charge is what settles, and BeefAPI may reserve credit before a request runs, so a request can be rejected for insufficient credit even when the displayed balance is above zero.

A call failed but there is a charge. Which one is right?

Both can be recorded. result describes the outcome and billing_status describes settlement, and an error record and a charge record can refer to the same request. Read the fields on the request record rather than inferring from the HTTP status.

I cannot find a record at all. Does that mean it was free?

No. A missing record means the amount is not established in the window you queried. Check the date range with the request's own timestamps, confirm you are using the key that sent the request, clear any model filter, and look the request up by its request ID before deciding anything.

Sources

Page facts checked 2026-09-26. Prices, model IDs and client configurations change; the linked sources are authoritative.

REQUEST ID · STATUS · USD COSTOpen the usage log