curl --location --request GET 'https://dashboard.laburen.com/api/consumption-events/summary?startDate=2025-01-01T00:00:00.000Z&endDate=2025-01-31T23:59:59.000Z&groupBy=agent' \
--header 'Authorization: Bearer <API_KEY>'
const apiUrl = 'https://dashboard.laburen.com/api';
const apiKey = '<API_KEY>';
const params = new URLSearchParams({
startDate: '2025-01-01T00:00:00.000Z',
endDate: '2025-01-31T23:59:59.000Z',
groupBy: 'agent',
});
const response = await fetch(`${apiUrl}/consumption-events/summary?${params}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
},
});
const data = await response.json();
console.log(data);
import requests
api_url = "https://dashboard.laburen.com/api"
api_key = "<API_KEY>"
response = requests.get(
f"{api_url}/consumption-events/summary",
headers={
"Authorization": f"Bearer {api_key}",
},
params={
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"groupBy": "agent",
},
)
data = response.json()
print(data)
{
"groupBy": "agent",
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"data": [
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Support Bot",
"totalCreditsCharged": 12.450000,
"totalInputTokens": 284500,
"totalOutputTokens": 95200,
"eventCount": 1523
},
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Sales Assistant",
"totalCreditsCharged": 8.230000,
"totalInputTokens": 195000,
"totalOutputTokens": 67800,
"eventCount": 987
}
]
}
Consumption Events
Consumption Events - Summary
Get aggregated consumption metrics grouped by entity or time period
GET
/
api
/
consumption-events
/
summary
curl --location --request GET 'https://dashboard.laburen.com/api/consumption-events/summary?startDate=2025-01-01T00:00:00.000Z&endDate=2025-01-31T23:59:59.000Z&groupBy=agent' \
--header 'Authorization: Bearer <API_KEY>'
const apiUrl = 'https://dashboard.laburen.com/api';
const apiKey = '<API_KEY>';
const params = new URLSearchParams({
startDate: '2025-01-01T00:00:00.000Z',
endDate: '2025-01-31T23:59:59.000Z',
groupBy: 'agent',
});
const response = await fetch(`${apiUrl}/consumption-events/summary?${params}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
},
});
const data = await response.json();
console.log(data);
import requests
api_url = "https://dashboard.laburen.com/api"
api_key = "<API_KEY>"
response = requests.get(
f"{api_url}/consumption-events/summary",
headers={
"Authorization": f"Bearer {api_key}",
},
params={
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"groupBy": "agent",
},
)
data = response.json()
print(data)
{
"groupBy": "agent",
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"data": [
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Support Bot",
"totalCreditsCharged": 12.450000,
"totalInputTokens": 284500,
"totalOutputTokens": 95200,
"eventCount": 1523
},
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Sales Assistant",
"totalCreditsCharged": 8.230000,
"totalInputTokens": 195000,
"totalOutputTokens": 67800,
"eventCount": 987
}
]
}
Este endpoint requiere autenticacion. Inclui tu API key en el header
Authorization: Bearer <API_KEY>. Ver Autenticacion para mas detalles.- Get total credits, tokens, and event counts grouped by agent, feature, provider, or model
- Analyze consumption trends over time by grouping by day, week, or month
- Filter aggregations by agent, feature, or provider
Query Parameters
Required
string (ISO 8601)
required
Start of the date range. Must be a valid ISO 8601 datetime string (e.g.
2025-01-01T00:00:00.000Z). Must be before endDate.string (ISO 8601)
required
End of the date range. Must be a valid ISO 8601 datetime string.
string
required
How to group the results. Valid values:
agent, feature, provider, model, day, week, month.- Entity grouping (
agent,feature,provider,model): groups by the corresponding field, sorted by total credits descending. - Temporal grouping (
day,week,month): groups by time period using PostgreSQLdate_trunc, sorted chronologically.
Optional
string
Filter events by a specific agent ID before aggregating.
string
Filter events by feature name before aggregating.
string
Filter events by AI provider before aggregating.
Response
string
The grouping criterion used (mirrors the request parameter).
string (ISO 8601)
Start of the queried date range.
string (ISO 8601)
End of the queried date range.
array
Aggregated results per group.
Hide Summary item object
Hide Summary item object
string
The value identifying this group. For entity grouping this is the entity ID or name (e.g. agent ID, feature name). For temporal grouping this is an ISO 8601 timestamp of the period start.
string
Name of the agent. Only present when
groupBy=agent.number
Sum of credits charged in this group.
integer
Sum of input tokens consumed in this group.
integer
Sum of output tokens generated in this group.
integer
Total number of consumption events in this group.
Error Responses
| Status Code | Type | Description |
|---|---|---|
| 400 | INVALID_REQUEST | startDate is after endDate, or invalid groupBy value |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
curl --location --request GET 'https://dashboard.laburen.com/api/consumption-events/summary?startDate=2025-01-01T00:00:00.000Z&endDate=2025-01-31T23:59:59.000Z&groupBy=agent' \
--header 'Authorization: Bearer <API_KEY>'
const apiUrl = 'https://dashboard.laburen.com/api';
const apiKey = '<API_KEY>';
const params = new URLSearchParams({
startDate: '2025-01-01T00:00:00.000Z',
endDate: '2025-01-31T23:59:59.000Z',
groupBy: 'agent',
});
const response = await fetch(`${apiUrl}/consumption-events/summary?${params}`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
},
});
const data = await response.json();
console.log(data);
import requests
api_url = "https://dashboard.laburen.com/api"
api_key = "<API_KEY>"
response = requests.get(
f"{api_url}/consumption-events/summary",
headers={
"Authorization": f"Bearer {api_key}",
},
params={
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"groupBy": "agent",
},
)
data = response.json()
print(data)
{
"groupBy": "agent",
"startDate": "2025-01-01T00:00:00.000Z",
"endDate": "2025-01-31T23:59:59.000Z",
"data": [
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Support Bot",
"totalCreditsCharged": 12.450000,
"totalInputTokens": 284500,
"totalOutputTokens": 95200,
"eventCount": 1523
},
{
"groupKey": "clxxxxxxxxxxxxxxxxx",
"agentName": "Sales Assistant",
"totalCreditsCharged": 8.230000,
"totalInputTokens": 195000,
"totalOutputTokens": 67800,
"eventCount": 987
}
]
}
Was this page helpful?

