Usage and cost
Meadow records usage and cost in US dollars for model calls and sandboxes. Read them through the API or with mdw usage.
Providers bill you directly. Meadow’s cost records help you track spend before the provider’s invoice arrives.
What a cost is
- For a model call: the cost the provider reported, when it reports one. OpenRouter does. Otherwise the provider’s token counts times the provider’s list price for that model. Input, output, cache reads, cache writes and long cache writes each have their own price.
- For a sandbox: the size the provider granted (CPU, memory, disk, GPU class) times the provider’s list price, for the time the provider billed. While a sandbox runs, that time is Meadow’s own count: from the moment Meadow asks the provider to create it until the provider confirms it is gone. After it ends, Meadow reads the start and end the provider itself reports and uses those, so the cost of a short sandbox can go down. See When a sandbox cost is final.
sandbox_secondsalways shows Meadow’s own count. A create attempt the provider never started costs 0.
A cost leaves out discounts, credits and taxes, and it can lag a price change. Check it against your provider’s invoice before you rely on it.
The prices Meadow uses
getPricing, GET /v1/pricing, returns the price table, with no key needed. Its version is the price_version that GET /v1/usage reports.
Each model price is per million tokens, and each sandbox price is per hour, as decimal strings. Every entry names the provider page it was read from (source), the day (checked), and whether a call has been compared with the provider’s bill (confirmed). The table has price fields only: Meadow’s own notes on each entry are not returned. prices_as_of gives the day each provider’s entries were last all compared with its page. A provider whose date is more than stale_after_days (30) days old, or that has prices and no date, is listed in stale_vendors: check its prices on the provider’s page before you rely on them.
The cost of one sandbox
GET /v1/sandboxes/{sandbox_id} and GET /v1/sandboxes return a cost object on each sandbox. A Modal sandbox with 2 CPU and 4096 MB, read on the hosted beta on 2026-11-28 just after it ended, had this one:
The fields:
It is the same figure GET /v1/usage adds into sandbox_cost. Read cost_status first. With price_unknown, cost is null: an unknown cost is never shown as zero. A sandbox younger than about a minute reads price_unknown with cost_reason not_recorded, because usage records are written once a minute.
When a sandbox cost is final
Meadow’s clock runs longer than the vendor’s. It starts when Meadow asks the vendor for the sandbox and stops when the vendor confirms it is gone. The vendor starts billing after its own create and stops before Meadow’s confirmation. On a short sandbox the gap is large: one Daytona sandbox read 113.2 seconds on Meadow’s clock and Daytona billed 50.9.
So Meadow asks the vendor for the time it billed, 2 minutes after a sandbox ends. If the vendor has no answer yet, Meadow asks again. Each wait is as long as the time since the end, so it doubles, up to 6 hours. Meadow stops asking 4 days after the end.
- If the vendor has the billed time 2 minutes after the end, the cost is final within about 4 minutes of the end. The end is recorded up to a minute after the vendor confirms the delete, and the check runs once a minute.
- If the vendor needs longer, call it D after the end, the cost is final within about twice D, and never more than D plus 6 hours, plus those few minutes.
- Until then the
costobject readscost_statusprice_estimatedwithcost_reasonmeadow_clock, andGET /v1/usagecounts the sandbox inestimated_price_costandestimated_price_records. When a reason about the price also applies, such asgrant_unconfirmed,cost_reasonshows that reason. - If the vendor reports no time within 4 days, the cost stays on Meadow’s clock and
cost_reasonbecomesvendor_window_unavailable. - Meadow reads the vendor’s time with your stored provider key. When you replace or delete a Daytona or Modal key, Meadow first reads the time for every sandbox that has ended and has none yet, with the old key, for up to 20 seconds. A sandbox that ended in the last minute or two may not be at the vendor yet. After a delete, any sandbox still without the vendor’s time reads
vendor_window_unavailable.
Do: store a sandbox’s cost as final when billed_to is set and cost_reason is neither meadow_clock nor vendor_window_unavailable. Before you delete a Daytona or Modal key, wait a few minutes after your last sandbox ended.
When a cost is missing
Meadow never shows a guess as a cost. Where it has a list price and must estimate something, the cost is marked as an estimate: see the end of this section. A record has cost: null when:
- Meadow holds no price for the model at that provider. Calls through
vertexhave no price today. Onazure, the listed OpenAI models have prices on a deployment you store asGlobalStandardindeployment_types(Provider keys); other deployment types have no price, andcost_reasonsays why:deployment_type_unknown,provisioned_throughputordeployment_type_unpriced. Onbedrock, the listed Claude models have prices: aglobal.model ID is priced at AWS’s global rates and every other inference profile at AWS’s regional rates. Afireworksmodel has a price only when it is one ofkimi-k3,glm-5p3andglm-5p3-flash. - The provider’s price depends on the hour of the call (
cost_reasontime_of_day_price). Everydeepseekcall has it: DeepSeek’s pricing page gives a peak and an off-peak price by UTC hour, on weekdays apart from Chinese public holidays. The tokens are stored as the provider reported them. - The provider’s response names a model other than the one sent, and Meadow holds no price for it (
cost_reasonserved_model_unknown). A call is priced at the model in the response,served_modelon the record, and never at the price of the model you asked for. - The provider reported no token counts, or the stream was cut before they arrived, and the model has no list price. Meadow estimates the tokens and reports them apart, in the
estimated_*fields. When the model has a list price the call gets an estimated cost instead: see below. - The call used a service tier, speed or region Meadow holds no price for, audio, or a server tool other than Anthropic web search. Priced: Anthropic US-only inference (
inference_geous, 1.1 times the list price), Anthropic fast mode, thepriorityandflextiers of the Google and OpenAI models whose pricing pages list them, and xAIpriority(an estimate at twice the list price). Anthropic’sinference_geovaluesglobalandnot_available(a model older than Claude 4.6, which has no region setting) are the list price. Not priced: Anthropicpriority, OpenAIscaleandultrafast, xAIfast. - You asked for a
service_tierother than the list price and the provider did not say which tier served the call (cost_reasonservice_tier_unconfirmed). A priority request can be served at standard and billed at standard, so Meadow does not guess. The tier is priced from the provider’s own report of the tier served: for Google thex-gemini-service-tierresponse header, which Meadow returns to you as Google sent it. - A provider received the request and did not answer it: you left, the provider timed out, or Meadow moved to the next provider. The provider may still have billed. These are counted in
unmeasured_attempts.
Every such record is counted in unknown_cost_records. When that number is above 0, the cost beside it is lower than what you were billed.
Some costs are estimates. A model ID that is on no provider price page, a call whose tokens Meadow had to estimate (cost_reason stream_cut or usage_not_reported), a Daytona spot GPU sandbox, a Modal sandbox created with burst or a region, and a sandbox whose granted size or GPU type the provider has not confirmed yet are priced with the best figure Meadow has. For a cut stream the estimate counts the text Meadow received, so it can be low when the provider generated more than it delivered. Their rows carry cost_status price_estimated, and the totals show their sum apart in estimated_price_cost with the count in estimated_price_records.
A cut stream through OpenRouter is read back from OpenRouter a minute or more later, for calls up to 48 hours old. Its row then holds OpenRouter’s own tokens and cost, with cost_status provider_reported and cost_reason vendor_lookup. OpenRouter has no list price in Meadow, so until then the row holds estimated tokens and its cost is null. It stays that way when the read back cannot work: the account stores no OpenRouter key, OpenRouter rejects the key with a 401 or 403, OpenRouter has no record of a call more than 30 minutes old, or six tries over about 30 minutes fail. Meadow does not try such a row again, even after you add the key back.
Tokens
input_tokensis the whole prompt.cache_read_tokensandcache_write_tokensare parts of it.output_tokensis every token billed at the output price.reasoning_tokensis the part of it that was reasoning, as incompletion_tokens_details.reasoning_tokenson OpenAI and OpenRouter.- Some providers leave reasoning out of their output count and show it only in their total. Gemini does. Meadow adds the difference to
output_tokensand toreasoning_tokens, and a single record shows it inunattributed_tokens. - On a record,
total_tokensisinput_tokensplusoutput_tokens.
Read usage over a date range
getUsage returns everything a usage page needs in one answer.
from is included and to is excluded. Both are UTC: a date or an RFC 3339 time. Left out, the range is the 7 days that end now.
With bucket=hour a range may cover 31 days. With bucket=day it may cover 366.
Filter with project_id, key_id, provider and model. Sandboxes have no model. With group_by=model the series holds model calls only, and the totals still include sandboxes. With a model filter every section holds model calls only.
List single calls
listUsageRequests lists model calls, newest first.
Each record has the provider and model that answered, why the call was routed there, tokens by class, cost, cost_status, cost_reason (why a cost is missing), duration_ms, first_byte_ms and two IDs: id is the x-request-id Meadow returned for the call, and provider_request_id is the provider’s own ID, which finds the same call in the provider’s logs.
A record of kind abandoned_attempt is a provider attempt that may have been billed without answering. It shares its id with the call it belongs to. A call that was at its provider when a Meadow server stopped without warning is an abandoned_attempt with cost_reason interrupted, cost null and no tokens. It appears about an hour after the call started, once Meadow has read it back from its logs. Its held_usd (and held_tokens on a key with a token limit) is what the call held against your key limits and hard budgets. Meadow charges that amount to them when the hold ends, 10 minutes after the call started or 2 hours after a stream’s first byte, so a limit can move with no priced record: this field is where the amount comes from.
Page with limit (1 to 200) and the next_cursor of the page before.
Who can read what
Any key can call both routes. A key with the admin scope reads the whole account. Any other key reads only its own usage, and a key_id that is not its own returns 400.
From the command line
mdw usage prints the totals, one trend line per group, and tables for models, keys and sandboxes. Add --json for the API’s answer.
How fresh each figure is
When a Meadow server stops abruptly, for example when it runs out of memory, the records it had not yet written are missing until a Meadow operator restores them from the server’s logs. That does not happen by itself.
How long Meadow adds to a call
Meadow’s own time on a model call is mostly database round trips made before your provider is called. On the hosted beta in the 10 days to 2026-11-28, a non-streaming call spent about 60 ms in Meadow at the median (p99 about 145 ms), on top of the provider’s own time. A key with a request, token or dollar limit adds about two more round trips, one before the call and one after it. A sandbox command adds a little more than a model call: one more round trip before the provider and one after. These are measurements, not a promise, and they change as Meadow changes.
Checks against your provider accounts
Several times a day Meadow compares its cost figures with the provider’s own, to find sandboxes or calls it missed. It uses the provider key you stored, and it only reads: your Daytona sandbox usage, your Modal billing report, and your OpenRouter key’s spend for the day. It changes nothing at the provider. The other providers have no spend API that a normal key can read, so they are not compared.
The same check looks for orphans: sandboxes alive at Daytona or Modal that Meadow already cleaned up. An orphan is matched to the create attempt Meadow made for it, by the vendor’s id or by the name Meadow gave it. Each one is logged and counted in the check’s result. Meadow’s own server deletes them only when its operator sets MEADOW_ORPHAN_SWEEP_DELETE=true. A sandbox that carries Meadow’s label but matches no attempt, for example one made by another Meadow server with the same vendor key, is reported and never deleted. An orphan’s usage record ends when Meadow cleaned up its attempt, so the time it ran after that is missing from Meadow’s own figure until the orphan is deleted. The vendor’s billed window covers that time where the vendor reports one per sandbox (Daytona).
How long records are kept
90 days. No request or response content is recorded: a record holds IDs, model names, counts, times and cost.
How long records are kept
getRetention returns how many days usage records are kept before only daily sums remain, and how many days audit log entries are kept. null means kept with no limit.
To see every vendor attempt of one request, filter the request log by its id: GET /v1/usage/requests?request_id=<x-request-id>. It lists the call record and an abandoned_attempt record, numbered by attempt, for each vendor attempt Meadow gave up on after sending. An attempt that never reached a vendor has no record.