API ReferenceProjects
Project usage breakdownv3.1
Grouped metering usage breakdown for the authenticated project. Groups results by a single dimension or column key.
Authorization
ApiKeyAuth x-api-key<token>
Project API key authentication
In: header
Path Parameters
entity_typestringRequired
Metering entity type to break down (e.g. tool_calls, sessions).
Request Body
application/json
fromnumber
Inclusive range start (Unix epoch milliseconds). Defaults to 30 days before to.
tonumber
Exclusive range end (Unix epoch milliseconds). Defaults to now.
group_bystring
Dimension or column to group results by. Defaults to tool_slug for tool_calls and user_id for sessions.
order_byenum
Field to order groups by. Defaults to total_quantity.
Possible values:
keytotal_quantityevent_countorder_directionenum
Sort direction. Defaults to desc.
Possible values:
ascdesclimitinteger
Maximum number of groups to return. Defaults to 100, max 1000.
filtersobject
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v3.1/project/usage/string" \ -H "Content-Type: application/json" \ -d '{}'{ "entity_type": "string", "unit": "string", "total_quantity": "string", "event_count": 0, "groups": [ { "key": "string", "total_quantity": "string", "event_count": 0 } ]}