# Network Stats API

> Public aggregate network analytics — total tokens processed, top models, and activity trends.


# Network Stats API

Get network-wide token totals, top models and 24h/7d/30d activity trends. Nothing is per-user, per-workspace or per-key; `model_id` values are public catalog ids.

::endpoint{method="GET" path="/api/v1/analytics/network"}

:::note
Public: no authentication required.
:::

## Request

`GET /api/v1/analytics/network` takes no parameters and no auth headers. The snapshot covers total tokens over 30 days, the top 15 models by tokens (30 days), and hourly (24h) and daily (7d, 30d) volumes.

## Response

```json
{
  "generated_at": "2026-06-26T12:00:00.000Z",
  "totals": {
    "tokens": 1234567890,
    "requests": 50000,
    "prompt_tokens": 800000000,
    "completion_tokens": 400000000,
    "cached_tokens": 30000000,
    "reasoning_tokens": 4567890
  },
  "top_models": [
    {
      "model_id": "openai/gpt-4o",
      "model_name": "GPT-4o",
      "provider": "OpenAI",
      "rank": 1,
      "tokens": 500000000,
      "requests": 25000,
      "share": 0.4051
    }
  ],
  "trend": {
    "24h": [
      { "bucket": "2026-06-26 11:00", "tokens": 5000000, "requests": 200 }
    ],
    "7d": [
      { "bucket": "2026-06-25", "tokens": 80000000, "requests": 3200 }
    ],
    "30d": [
      { "bucket": "2026-06-01", "tokens": 40000000, "requests": 1600 }
    ]
  }
}
```

| Field | Type | Description |
|---|---|---|
| `generated_at` | string \| null | ISO 8601 timestamp of when the snapshot was computed. `null` before the first run. |
| `totals.tokens` | number | Total tokens processed in the last 30 days. |
| `totals.requests` | number | Total inference requests in the last 30 days. |
| `totals.prompt_tokens` | number | Input tokens. |
| `totals.completion_tokens` | number | Output tokens. |
| `totals.cached_tokens` | number | Cached (prompt cache hit) tokens. |
| `totals.reasoning_tokens` | number | Reasoning (chain-of-thought) tokens. |
| `top_models[].model_id` | string | Public catalog model identifier. |
| `top_models[].model_name` | string | Human-readable model name. |
| `top_models[].share` | number | Fraction of total tokens consumed (0–1, 4 dp). |
| `trend["24h"]` | array | Hourly buckets for the last 24 hours (`"YYYY-MM-DD HH:00"`). |
| `trend["7d"]` | array | Daily buckets for the last 7 days (`"YYYY-MM-DD"`). |
| `trend["30d"]` | array | Daily buckets for the last 30 days (`"YYYY-MM-DD"`). |

## Examples

::::tabs

:::tab{label="curl"}
```bash
curl https://anyrouter.dev/api/v1/analytics/network
```
:::

:::tab{label="Python"}
```python
import httpx

stats = httpx.get("https://anyrouter.dev/api/v1/analytics/network").json()
print("Tokens (30d):", stats["totals"]["tokens"])
for m in stats["top_models"][:5]:
    print(m["rank"], m["model_name"], m["tokens"])
```
:::

:::tab{label="TypeScript"}
```typescript
const stats = await (
  await fetch("https://anyrouter.dev/api/v1/analytics/network")
).json()
console.log("Tokens (30d):", stats.totals.tokens)
```
:::

::::

## Caching

Recomputed every 10 minutes and served with:

```http
Cache-Control: public, max-age=600, s-maxage=600
```

`generated_at` shows when the data was last refreshed. A dashboard of this data is at [anyrouter.dev/network](https://anyrouter.dev/network).



## Related

- [Models API](/docs/api-reference/models.md)
- [Providers API](/docs/api-reference/providers.md)
