Billing
Usage & Cost
GET
cURL
Retrieve your workspace’s usage and cost for a time window — the same per-request-type breakdown shown in the dashboard, available with your API key. Use it to reconcile billing or power an internal usage dashboard.
Usage is aggregated across every Environment in the workspace; it is not scoped to a single Environment or API key.
Choosing a Window
Set the window with aperiod (trailing days, 1–365, default 30) or an explicit from/to range — never both. from and to are inclusive, must be sent together with from no later than to or today, and can span at most 365 days. Set them to the same day to read a single day’s usage.
Cost
Each request type returns acount and a cost_micros.
Costs are integers in micro-USD — millionths of one US dollar — so amounts stay exact. Divide by 1,000,000 to convert to dollars:
250000 is $0.25. Each category’s cost_micros is its count times your workspace’s configured price for that category; unpriced categories (including video and website artifacts) return a 0 cost.Next Steps
Check One Event
Submit Events that this usage counts.
Policies
See how each checked Event maps to a request type.
Authorizations
API Key required. Format: Bearer wc-your-api-key
Headers
API Version
Query Parameters
Trailing window in days (1–365). Mutually exclusive with from/to. Defaults to 30.
Required range:
1 <= x <= 365Inclusive start day (YYYY-MM-DD). Requires to. Mutually exclusive with period.
Inclusive end day (YYYY-MM-DD). Requires from. Mutually exclusive with period.
Response
Success
Inclusive first day covered (YYYY-MM-DD).
Inclusive last day covered (YYYY-MM-DD).
Total cost across all categories, in millionths of one USD.
