Events
List gateway events
Fetch Frontier Gateway billing events over a time window. Cursor-paginated, with optional filters by API key prefix and external entity ID.
Fetch the per-request billing events that Frontier Gateway records for your inference traffic. Each event carries token counts, the calling group’s external entity ID, and the API key prefix that made the request. These are the same
API_BILLING_USAGE events that billing webhooks deliver: use this endpoint to pull them on demand instead of running a webhook receiver. For webhook delivery, signature verification, and retry semantics, see Billing events.
Authentication
string
required
Workspace API key with management scope, passed as
Authorization: Api-Key $BASETEN_API_KEY (or Bearer; both are accepted). Federated gateway keys are rejected: this is an operator endpoint, not an inference credential.Query parameters
string
required
Inclusive start of the fetch window, in ISO 8601 UTC, for example
2026-08-01T00:00:00Z. Required unless you pass cursor to continue a previous page.string
Exclusive end of the window, in ISO 8601 UTC. Defaults to the current time, minus a short ingestion holdback, so events from roughly the last minute aren’t returned yet. The window is evaluated once: the cursor pins it, so pagination continues inside the same window.
integer
Page size. Default 100, maximum 1000.
array of strings
Filter to events charged against these API key prefixes, repeated once per prefix, for example
api_keys=sky_abc12345&api_keys=sky_def67890. Omit to return events for all keys.array of strings
Filter to events for these external entity IDs (the group’s
metadata.external_entity_id), repeated once per ID. Omit to return events for all groups.string
Pagination cursor from the previous response’s
pagination.cursor. When present, all other parameters are ignored: the cursor carries the window, page size, and filters from the original request. Omit on the first call.Response
Events come back in ascending timestamp order, with ties broken byidempotencyKey.
array
required
Billing events in this page. Each item describes one inference request through the gateway:
type(string): Event type discriminator. Always"API_BILLING_USAGE".idempotencyKey(string): Stable identifier for the event. Deduplicate on this key: overlapping windows can return the same event more than once.timestamp(string): ISO 8601 UTC timestamp of the inference request.requestId(string): Per-request identifier, useful for correlating billing events with platform logs.modelSlug(string): Model slug invoked, inyour-org/your-modelform.externalEntityId(string): Themetadata.external_entity_idof the group that owns the key used for the request, the same value you write when you create the group.apiKeyPrefix(string): Prefix of the federated API key that made the request (the substring before the.in the full key string). See Manage groups and API keys.tokens(object): Token counts for the request:inputTokens(cached and uncached prompt tokens),outputTokens(generated tokens), andcachedInputTokens(prompt tokens served from cache).
requestMetadata passthrough. If you need it, use billing webhooks instead.object
required
Pagination metadata for the page.
has_more(boolean): Whether more events exist in the window after this page.cursor(stringornull): Cursor for the next page.nullon the last page.
Errors
Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Query Parameters
Inclusive start (ISO 8601, UTC). Required without a cursor.
Exclusive end (ISO 8601, UTC). Defaults to now.
Max events. Default 100, max 1000.
Required range:
1 <= x <= 1000Return only events for these API key prefixes, repeated once per prefix.
Return only events for these external entity IDs, repeated once per ID.
Next-page cursor. Other parameters are ignored.