> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wafer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Serverless Usage API

> Query your own Serverless token usage and estimated cost.

Use `GET /v1/usage/me` to query usage attributed to the user that owns the API key. The endpoint returns daily buckets, per-model token totals, request counts, and estimated cost.

## Run

```bash theme={null}
curl -s "https://api.wafer.ai/v1/usage/me?period=7d&endpoint=pass.wafer.ai" \
  -H "Authorization: Bearer <SERVERLESS_API_KEY>"
```

## Parameters

* `period` (optional): `1d`, `7d`, or `30d`
* `start_at` and `end_at` (optional): explicit ISO timestamps instead of `period`
* `endpoint` (optional): restrict usage to one endpoint, such as `pass.wafer.ai`
* `pass_account_id` (optional): restrict usage to one pass account UUID

Use either `period` or `start_at` plus `end_at`. If no endpoint is provided, usage is aggregated across endpoints visible to the key's owning user.

## Response Shape

```json theme={null}
{
  "user_id": "00000000-0000-0000-0000-000000000000",
  "pass_account_id": null,
  "period_start": "2026-05-15T20:00:00+00:00",
  "period_end": "2026-05-22T20:00:00+00:00",
  "days": [
    {
      "date": "2026-05-22T00:00:00+00:00",
      "input_tokens": 120000,
      "output_tokens": 24000
    }
  ],
  "models": [
    {
      "model": "Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8",
      "input_tokens": 120000,
      "output_tokens": 24000,
      "cache_read_tokens": 80000,
      "request_count": 42,
      "estimated_cost_cents": 123
    }
  ],
  "total_input_tokens": 120000,
  "total_output_tokens": 24000,
  "total_requests": 42,
  "total_estimated_cost_cents": 123
}
```

## Key Fields

* `days`: token usage buckets over the requested period
* `models`: per-model token totals, cache-read tokens, request counts, and estimated cost
* `total_input_tokens`, `total_output_tokens`: token totals across all returned models
* `total_requests`: total requests attributed to the user in the window
* `total_estimated_cost_cents`: estimated cost in cents for the returned usage

## Errors

* `401`: missing or invalid API key
* `400`: invalid `pass_account_id` or invalid time window
* `429`: rate limit exceeded
