The Explorer, the Events debugger, and the usage events API filter events using the same fields.
An event must match every filter you add.
The Operators column lists the operators of the list endpoint’s query string, in the form filter[field][operator]=value.
For the JSON filters of the query endpoint, exports, and export schedules, see Filters in a JSON body.
|
Filter
|
Field
|
What it matches
|
Operators
|
|
Provider
|
provider
|
The AI provider that served the request.
|
eq, neq, oeq, contains, ocontains
|
|
Model
|
model
|
The model that the provider reports as served.
|
eq, neq, oeq, contains, ocontains
|
|
User
|
subject
|
The subject accountable for the usage, for example principal/{uuid}, consumer/{uuid}, or oidc/{sub}. An unattributed event has no subject.
|
eq, neq, oeq, contains, ocontains, exists, nexists
|
|
Request mode
|
request_mode
|
How the request was served: stream, oneshot, or realtime.
|
eq, neq, oeq, contains, ocontains
|
|
Harness
|
client
|
The client that sent the request, as the producer reported it.
|
eq, neq, oeq, contains, ocontains
|
|
Source
|
source
|
The producer of the usage event: a gateway’s control plane, as //control-planes/{uuid}, or a principal that reported usage, as //principals/{uuid}.
|
eq, neq, oeq, contains, ocontains
|
|
Service
|
service_id
|
The ID of the gateway service that handled the request.
|
eq, neq, oeq
|
|
Route
|
route_id
|
The ID of the gateway route that handled the request.
|
eq, neq, oeq
|
|
Consumer
|
consumer_id
|
The ID of the consumer that sent the request.
|
eq, neq, oeq
|
|
Application
|
application_id
|
The ID of the application that sent the request.
|
eq, neq, oeq
|
|
Consumer groups
|
consumer_group_ids
|
The IDs of the consumer groups that the consumer belongs to.
|
eq, oeq
|
|
Groups
|
groups
|
The groups that the usage belongs to, as group references: principal/{uuid}, consumer_group/{uuid}, or oidc/{group}.
|
eq, oeq
|
|
Teams
|
teams
|
The teams the usage belongs to.
|
eq, oeq
|
|
Tag
|
tags.<key>
|
The value of one tag on the event. The tag key is part of the field name, as tags.<key>.
|
eq, neq, oeq, contains, ocontains, exists, nexists
|
The Events debugger also filters on the following fields.
In the AI Cost Management API, time, reported_cost, and tokens are available as filters on the list endpoint only.
arrival also works in the JSON filters of the query endpoint, exports, and export schedules.
|
Filter
|
Field
|
What it matches
|
Operators
|
|
Time range
|
time
|
The time of the event. The list endpoint takes a range as filter[time][gte] and filter[time][lt]. The query endpoint and exports take it as starts_at and ends_at instead.
|
eq, gt, gte, lt, lte
|
|
Price
|
reported_cost
|
The cost of the event, compared with an amount in US dollars.
|
eq, gt, gte, lt, lte
|
|
Arrival
|
arrival
|
Whether the event arrived late or on_time. An event is late when it reaches AI Cost Management more than one hour after its time.
|
eq, neq, oeq
|
|
Token usage
|
tokens
|
Whether the event reported a positive quantity of any token kind.
|
exists, nexists
|
The query endpoint, exports, and export schedules take a JSON filters object that maps each field to one operator.
These filters don’t accept oeq, ocontains, or nexists.
They use the following operators instead, where exists takes true or false:
|
Filters
|
Operators
|
provider
model
subject
request_mode
client
source
arrival
tags.<key>
|
eq
neq
in
nin
contains
ncontains
exists
|
service_id
route_id
consumer_id
application_id
|
|
groups
teams
consumer_group_ids
|
has
has_any
nhas
nhas_any
exists
|
|
|
Combine several operators on one field.
|
For example, the following filters select the usage served by Anthropic for members of the oidc/team-koko group:
{
"filters": {
"provider": { "eq": "anthropic" },
"groups": { "has_any": ["oidc/team-koko"] }
}
}