/v1/usage— tenant-scoped billing and cost data. Used by your own billing and for portal-token-gated customer dashboards./v1/analytics— protocol-level activity metrics for dashboards.
Usage API
All endpoints acceptstart and end ISO-8601 query params; default window is last 30 days.
Summary
Operation events (paginated)
Every billable operation, individually:Request counts
API request aggregations (distinct from business operations — every HTTP call):External costs
Breakdown of costs Sly paid to external providers on your behalf (Circle fees, Stripe processing, etc.):Analytics API
Protocol-level activity over time — drives the Sly dashboard’s charts. Typically fetched from server-rendered or client-rendered dashboards.Protocol distribution
timeRange:24h|7d|30dmetric:volume(USD) |count(number of operations)
Protocol activity (time series)
timeRange (hourly for 24h, daily for 7d/30d).
Protocol stats
Recent activity
Checkout demand
Portal token access
The/v1/usage/* endpoints accept portal tokens with the usage:read scope, letting you safely embed usage views in customer-facing dashboards without exposing your API key.
portal_* token to the browser; it can call /v1/usage/summary etc. directly. Scope is enforced — out-of-scope calls return 403.
/v1/analytics/* doesn’t support portal tokens (it’s tenant-wide, not customer-scoped).
Freshness
- Usage API — operation_events table is updated within seconds of each operation. Summary aggregations may cache up to 30 seconds.
- Analytics API — up-to-5-minute lag on materialized views for large tenants. For real-time signals, subscribe to webhooks instead.
Endpoints
| Endpoint | Purpose |
|---|---|
GET /v1/usage/summary | Aggregated totals for a window |
GET /v1/usage/operations | Paginated event list |
GET /v1/usage/requests | API request counts |
GET /v1/usage/costs | External provider cost breakdown |
GET /v1/analytics/protocol-distribution | Per-protocol totals |
GET /v1/analytics/protocol-activity | Per-protocol time series |
GET /v1/analytics/protocol-stats | Per-protocol summary stats |
GET /v1/analytics/recent-activity | Recent-N activity feed |
GET /v1/analytics/checkout-demand | Checkout funnel metrics |
