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

# List recent model calls with tokens and cost

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

Returns one record per model call, newest first: the provider and model that
answered, why Meadow routed it there, tokens by class, the cost, how long it took
and the ids you need to find the same call at the vendor.

`id` is the `x-request-id` Meadow returned for the call. `provider_request_id`
is the vendor's own request id. A record of `kind` `abandoned_attempt` is an
attempt at a provider that may have billed you although another provider, or
nobody, answered: its tokens and cost are unknown. It shares its `id` with the
call it belongs to.

`from` is included and `to` is excluded. Left out, the range is the 24 hours that
end now. A key with the `admin` scope sees the whole account, any other key its
own calls only. No request or response content is recorded.

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


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

## 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 24 hours before `to`.
- `to` (string, optional) — End of the range, excluded. A UTC date or an RFC 3339 time. Defaults to now.
- `limit` (integer, optional, default: 50) — Page size, from 1 to 200. A value outside that range returns 400.
- `cursor` (string, optional) — The `next_cursor` of the previous page. Leave out for the first page. A value Meadow did not issue returns 400.
- `project_id` (string, optional) — List only this project's calls.
- `key_id` (string, optional) — List only this key's calls. A key without the `admin` scope may pass only its own id.
- `provider` (string, optional) — List only calls this provider handled.
- `model` (string, optional) — List only calls for this model, by the id Meadow sent to the provider.
- `status` (enum, optional) — List only `served` calls (a 2xx answer) or only `failed` ones (any other answer).
  - Allowed values: `served`, `failed`
- `fell_back` (boolean, optional) — `true` lists only calls an earlier provider failed before this one answered, `false` only the others.
- `request_id` (string, optional) — Lists only the records of one request, by its `x-request-id`: the `call` record and an `abandoned_attempt` record for each vendor attempt Meadow gave up on after sending. The date range still applies.

## Response

### 200

One page of model call records.

- `object` (enum, required) — Always `list`, as on OpenAI and Stripe.
  - Allowed values: `list`
- `has_more` (boolean, required) — True when another page follows. Then `next_cursor` is set.
- `data` (list of UsageRequest, required) — The records on this page, newest first.
- `next_cursor` (string, required, nullable) — Pass as `cursor` to get the next page. `null` on the last page.

## 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

### UsageRequest

The record of one model call, or of one attempt at a provider that may have billed.

- `id` (string, required) — The call's `x-request-id`.
- `occurred_at` (datetime, required) — When Meadow received the call.
- `project_id` (string, required)
- `key_id` (string, required)
- `kind` (enum, required) — `call` is one model call. `abandoned_attempt` is an attempt that may have been billed though it did not answer.
  - Allowed values: `call`, `abandoned_attempt`
- `provider` (string, required) — The provider that answered, or the last one tried. Empty when no provider was reached.
- `model` (string, required) — The model id Meadow sent to the provider.
- `format` (string, required) — The format of the call: `chat_completions`, `messages`, `responses` or `generate_content`.
- `attempts` (integer, required) — Providers tried for the call.
- `usage_status` (enum, required) — `measured`: the vendor reported the tokens. `estimated`: Meadow estimated them from sizes. `unmeasured`: the provider may have billed and nothing is known. `none`: no provider billed.
  - Allowed values: `measured`, `estimated`, `unmeasured`, `none`
- `requested_model` (string, optional, nullable) — The `model` of the request.
- `served_model` (string, optional, nullable) — The model named in the vendor's answer. It differs from `model` when the vendor resolved an alias or served another model. When it is set, the cost uses its price.
- `status` (integer, optional, nullable) — The HTTP status Meadow returned. 499 when the caller left first.
- `streamed` (boolean, optional, nullable)
- `attempt` (integer, optional) — 0 on a `call` record. On an `abandoned_attempt`, its place among the attempts of that request: 1, 2 and so on, in the order they happened. An attempt that never reached a vendor has no record.
- `fell_back` (boolean, optional, nullable) — True when an earlier provider failed and this one answered.
- `route_reason` (string, optional, nullable) — Why the call went where it did, in words.
- `input_tokens` (integer, optional, nullable) — The whole prompt, tokens read from and written to a prompt cache included.
- `output_tokens` (integer, optional, nullable) — Every token billed at the output price, reasoning included. It is the vendor's output count plus `unattributed_tokens`.
- `total_tokens` (integer, optional, nullable) — `input_tokens` plus `output_tokens`.
- `cache_read_tokens` (integer, optional, nullable) — The part of `input_tokens` read from a prompt cache.
- `cache_write_tokens` (integer, optional, nullable) — The part of `input_tokens` written to a prompt cache.
- `reasoning_tokens` (integer, optional, nullable) — The part of `output_tokens` that was reasoning, as in `completion_tokens_details.reasoning_tokens` on OpenAI and OpenRouter. Never above `output_tokens`.
- `unattributed_tokens` (integer, optional, nullable) — Tokens that were in the vendor's total and in neither its input nor its output count. Meadow reads them as reasoning: they are inside `output_tokens` and `reasoning_tokens`, and are priced at the output rate. `null` when the vendor's counts add up.
- `cost` (double, optional, nullable) — US dollars. `null` when the cost is unknown.
- `cost_status` (string, optional, nullable) — `price_table`: tokens times list price. `price_estimated`: the cost is an estimate, and `cost_reason` says why. `provider_reported`: the cost the vendor returned, with the call or when Meadow read the call back from the vendor. `price_unknown`: no price for this model, tier or tool, or for any model of this provider (`vertex` and `deepseek` have none, and `azure` has prices only for a deployment stored as `GlobalStandard`). `tokens_estimated`: the tokens are an estimate and the model has no list price, so there is no cost. `unmeasured`: an abandoned attempt. `not_served`: the call was not answered.
- `cost_reason` (string, optional, nullable) — Why the cost is unknown or an estimate. With `price_unknown`: `unknown_model`, `service_tier_unconfirmed` (the request asked for a `service_tier` other than the list price and the vendor did not say which tier served it), `served_model_unknown` (the answer names a model other than the one sent, and Meadow holds no price for it), `provider_not_priced`, `time_of_day_price` (the vendor's price depends on the hour of the call, which Meadow does not price: every `deepseek` call), `deployment_type_unknown` (an Azure deployment with no type stored in `deployment_types`), `deployment_type_unpriced` (an Azure deployment type Meadow does not price: Data Zone, Standard, Batch or Developer), `provisioned_throughput` (an Azure provisioned deployment, billed per hour, not per call), `pricing_modifier` (a service tier, speed or inference region Meadow holds no price for, or audio), `server_tool`, `no_cache_rate`, `out_of_range`, or `cache_split_unknown` (a record written before token classes were stored, on a model with a cache price). With `price_estimated` or `tokens_estimated`: `stream_cut` (the stream ended before the vendor sent its counts, so the tokens are estimated from the text sent) or `usage_not_reported` (the answer carried no counts). With `price_estimated` only: `repriced_no_token_classes` (priced after the fact from list prices, for a record written before token classes were stored). With `provider_reported`: `vendor_lookup` (a cut stream read back from the vendor's own record). `repriced`: priced after the fact with nothing assumed. `interrupted`: on an `abandoned_attempt`, the Meadow server stopped while the call was at the vendor, so nothing is known of its tokens or cost. `null` otherwise.
- `duration_ms` (integer, optional, nullable) — From the request arriving to the last byte sent.
- `first_byte_ms` (integer, optional, nullable) — From the request arriving to the first byte of the answer. For a stream this is close to the time to the first token.
- `provider_request_id` (string, optional, nullable) — The vendor's own id for the request, to find it in the vendor's logs or usage export.
- `held_usd` (double, optional, nullable) — US dollars the call held against the key's dollar limit and the hard budgets. Set only on an `abandoned_attempt` with `cost_reason` `interrupted`, whose cost is unknown: Meadow charges this amount to those limits when the hold ends, 10 minutes after the call started or 2 hours after a stream's first byte. `null` on every other record and when the call held nothing.
- `held_tokens` (integer, optional, nullable) — Tokens the call held against the key's token limit, on the same records as `held_usd`. Charged to the limit when the hold ends. `null` otherwise.

### 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`

### 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": "list",
  "has_more": true,
  "data": [
    {
      "id": "req_000000000000000000000138",
      "occurred_at": "2026-11-24T18:02:11.412Z",
      "project_id": "prj_0000223e",
      "key_id": "key_00009946",
      "kind": "call",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "format": "messages",
      "attempts": 1,
      "usage_status": "measured",
      "requested_model": "claude-haiku-4-5-20251001",
      "served_model": "claude-haiku-4-5-20251001",
      "status": 200,
      "streamed": true,
      "fell_back": false,
      "route_reason": "served by anthropic",
      "input_tokens": 1930,
      "output_tokens": 240,
      "total_tokens": 2170,
      "cache_read_tokens": 1200,
      "cache_write_tokens": null,
      "reasoning_tokens": null,
      "unattributed_tokens": null,
      "cost": 0.00205,
      "cost_status": "price_table",
      "cost_reason": null,
      "duration_ms": 1840,
      "first_byte_ms": 610,
      "provider_request_id": "req_00000000000000000000b839"
    }
  ],
  "next_cursor": "0000000000000000_38d5"
}
```

**SDK Code**

```python GET /v1/usage/requests?limit=1. Written by hand from the response shape, not captured live.
import requests

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

querystring = {"fell_back":"true","from":"2026-11-24T00:00:00Z","key_id":"key_00009946","limit":"50","model":"claude-haiku-4-5-20251001","project_id":"prj_0000223e","provider":"anthropic","request_id":"req_000000000000000000000138","status":"failed","to":"2026-11-25T00:00:00Z"}

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

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

print(response.json())
```

```javascript GET /v1/usage/requests?limit=1. Written by hand from the response shape, not captured live.
const url = 'https://api.example.com/v1/usage/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z';
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/requests?limit=1. 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/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z"

	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/requests?limit=1. Written by hand from the response shape, not captured live.
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/usage/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z")

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/requests?limit=1. 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/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php GET /v1/usage/requests?limit=1. 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/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp GET /v1/usage/requests?limit=1. Written by hand from the response shape, not captured live.
using RestSharp;

var client = new RestClient("https://api.example.com/v1/usage/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift GET /v1/usage/requests?limit=1. 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/requests?fell_back=true&from=2026-11-24T00%3A00%3A00Z&key_id=key_00009946&limit=50&model=claude-haiku-4-5-20251001&project_id=prj_0000223e&provider=anthropic&request_id=req_000000000000000000000138&status=failed&to=2026-11-25T00%3A00%3A00Z")! 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()
```