> For the list of every page, fetch /llms.txt. The API contract is the OpenAPI file linked from the API reference.

# Get usage and cost over a date range

GET https%3A%2F%2Fapi.usemeadow.ai/v1/usage

Returns everything a usage page needs in one answer: totals for the range, a time
series in hour or day buckets, per-model figures (cost, error rate, latency, how
often a call fell back to another provider and why, the share of input read from
cache), per-key totals, and sandbox figures (counts by status, running time and
cost per provider, GPU time per GPU class, create time).

`from` is included and `to` is excluded. Both are UTC: a date (`2026-11-24`) or an
RFC 3339 time. Left out, the range is the 7 days that end now. With
`bucket=hour` the range may cover 31 days, with `bucket=day` 366 days.

`group_by` splits the `series` by one field. `totals`, `by_model`, `by_key` and
`sandboxes` do not depend on it. Sandboxes have no model. With `group_by=model`
the series holds model calls only, and `totals` still includes sandboxes. With a
`model` filter every section holds model calls only.

A key with the `admin` scope sees the whole account. Any other key sees its own
usage only, as if `key_id` were set to it.

Cost fields are US dollars. See the Usage tag for what a cost is and when it is
`null`. OpenAI's analogue is `GET /v1/organization/usage/completions` with
`GET /v1/organization/costs`, and OpenRouter's is its Activity page.

Scope: any. Whole-account figures need `admin`.


Reference: https://docs.usemeadow.ai/api-endpoints/usage/get-usage

## Authentication

- `Authorization` header (bearer token, required) — A Meadow API key, sent as `Authorization: Bearer mdw_...`. The header `x-api-key: mdw_...` is accepted in its place.

## Request

### Query parameters

- `from` (string, optional) — Start of the range, included. A UTC date or an RFC 3339 time. Defaults to 7 days before `to`.
- `to` (string, optional) — End of the range, excluded. A UTC date or an RFC 3339 time. Defaults to now.
- `bucket` (enum, optional, default: day) — Width of one point of `series`.
  - Allowed values: `hour`, `day`
- `group_by` (enum, optional, default: none) — Splits `series` by this field. `none` gives one point per bucket.
  - Allowed values: `none`, `project`, `key`, `provider`, `model`
- `project_id` (string, optional) — Count only this project.
- `key_id` (string, optional) — Count only this key. A key without the `admin` scope may pass only its own id.
- `provider` (string, optional) — Count only this provider, for example `anthropic` or `daytona`.
- `model` (string, optional) — Count only this model, by the id Meadow sent to the provider. Leaves sandboxes out.

## Response

### 200

Usage and cost for the range.

- `object` (enum, required) — Always `usage`.
  - Allowed values: `usage`
- `from` (datetime, required) — Start of the range that was read.
- `to` (datetime, required) — End of the range, excluded.
- `bucket` (enum, required)
  - Allowed values: `hour`, `day`
- `group_by` (enum, required)
  - Allowed values: `none`, `project`, `key`, `provider`, `model`
- `currency` (string, required) — The currency of every cost field. Always `USD`.
- `price_version` (string, required) — The version of Meadow's price table that is in use now. Each record keeps the version it was priced with.
- `totals` (UsageTotals, required) — Counts and cost for one group of records. Token sums count measured calls only. Cost fields are US dollars and leave out every record whose cost is unknown.
- `series` (list of UsagePoint, required) — One point per bucket and group that has any usage, in time order. A bucket with no usage has no point.
- `by_model` (list of UsageModelStats, required) — Per-model figures for the range, highest cost first. At most 200.
- `by_key` (list of UsageKeyTotals, required) — Per-key totals for the range, highest cost first. At most 50.
- `sandboxes` (UsageSandboxes, required) — Sandbox figures for the range.

## Errors

### 400 Bad Request Error

A date, `bucket`, `group_by`, `limit` or `cursor` is not valid, the range is too long for the bucket, or a key without the `admin` scope asked for another key's usage.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 401 Unauthorized Error

The key is missing, malformed, unknown, revoked, or expired, or a key it was minted from no longer exists. Check the key and the header.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 429 Too Many Requests Error

More than 20 failed authentications came from your address in one minute, and this request also failed to authenticate: fix the key, wait for `retry-after` seconds, then retry. Or the server instance was full and no slot came free for the account within 3 seconds (`error.code` `account_in_flight_limit_exceeded`): wait for `retry-after` seconds, then retry.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

### 500 Internal Server Error

Meadow failed. Retry with backoff, and tell us if it persists.

- `error` (ErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. Quote it when you report a problem.

## Types

### UsageTotals

Counts and cost for one group of records. Token sums count measured calls only. Cost fields are US dollars and leave out every record whose cost is unknown.

- `requests` (integer, required) — Model calls that passed authentication.
- `requests_served` (integer, required) — Model calls answered with status 200.
- `requests_failed` (integer, required) — Model calls that ended with any other status, a caller that left included.
- `input_tokens` (integer, required) — Input tokens of measured calls, as the vendors reported them. Includes tokens read from and written to a prompt cache.
- `output_tokens` (integer, required) — Output tokens of measured calls: every token billed at the output price, reasoning included. When a vendor leaves reasoning out of its output count and shows it only in its total (Gemini does), Meadow adds the difference here.
- `cache_read_tokens` (integer, required) — The part of `input_tokens` read from a prompt cache.
- `cache_write_tokens` (integer, required) — The part of `input_tokens` written to a prompt cache.
- `reasoning_tokens` (integer, required) — The part of `output_tokens` that was reasoning, as on OpenAI and OpenRouter (`completion_tokens_details.reasoning_tokens`). Never above `output_tokens`.
- `estimated_requests` (integer, required) — Served calls whose vendor reported no token counts, or whose stream was cut before the counts arrived. Their cost is an estimate from the estimated tokens when the model has a list price (it is inside `estimated_price_cost`), and unknown otherwise.
- `estimated_input_tokens` (integer, required) — Meadow's estimate of the input tokens of those calls, from the size of the request. Not in `input_tokens`.
- `estimated_output_tokens` (integer, required) — Meadow's estimate of their output tokens, from the size of the answer. Not in `output_tokens`.
- `unmeasured_attempts` (integer, required) — Attempts at a provider that received the request and may have billed it, though it did not answer the call: the caller left, the provider timed out, or Meadow moved to the next provider. Tokens and cost are unknown.
- `model_cost` (double, required) — Cost of the model calls with a known cost.
- `sandboxes` (integer, required) — Sandboxes that were alive at a vendor at any time in the range.
- `sandbox_seconds` (double, required) — Seconds sandboxes were alive at a vendor inside the range by Meadow's own clock, from the create call to the confirmed delete. A sandbox that fell back from one provider to another counts on both while both held it. `sandbox_cost` can cover fewer seconds: see there.
- `gpu_seconds` (double, required) — Seconds times GPUs, for sandboxes with a GPU.
- `sandbox_cost` (double, required) — Cost of the sandboxes with a known price: the size the vendor granted times its list price. For a sandbox that has ended and whose vendor reports its own start and end times, the time is the window the vendor billed, which starts when the vendor started the sandbox and not when Meadow asked for it. A create attempt that never served the sandbox and that the vendor reports no usage for costs 0. For any other sandbox the time is the seconds in `sandbox_seconds`.
- `cost` (double, required) — `model_cost` plus `sandbox_cost`.
- `unknown_cost_records` (integer, required) — Records with no cost: served model calls with no price or no measured tokens, unmeasured attempts, and sandboxes of a size or GPU class Meadow holds no price for. When this is above 0, `cost` is lower than what you were billed.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: a model id that is on no price page, a call whose tokens Meadow estimated, a Daytona spot GPU, a Modal sandbox with `burst` or a region, a sandbox whose granted size is not confirmed, a sandbox that has ended and is still timed by Meadow's clock (`meadow_clock`), and a record priced after the fact. Each such record has `cost_status` `price_estimated` and says why in `cost_reason`.
- `estimated_price_records` (integer, required) — Records whose cost uses such a price.

### UsagePoint

One bucket of the time series, for one value of the `group_by` field.

- `start` (datetime, required) — Start of the bucket, UTC.
- `group` (string, required) — The value of the `group_by` field for this point: a project id, key id, provider or model. Empty when `group_by` is `none`.
- `requests` (integer, required) — Model calls that passed authentication.
- `requests_served` (integer, required) — Model calls answered with status 200.
- `requests_failed` (integer, required) — Model calls that ended with any other status, a caller that left included.
- `input_tokens` (integer, required) — Input tokens of measured calls, as the vendors reported them. Includes tokens read from and written to a prompt cache.
- `output_tokens` (integer, required) — Output tokens of measured calls: every token billed at the output price, reasoning included. When a vendor leaves reasoning out of its output count and shows it only in its total (Gemini does), Meadow adds the difference here.
- `cache_read_tokens` (integer, required) — The part of `input_tokens` read from a prompt cache.
- `cache_write_tokens` (integer, required) — The part of `input_tokens` written to a prompt cache.
- `reasoning_tokens` (integer, required) — The part of `output_tokens` that was reasoning, as on OpenAI and OpenRouter (`completion_tokens_details.reasoning_tokens`). Never above `output_tokens`.
- `estimated_requests` (integer, required) — Served calls whose vendor reported no token counts, or whose stream was cut before the counts arrived. Their cost is an estimate from the estimated tokens when the model has a list price (it is inside `estimated_price_cost`), and unknown otherwise.
- `estimated_input_tokens` (integer, required) — Meadow's estimate of the input tokens of those calls, from the size of the request. Not in `input_tokens`.
- `estimated_output_tokens` (integer, required) — Meadow's estimate of their output tokens, from the size of the answer. Not in `output_tokens`.
- `unmeasured_attempts` (integer, required) — Attempts at a provider that received the request and may have billed it, though it did not answer the call: the caller left, the provider timed out, or Meadow moved to the next provider. Tokens and cost are unknown.
- `model_cost` (double, required) — Cost of the model calls with a known cost.
- `sandboxes` (integer, required) — Sandboxes that were alive at a vendor at any time in the range.
- `sandbox_seconds` (double, required) — Seconds sandboxes were alive at a vendor inside the range by Meadow's own clock, from the create call to the confirmed delete. A sandbox that fell back from one provider to another counts on both while both held it. `sandbox_cost` can cover fewer seconds: see there.
- `gpu_seconds` (double, required) — Seconds times GPUs, for sandboxes with a GPU.
- `sandbox_cost` (double, required) — Cost of the sandboxes with a known price: the size the vendor granted times its list price. For a sandbox that has ended and whose vendor reports its own start and end times, the time is the window the vendor billed, which starts when the vendor started the sandbox and not when Meadow asked for it. A create attempt that never served the sandbox and that the vendor reports no usage for costs 0. For any other sandbox the time is the seconds in `sandbox_seconds`.
- `cost` (double, required) — `model_cost` plus `sandbox_cost`.
- `unknown_cost_records` (integer, required) — Records with no cost: served model calls with no price or no measured tokens, unmeasured attempts, and sandboxes of a size or GPU class Meadow holds no price for. When this is above 0, `cost` is lower than what you were billed.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: a model id that is on no price page, a call whose tokens Meadow estimated, a Daytona spot GPU, a Modal sandbox with `burst` or a region, a sandbox whose granted size is not confirmed, a sandbox that has ended and is still timed by Meadow's clock (`meadow_clock`), and a record priced after the fact. Each such record has `cost_status` `price_estimated` and says why in `cost_reason`.
- `estimated_price_records` (integer, required) — Records whose cost uses such a price.

### UsageModelStats

One model at one provider, over the whole range.

- `provider` (string, required) — The provider that handled the calls.
- `model` (string, required) — The model id Meadow sent to that provider.
- `error_rate` (double, required) — `requests_failed` divided by `requests`, from 0 to 1.
- `fell_back` (integer, required) — Served calls that this provider answered after an earlier provider in the route failed.
- `fallback_rate` (double, required) — `fell_back` divided by `requests_served`.
- `fallback_reasons` (map from string to integer, required) — Why the first provider in the route failed, by reason code, with the number of calls. The codes are the ones in `error.attempts[].reason`.
- `cache_read_share` (double, required) — `cache_read_tokens` divided by `input_tokens`: the share of measured input that came from a prompt cache.
- `latency_ms` (UsagePercentiles, required) — The median, the 95th and the 99th percentile of a duration in milliseconds. All three are 0 when no call had the duration recorded.
- `first_byte_ms` (UsagePercentiles, required) — The median, the 95th and the 99th percentile of a duration in milliseconds. All three are 0 when no call had the duration recorded.
- `requests` (integer, required) — Model calls that passed authentication.
- `requests_served` (integer, required) — Model calls answered with status 200.
- `requests_failed` (integer, required) — Model calls that ended with any other status, a caller that left included.
- `input_tokens` (integer, required) — Input tokens of measured calls, as the vendors reported them. Includes tokens read from and written to a prompt cache.
- `output_tokens` (integer, required) — Output tokens of measured calls: every token billed at the output price, reasoning included. When a vendor leaves reasoning out of its output count and shows it only in its total (Gemini does), Meadow adds the difference here.
- `cache_read_tokens` (integer, required) — The part of `input_tokens` read from a prompt cache.
- `cache_write_tokens` (integer, required) — The part of `input_tokens` written to a prompt cache.
- `reasoning_tokens` (integer, required) — The part of `output_tokens` that was reasoning, as on OpenAI and OpenRouter (`completion_tokens_details.reasoning_tokens`). Never above `output_tokens`.
- `estimated_requests` (integer, required) — Served calls whose vendor reported no token counts, or whose stream was cut before the counts arrived. Their cost is an estimate from the estimated tokens when the model has a list price (it is inside `estimated_price_cost`), and unknown otherwise.
- `estimated_input_tokens` (integer, required) — Meadow's estimate of the input tokens of those calls, from the size of the request. Not in `input_tokens`.
- `estimated_output_tokens` (integer, required) — Meadow's estimate of their output tokens, from the size of the answer. Not in `output_tokens`.
- `unmeasured_attempts` (integer, required) — Attempts at a provider that received the request and may have billed it, though it did not answer the call: the caller left, the provider timed out, or Meadow moved to the next provider. Tokens and cost are unknown.
- `model_cost` (double, required) — Cost of the model calls with a known cost.
- `sandboxes` (integer, required) — Sandboxes that were alive at a vendor at any time in the range.
- `sandbox_seconds` (double, required) — Seconds sandboxes were alive at a vendor inside the range by Meadow's own clock, from the create call to the confirmed delete. A sandbox that fell back from one provider to another counts on both while both held it. `sandbox_cost` can cover fewer seconds: see there.
- `gpu_seconds` (double, required) — Seconds times GPUs, for sandboxes with a GPU.
- `sandbox_cost` (double, required) — Cost of the sandboxes with a known price: the size the vendor granted times its list price. For a sandbox that has ended and whose vendor reports its own start and end times, the time is the window the vendor billed, which starts when the vendor started the sandbox and not when Meadow asked for it. A create attempt that never served the sandbox and that the vendor reports no usage for costs 0. For any other sandbox the time is the seconds in `sandbox_seconds`.
- `cost` (double, required) — `model_cost` plus `sandbox_cost`.
- `unknown_cost_records` (integer, required) — Records with no cost: served model calls with no price or no measured tokens, unmeasured attempts, and sandboxes of a size or GPU class Meadow holds no price for. When this is above 0, `cost` is lower than what you were billed.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: a model id that is on no price page, a call whose tokens Meadow estimated, a Daytona spot GPU, a Modal sandbox with `burst` or a region, a sandbox whose granted size is not confirmed, a sandbox that has ended and is still timed by Meadow's clock (`meadow_clock`), and a record priced after the fact. Each such record has `cost_status` `price_estimated` and says why in `cost_reason`.
- `estimated_price_records` (integer, required) — Records whose cost uses such a price.

### UsageKeyTotals

One key over the whole range. The 50 keys with the highest cost are returned.

- `key_id` (string, required) — The key. Empty for sandboxes whose key was deleted.
- `requests` (integer, required) — Model calls that passed authentication.
- `requests_served` (integer, required) — Model calls answered with status 200.
- `requests_failed` (integer, required) — Model calls that ended with any other status, a caller that left included.
- `input_tokens` (integer, required) — Input tokens of measured calls, as the vendors reported them. Includes tokens read from and written to a prompt cache.
- `output_tokens` (integer, required) — Output tokens of measured calls: every token billed at the output price, reasoning included. When a vendor leaves reasoning out of its output count and shows it only in its total (Gemini does), Meadow adds the difference here.
- `cache_read_tokens` (integer, required) — The part of `input_tokens` read from a prompt cache.
- `cache_write_tokens` (integer, required) — The part of `input_tokens` written to a prompt cache.
- `reasoning_tokens` (integer, required) — The part of `output_tokens` that was reasoning, as on OpenAI and OpenRouter (`completion_tokens_details.reasoning_tokens`). Never above `output_tokens`.
- `estimated_requests` (integer, required) — Served calls whose vendor reported no token counts, or whose stream was cut before the counts arrived. Their cost is an estimate from the estimated tokens when the model has a list price (it is inside `estimated_price_cost`), and unknown otherwise.
- `estimated_input_tokens` (integer, required) — Meadow's estimate of the input tokens of those calls, from the size of the request. Not in `input_tokens`.
- `estimated_output_tokens` (integer, required) — Meadow's estimate of their output tokens, from the size of the answer. Not in `output_tokens`.
- `unmeasured_attempts` (integer, required) — Attempts at a provider that received the request and may have billed it, though it did not answer the call: the caller left, the provider timed out, or Meadow moved to the next provider. Tokens and cost are unknown.
- `model_cost` (double, required) — Cost of the model calls with a known cost.
- `sandboxes` (integer, required) — Sandboxes that were alive at a vendor at any time in the range.
- `sandbox_seconds` (double, required) — Seconds sandboxes were alive at a vendor inside the range by Meadow's own clock, from the create call to the confirmed delete. A sandbox that fell back from one provider to another counts on both while both held it. `sandbox_cost` can cover fewer seconds: see there.
- `gpu_seconds` (double, required) — Seconds times GPUs, for sandboxes with a GPU.
- `sandbox_cost` (double, required) — Cost of the sandboxes with a known price: the size the vendor granted times its list price. For a sandbox that has ended and whose vendor reports its own start and end times, the time is the window the vendor billed, which starts when the vendor started the sandbox and not when Meadow asked for it. A create attempt that never served the sandbox and that the vendor reports no usage for costs 0. For any other sandbox the time is the seconds in `sandbox_seconds`.
- `cost` (double, required) — `model_cost` plus `sandbox_cost`.
- `unknown_cost_records` (integer, required) — Records with no cost: served model calls with no price or no measured tokens, unmeasured attempts, and sandboxes of a size or GPU class Meadow holds no price for. When this is above 0, `cost` is lower than what you were billed.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: a model id that is on no price page, a call whose tokens Meadow estimated, a Daytona spot GPU, a Modal sandbox with `burst` or a region, a sandbox whose granted size is not confirmed, a sandbox that has ended and is still timed by Meadow's clock (`meadow_clock`), and a record priced after the fact. Each such record has `cost_status` `price_estimated` and says why in `cost_reason`.
- `estimated_price_records` (integer, required) — Records whose cost uses such a price.

### UsageSandboxes

Sandbox figures for the range.

- `by_state` (map from string to integer, required) — Sandboxes that existed in the range, by their status now: `creating`, `running`, `terminating`, `terminated` or `failed`.
- `by_provider` (list of UsageSandboxProvider, required)
- `by_gpu` (list of UsageSandboxGpu, required) — Empty when no sandbox had a GPU.

### ErrorError

- `type` (enum, required) — The class of the failure. - `invalid_request`: the request is malformed or breaks a rule (400), or is too large (413). - `conflict`: the request is valid and the current state refuses it (409). Before 2026-11-24 a 409 used `invalid_request`. - `unauthorized`: the key is missing, unknown, revoked, or expired (401). - `forbidden`: the key's scope or limit does not allow this, or the project's routing is locked (403). - `not_found`: no such resource or route (404). - `no_provider_key`: no stored credential can serve this request (422). - `all_providers_failed`: every vendor in the route was tried (502). - `provider_error`: a vendor failed and no fallback was possible (502). - `rate_limited`: too many requests (429). - `insufficient_quota`: a dollar `limit` on the key, or on a key above it, is spent (402). The name is OpenAI's. - `unavailable`: a dependency Meadow needs is not set up (503). - `internal`: Meadow failed (500), or the feature is not set up (501).
  - Allowed values: `invalid_request`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `no_provider_key`, `all_providers_failed`, `provider_error`, `rate_limited`, `insufficient_quota`, `unavailable`, `internal`
- `message` (string, required) — A sentence for people. It can change, so do not match on it.
- `code` (string, optional) — A stable name for the specific failure. Every Meadow error carries one. `type` stays the general class, and several codes share a type. Branch on `code` when you need to tell two failures of one type apart, for example `api_key_expired` from `api_key_revoked`. The full list is in the Errors guide. A new code can be added at any time, so treat a code you do not know as its `type`. A spent limit (`key_request_limit_exceeded`, `key_token_limit_exceeded`) stays a 403 and not a 429, so a client that retries a 429 does not resend a call a spent key can never make. A spent dollar `limit` (`key_spend_limit_exceeded`) is a 402 for the same reason.
- `param` (string, optional) — The request field, query parameter or header the error is about, when there is one. A nested field is written with dots, such as `credentials.api_key`. Set on most validation errors (400).
- `attempts` (list of Attempt, optional) — The vendors Meadow tried for this request, in order. Present only when it tried at least one.
- `retry` (enum, optional) — Whether to send the same request again. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `safe`: send the same request again, after `retry-after` seconds when the response has that header. A 429, a 409 `exec_start_in_progress` or `idempotency_request_in_progress`, a 502 `sandbox_unreachable`, and a 5xx on a `GET`, `PUT` or `DELETE`, on `POST /v1/sandboxes/route`, or on a sandbox create or background command start sent with `Idempotency-Key`. - `after_fix`: change the request, the key or the account first. Any other 4xx. - `check_outcome`: read the sandbox or the command before you send it again, because the work may have happened. A 5xx on any other `POST`, which includes a blocking command. - `never`: do not send it again. A 501. When the response has `x-should-retry`, `retry` is `safe` exactly when the header is `true`.
  - Allowed values: `safe`, `after_fix`, `check_outcome`, `never`
- `outcome` (enum, optional) — What happened to the work. Set on routes under `/v1/sandboxes` only. The values are BoxRouter's (https://boxrouter.ai/docs/error-codes). - `not_started`: nothing was changed. Every 4xx, a 501, and a 502 `sandbox_unreachable`. - `unknown`: the work may have happened. Any other 5xx. - `completed` and `partial`: the work happened, in whole or in part. Meadow does not send them today. Handle them as `unknown`. A sandbox create that fails after Meadow accepted it is not an error response: the create returns 202, and the sandbox later has `status` `failed` and a `failure_reason`.
  - Allowed values: `not_started`, `completed`, `partial`, `unknown`

### UsagePercentiles

The median, the 95th and the 99th percentile of a duration in milliseconds. All three are 0 when no call had the duration recorded.

- `p50` (double, required) — Half of the calls were at or under this.
- `p95` (double, required) — 95 in 100 calls were at or under this.
- `p99` (double, required) — 99 in 100 calls were at or under this.

### UsageSandboxProvider

Sandbox time and cost at one provider over the range.

- `provider` (string, required)
- `sandboxes` (integer, required) — Sandboxes alive at this provider at any time in the range.
- `sandbox_seconds` (double, required) — Seconds alive at this provider inside the range.
- `cpu_seconds` (double, required) — Seconds times CPUs, at the size the provider granted. A CPU is one vCPU on Daytona and one physical core on Modal.
- `memory_gib_seconds` (double, required) — Seconds times GiB of memory granted.
- `disk_gib_seconds` (double, required) — Seconds times GiB of disk granted. 0 where the provider did not report a disk size.
- `gpu_seconds` (double, required) — Seconds times GPUs.
- `cost` (double, required) — Cost of the sandboxes with a known price.
- `unknown_cost_records` (integer, required) — Sandboxes at this provider with no price.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: at a price the vendor has not confirmed, or for a sandbox that has ended and is still timed by Meadow's clock.
- `estimated_price_records` (integer, required) — Sandboxes whose cost is such an estimate.
- `create_ms` (UsagePercentiles, required) — The median, the 95th and the 99th percentile of a duration in milliseconds. All three are 0 when no call had the duration recorded.

### UsageSandboxGpu

GPU time for one GPU class at one provider over the range.

- `gpu_type` (string, required) — The GPU class the provider served.
- `provider` (string, required)
- `gpu_seconds` (double, required) — Seconds times GPUs. Divide by 3600 for GPU hours.
- `cost` (double, required) — Cost of those sandboxes, CPU, memory and disk included.
- `unknown_cost_records` (long, required) — Sandboxes of this class that have no cost. They are not in `cost`.
- `estimated_price_cost` (double, required) — The part of `cost` that is an estimate: sandboxes with `cost_status` `price_estimated`.
- `estimated_price_records` (long, required) — How many sandboxes of this class have an estimated cost.

### Attempt

One try at one vendor, for a model call or a sandbox create.

- `provider` (enum, required) — The name of a vendor. Model providers and sandbox providers share one list. Model providers: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`. Sandbox providers: `daytona`, `modal`.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `outcome` (enum, required) — How the try ended. - `served`: this vendor served the request. - `unsupported`: the vendor cannot do what was asked, such as a resource size, a network rule, or a model it does not offer. - `refused`: the vendor rejected the request or the stored credential. - `no_capacity`: the vendor had no capacity. - `timeout`: the vendor did not answer in time. - `rate_limited`: the vendor answered 429. - `error`: any other failure.
  - Allowed values: `served`, `unsupported`, `refused`, `no_capacity`, `timeout`, `rate_limited`, `error`
- `reason` (enum, optional) — A stable code for why the try ended as it did. It is narrower than `outcome`, and it is the code to branch on or to count. More values can be added: treat one you do not know like `vendor_error`. - `served`: this vendor served the request. - `no_capacity`: the vendor had no capacity. - `quota_exceeded`: the vendor account is out of quota or credit. - `rate_limited`: the vendor answered 429. - `timeout`: the vendor did not answer in time. - `auth_failed`: the vendor rejected the stored vendor key. - `invalid_request`: the vendor rejected the request itself. - `refused`: the vendor refused for another reason. - `unsupported`: the vendor cannot do what was asked, such as a model, a GPU type, a size or a network rule. - `no_provider_key`: skipped, because no usable vendor key was stored. - `image_pull_failed`, `build_failed`: the vendor could not pull or build the image (sandboxes). - `provider_lost`: the vendor lost the sandbox while it was starting. - `vendor_error`: any other failure.
  - Allowed values: `served`, `no_capacity`, `quota_exceeded`, `rate_limited`, `timeout`, `auth_failed`, `invalid_request`, `refused`, `unsupported`, `no_provider_key`, `image_pull_failed`, `build_failed`, `provider_lost`, `vendor_error`
- `started_at` (datetime, optional) — When Meadow started this try. Absent on attempts recorded before 2026-11-24.
- `finished_at` (datetime, optional) — When this try ended.
- `detail` (string, optional) — A short description of what happened, written by Meadow, such as `provider returned HTTP 404`. On a `served` sandbox attempt it reports resources the vendor granted that differ from the request, such as `provider granted cpu 2 instead of 1.5` or `gpu type H200 instead of H100`. It says `provider built a copy of the image for this size` when this create made a new Daytona snapshot for an `image_id`. On an `unsupported` attempt it carries the vendor's size limit, such as `daytona cannot serve this size: CPU request 8 exceeds maximum allowed per sandbox (4)`. Absent when there is nothing to say.
- `duration_ms` (integer, optional) — How long the try took, in milliseconds.

## Examples

**Response**

```json
{
  "object": "usage",
  "from": "2026-11-24T00:00:00Z",
  "to": "2026-11-25T00:00:00Z",
  "bucket": "day",
  "group_by": "provider",
  "currency": "USD",
  "price_version": "2026-11-25.1",
  "totals": {
    "requests": 42,
    "requests_served": 40,
    "requests_failed": 2,
    "input_tokens": 81200,
    "output_tokens": 9400,
    "cache_read_tokens": 52000,
    "cache_write_tokens": 6000,
    "reasoning_tokens": 1200,
    "estimated_requests": 1,
    "estimated_input_tokens": 300,
    "estimated_output_tokens": 90,
    "unmeasured_attempts": 1,
    "model_cost": 0.1184,
    "sandboxes": 3,
    "sandbox_seconds": 5400,
    "gpu_seconds": 0,
    "sandbox_cost": 0.2491,
    "cost": 0.3675,
    "unknown_cost_records": 2,
    "estimated_price_cost": 0,
    "estimated_price_records": 0
  },
  "series": [
    {
      "start": "2026-11-24T00:00:00Z",
      "group": "anthropic",
      "requests": 42,
      "requests_served": 40,
      "requests_failed": 2,
      "input_tokens": 81200,
      "output_tokens": 9400,
      "cache_read_tokens": 52000,
      "cache_write_tokens": 6000,
      "reasoning_tokens": 1200,
      "estimated_requests": 1,
      "estimated_input_tokens": 300,
      "estimated_output_tokens": 90,
      "unmeasured_attempts": 1,
      "model_cost": 0.1184,
      "sandboxes": 0,
      "sandbox_seconds": 0,
      "gpu_seconds": 0,
      "sandbox_cost": 0,
      "cost": 0.1184,
      "unknown_cost_records": 2,
      "estimated_price_cost": 0,
      "estimated_price_records": 0
    },
    {
      "start": "2026-11-24T00:00:00Z",
      "group": "daytona",
      "requests": 0,
      "requests_served": 0,
      "requests_failed": 0,
      "input_tokens": 0,
      "output_tokens": 0,
      "cache_read_tokens": 0,
      "cache_write_tokens": 0,
      "reasoning_tokens": 0,
      "estimated_requests": 0,
      "estimated_input_tokens": 0,
      "estimated_output_tokens": 0,
      "unmeasured_attempts": 0,
      "model_cost": 0,
      "sandboxes": 3,
      "sandbox_seconds": 5400,
      "gpu_seconds": 0,
      "sandbox_cost": 0.2491,
      "cost": 0.2491,
      "unknown_cost_records": 0,
      "estimated_price_cost": 0,
      "estimated_price_records": 0
    }
  ],
  "by_model": [
    {
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "error_rate": 0.0476,
      "fell_back": 0,
      "fallback_rate": 0,
      "fallback_reasons": {},
      "cache_read_share": 0.6404,
      "latency_ms": {
        "p50": 1840,
        "p95": 6200,
        "p99": 9100
      },
      "first_byte_ms": {
        "p50": 610,
        "p95": 1900,
        "p99": 2400
      },
      "requests": 42,
      "requests_served": 40,
      "requests_failed": 2,
      "input_tokens": 81200,
      "output_tokens": 9400,
      "cache_read_tokens": 52000,
      "cache_write_tokens": 6000,
      "reasoning_tokens": 1200,
      "estimated_requests": 1,
      "estimated_input_tokens": 300,
      "estimated_output_tokens": 90,
      "unmeasured_attempts": 1,
      "model_cost": 0.1184,
      "sandboxes": 0,
      "sandbox_seconds": 0,
      "gpu_seconds": 0,
      "sandbox_cost": 0,
      "cost": 0.1184,
      "unknown_cost_records": 2,
      "estimated_price_cost": 0,
      "estimated_price_records": 0
    }
  ],
  "by_key": [
    {
      "key_id": "key_00009946",
      "requests": 42,
      "requests_served": 40,
      "requests_failed": 2,
      "input_tokens": 81200,
      "output_tokens": 9400,
      "cache_read_tokens": 52000,
      "cache_write_tokens": 6000,
      "reasoning_tokens": 1200,
      "estimated_requests": 1,
      "estimated_input_tokens": 300,
      "estimated_output_tokens": 90,
      "unmeasured_attempts": 1,
      "model_cost": 0.1184,
      "sandboxes": 3,
      "sandbox_seconds": 5400,
      "gpu_seconds": 0,
      "sandbox_cost": 0.2491,
      "cost": 0.3675,
      "unknown_cost_records": 2,
      "estimated_price_cost": 0,
      "estimated_price_records": 0
    }
  ],
  "sandboxes": {
    "by_state": {
      "running": 1,
      "terminated": 2
    },
    "by_provider": [
      {
        "provider": "daytona",
        "sandboxes": 3,
        "sandbox_seconds": 5400,
        "cpu_seconds": 10800,
        "memory_gib_seconds": 21600,
        "disk_gib_seconds": 16200,
        "gpu_seconds": 0,
        "cost": 0.2491,
        "unknown_cost_records": 0,
        "estimated_price_cost": 0,
        "estimated_price_records": 0,
        "create_ms": {
          "p50": 2100,
          "p95": 8800,
          "p99": 8800
        }
      }
    ],
    "by_gpu": []
  }
}
```

**SDK Code**

```python GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
import requests

url = "https://api.example.com/v1/usage"

querystring = {"bucket":"day","from":"2026-11-18","group_by":"model","key_id":"key_00009946","model":"claude-haiku-4-5-20251001","project_id":"prj_0000223e","provider":"anthropic","to":"2026-11-25"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
const url = 'https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
using RestSharp;

var client = new RestClient("https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift GET /v1/usage?from=2026-11-24&to=2026-11-25&group_by=provider. Written by hand from the response shape, not captured live.
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/usage?bucket=day&from=2026-11-18&group_by=model&key_id=key_00009946&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&to=2026-11-25")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```