Skip to main content
GET
Get API key usage

Authorizations

Authorization
string
header
required

Use a JWT bearer token or a Veryfront API key in the Authorization header.

Path Parameters

id
string<uuid>
required

Query Parameters

preset
enum<string>
default:30d

Whole local days, defaulting to 30d. Explicit from/to bounds take precedence over preset, including SDK-supplied defaults.

Available options:
7d,
30d,
90d
from
string<date-time>

Inclusive start. Supply both from and to; these bounds take precedence over preset.

to
string<date-time>

Exclusive end, no later than the end of today in timezone.

timezone
string
default:UTC
granularity
enum<string>
default:day

UTC hours, or local calendar days, Monday-based weeks and months.

Available options:
hour,
day,
week,
month
group_by
enum<string>[]

Grouping dimensions supported by this operation. Repeat the parameter or use a comma-separated list.

Maximum array length: 4
Available options:
project,
model,
api_key,
member
compare
enum<string>

Compare preceding calendar months for whole-month custom ranges, local days for whole-day ranges and presets, or equal elapsed duration otherwise.

Available options:
previous_period
project_reference
string

Narrow usage to one accessible project by UUID or slug. Required for member grouping.

Required string length: 1 - 255

Response

Customer AI spending for one API key: totals, bucketed usage, model and deployment breakdowns, and requested groups/comparison. serving names recorded host/tier facts; null means no deployment was recorded. usd is the customer charge at the credit rate, excluding provider cost. All cuts use one read snapshot.

attribution
object
required

Whether attribution is complete for the returned usage. Treat it as incomplete if enabled is false, recording_since is null, or the selected period includes an unattributed row.

api_key
object
required
timeframe
object
required
summary
object
required
series
object[]
required
models
object[]
required
serving
object[]
required

The same spend cut by the deployment that served it. Ordered by spend descending, then by request count descending, then by host, then by tier; the row whose host and tier are both null is always last, because it is the absence of a record rather than a deployment. Additive: it neither replaces nor re-slices any other field.

scope
object

Reporting scope, echoed for custom or project-filtered queries. A null project_id means no project filter.

group_by
enum<string>[]
Available options:
project,
model,
api_key,
member