OpenRouter Activity and API keys
OpenRouter Activity is billing truth for gateway traffic: model slug, cost in credits, API key, and cache fields per generation.
Hub: Tokenminning with OpenRouter.
This page answers openrouter activity, openrouter token usage, and openrouter cost tracking.
Open the dashboard
- Go to openrouter.ai/activity
- Filter by API key, model, or date range
- Click a row’s detail view for token breakdown including cache metrics
Export CSV or PDF for weekly reviews — group by Model or API Key to find dominant spend.
Per-key isolation
| Key | Purpose | Cap |
|---|---|---|
| Dev | Cline / Aider / OpenCode interactive | Moderate limit |
| CI | Bots, eval scripts | Low cap, haiku-only allowlist |
| Prod | App traffic | Separate from coding agents |
Rotate keys when a tool leaks into the wrong environment. Queries like openrouter_token ext:ini usually mean hunting leaked keys in repos — use env vars and secret scanners, not committed config.
Analytics API
For programmatic spend reviews, use the Analytics API with a management key :
curl "https://openrouter.ai/api/v1/analytics/query" \
-H "Authorization: Bearer $OPENROUTER_MANAGEMENT_KEY" \
-H "Content-Type: application/json" \
-d '{
"metrics": ["cost", "prompt_tokens", "completion_tokens"],
"dimensions": ["model"],
"filters": [],
"start_time": "2026-01-01T00:00:00Z",
"end_time": "2026-01-31T23:59:59Z"
}'Pass workspace_id to scope results to one workspace. Use group_by=workspace to split rows per project.
Reconcile with client telemetry
| Source | Role |
|---|---|
| OpenRouter Activity | Billing truth |
opencode stats, Cline hints, Aider /tokens | Local trends |
GET /api/v1/generation?id=... | One expensive call |
After a heavy week: which key and model slug moved most? Split keys if one agent consumed the pool.
Organization accounts
Shared credit pool — Activity shows all members’ metadata (model, cost, timing) but not prompt text. Per-developer keys improve cost attribution.
Spending guardrails
- Set spending limit on each key at creation
- Org-level alerts before credits deplete — notifications
- Block CI keys from frontier slugs in client allowlists
- Weekly CSV export for cost attribution by model and key
Troubleshooting
Activity shows frontier model, client shows haiku — fallback succeeded on a rate limit. Activity records the model that actually ran.
Cost higher than token count suggests — check cache_write_tokens (first-turn cache establishment) and platform fee on small requests.
No data for yesterday — Activity covers completed UTC days. Allow a few hours lag for final aggregation.
Related
- OpenRouter hub
- Guardrails
- Prompt caching — inspect cache in Activity detail
- Model routing
- Usage accounting