Usage
Token usage, cost attribution, and billing metrics.
Track token consumption and cost attribution across projects, teams, and features. Eridian records usage at inference time so FinOps and platform teams can reconcile invoices against granular request metadata without estimating from provider bills alone.
Get Usage
GET /v1/usage?project_id=prj_legal_001&start=2025-06-01&end=2025-06-30
Authorization: Bearer eridian_sk_...
Required scope: usage:read
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project to query |
start | date | Yes | Inclusive start (ISO 8601 date) |
end | date | Yes | Inclusive end |
granularity | string | No | day or hour (default: day) |
group_by | string | No | model, feature, key, or policy |
Example Response
{
"project_id": "prj_legal_001",
"period": { "start": "2025-06-01", "end": "2025-06-30" },
"total_tokens": 2847291,
"total_cost_usd": 4823.17,
"by_model": {
"gpt": { "tokens": 1928471, "cost_usd": 3210.44 },
"gemini": { "tokens": 918820, "cost_usd": 1612.73 }
},
"by_feature": {
"semantic_cache": { "tokens_saved": 847291, "cost_saved_usd": 1204.33 },
"rag": { "tokens": 412847, "cost_usd": 892.11 },
"pii_redaction": { "tokens": 2847291, "cost_usd": 0 }
}
}
Per-Request Attribution
Every inference response includes eridian.cost_usd and is attributed to:
- Project and API key
- Routing policy and selected model
- Feature flags (cache, RAG, PII, structured output)
- Template ID and version (if used)
Export usage data via the Observability dashboard, Usage API, or webhooks (budget.threshold, usage.daily_summary).
Included Tokens and Overage
Commercial capacity is defined in your order form. The usage API reports consumption for governance and attribution; it does not expose the commercial terms of your agreement. See the pricing page for plan details.
| Alert | Trigger | Channel |
|---|---|---|
| 80% included | Monthly allocation | Email + webhook |
| 95% included | Monthly allocation | Email + webhook + dashboard banner |
| Hard stop | 100% when enabled | HTTP 429 budget_exceeded |
Webhook Payload
{
"event": "usage.daily_summary",
"project_id": "prj_legal_001",
"date": "2025-06-15",
"total_tokens": 98472,
"total_cost_usd": 167.32
}
See Governance for budget configuration, Pagination for starting_after on large exports, and Authentication for API key scoping.
Python
usage = client.usage.retrieve(
project_id="prj_legal_001",
start="2026-09-01",
end="2026-09-30",
group_by="model",
)
print(usage.total_cost_usd, usage.by_model["gpt"])
TypeScript
const usage = await client.usage.retrieve({
projectId: "prj_legal_001",
start: "2026-09-01",
end: "2026-09-30",
groupBy: "model",
});Production API credentials are issued with an institution workspace. Contact sales if you need access.