# GET /v1/account

The upstream account meter, read live. **Admin only** — a consumer key has no business seeing account-wide spend.

Nothing here is stored or derived by TikData: it is the provider's own numbers for today, including calls this router never saw (the older path-based proxy, anything still hitting the provider directly).

## Request

```bash
curl "https://tikdata.io/v1/account" -H "x-admin-token: $INGEST_TOKEN"
```

No parameters.

## Response — 200

```json
{
  "day": "2026-09-07",
  "spend": 16.7866,
  "freeCreditSpend": 0,
  "requests": 17083,
  "paidRequests": 16918,
  "lastRequestAt": "2026-09-07T20:00:39.016491",
  "reconstructed": {
    "cost": 18.4551,
    "ratio": 0.909591,
    "note": "price-table reconstruction vs the real meter; ~1.0 means the model matches"
  },
  "pricedEndpoints": 1469,
  "tiers": [
    { "min_rpd": 0,     "max_rpd": 1000,       "discount": 0 },
    { "min_rpd": 1000,  "max_rpd": 5000,       "discount": 10 },
    { "min_rpd": 5000,  "max_rpd": 10000,      "discount": 20 },
    { "min_rpd": 10000, "max_rpd": 20000,      "discount": 30 },
    { "min_rpd": 20000, "max_rpd": 30000,      "discount": 40 },
    { "min_rpd": 30000, "max_rpd": 2147483647, "discount": 50 }
  ],
  "topEndpoints": [
    { "uri": "/api/v1/twitter/web/fetch_tweet_detail", "count": 5551,
      "unitPrice": 0.000908, "cost": 5.0408 },
    { "uri": "/api/v1/tiktok/app/v3/fetch_one_video", "count": 4332,
      "unitPrice": 0.000923, "cost": 3.9988 }
  ]
}
```

| field | notes |
|---|---|
| `spend` | real dollars billed today, from the meter |
| `requests` / `paidRequests` | total calls today; paid excludes the free account endpoints |
| `reconstructed.cost` | what the live price table says today's calls *should* have cost |
| `reconstructed.ratio` | `spend / reconstructed.cost` |
| `pricedEndpoints` | size of the live price catalogue |
| `tiers` | the live volume-discount schedule |
| `topEndpoints` | up to 25, by reconstructed cost, each with the discounted `unitPrice` actually applied |

## Reading the ratio

`reconstructed` re-derives the bill from the live price table and the live tiers. A ratio near **1.0** means the pricing model matches what the provider actually charges. It currently runs a little **under** (≈0.91) because the provider's free 24-hour response cache means some counted requests were never billed. A ratio drifting *away* from where it usually sits is the signal that the catalogue moved.

## This is a now-view

The meter reports the current day only and cannot be backfilled. If nothing reads it at a day boundary, that day's account total is gone for good. If you want history, snapshot this endpoint yourself on a schedule.

## Errors

| status | body |
|---|---|
| 401 | `{"error":"admin token required","hint":"send: x-admin-token: <INGEST_TOKEN>"}` |
| 502 | `{"error":"tikhub account endpoints unavailable","hint":"..."}` |
