viewa/docs
API Reference

Per-key usage for a period

GET
/usage

What each of your API keys consumed over a period, for reconciling an invoice. Secret key only: it enumerates every key on your instance. Counts come from the same ledger the quotas are enforced against, so uploads and renders are exactly the events that consumed allowance. cachedRenders is reported separately: a render answered from the composition-hash cache never reaches the GPU, never consumes quota, and is not billable. The period defaults to the current UTC calendar month, from its first instant up to now. It is half-open — [from, to) — so consecutive periods never double-count an event. Never cached.

Authorization

secretKey
AuthorizationBearer <token>

Secret key (server-side only), sent as Authorization: Bearer sk_…. This is the higher API-key tier: it satisfies routes requiring either the pk or sk tier. On pk-level routes no Origin header is required, and any forwarded Origin is ignored. The secret key satisfies the API-key tier only; it does not bypass visitor-token requirements, instance scoping, quotas or metering, or any other route-specific authorization. Routes requiring the sk tier remain secret-key-only, including administrative surfaces such as SKU alias registration, the origin allowlist, usage, and visitor deletion.

In: header

Query Parameters

from?string

Start of the period, inclusive, as an RFC 3339 date-time with an explicit offset (2026-09-01T00:00:00Z or 2026-09-01T10:00:00+10:00). A bare date or a zoneless date-time is rejected — a billing period must not depend on a parser's guess. Defaults to the first instant of the current UTC calendar month.

Formatdate-time
to?string

End of the period, exclusive, as an RFC 3339 date-time with an explicit offset, in the same form as from. Defaults to now. The period may span at most 400 days.

Formatdate-time

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/usage?from=2026-09-01T00%3A00%3A00Z"
{  "period": {    "from": "2019-08-24T14:15:22Z",    "to": "2019-08-24T14:15:22Z"  },  "data": [    {      "key": {        "label": "string",        "publishableKey": "string",        "status": "active"      },      "uploads": 0,      "renders": 0,      "cachedRenders": 0    }  ]}