This article provides access to Analytics API endpoints with the data and metrics available in the User tab in Dashboard.
Check the generic variables needed to use the API.
| Method |
Path |
Description |
| GET |
/analytics/requests/total-active-users |
Returns the total number of users who have made a request and, thus, been active within the selected period. |
| GET |
/analytics/requests/average-cost-per-user |
Returns the average cost attributed to each user. |
| GET |
/analytics/requests/average-requests-per-user |
Returns the average number of requests made per user. |
| GET |
/analytics/requests/top-10-users-by-cost |
Lists the top 10 users ranked by total cost incurred. |
| GET |
/analytics/requests/top-10-users-by-requests |
Lists the top 10 users who made the most requests, ranked by number. |
| GET |
/analytics/requests/average-cost-per-user-per-date |
Provides the average cost per user for each date. |
| GET |
/analytics/requests/average-requests-per-user-per-date |
Returns the average number of requests per user for each day. |
| GET |
analytics/requests/activity-per-user |
Returns the cost, number of requests and number of tokens grouped by user, agent, and model. |
All endpoints require authentication using one of the following:
- Authorization: Bearer $GEAI_APITOKEN
- Authorization: Bearer $OAuth_accesstoken
For $OAuth_accesstoken, you must also include the header: ProjectId: $GEAI_PROJECTID (otherwise, this and OrganizationId:$GEAI_ORGANIZATIONID headers are optional)
Some endpoints may require additional headers such as:
- Content-Type: application/json
Returns the total number of users who have been active within the selected period, supporting user engagement analysis.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
| agentName |
string |
Agent name (optional) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/total-active-users
- Body: Empty
json
{
"totalActiveUsers": integer // Number of total active users.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-active-users?startDate=2024-01-01&endDate=2024-01-31&agentName=" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Returns the average cost attributed to each user, supporting identification of high-cost users and optimization of user-level resource allocation.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/average-cost-per-user
- Body: Empty
{
"averageCost": number // average cost per user (USD).
}
curl -X GET "$BASE_URL/v1/analytics/requests/average-cost-per-user?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $ORGANIZATION_ID" \
-H "ProjectId: $PROJECT_ID"
Returns the average number of requests made per user, supporting user engagement and adoption analysis.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/average-requests-per-user
- Body: Empty
{
"averageRequests": number // average number of requests per user.
}
Lists the top 10 users ranked by total cost incurred, enabling identification of the most resource-intensive users.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/top-10-users-by-cost
- Body: Empty
{
"top10Users": [
{
"totalCost": number, // Expressed in USD.
"user": "string" // User’s email.
},
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/top-10-users-by-cost?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Lists the top 10 users ranked by the number of requests made, supporting identification of the most engaged users.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
| agentName |
string |
Agent name (optional) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/top-10-users-by-requests
- Body: Empty
{
"top10Users": [
{
"totalRequests": integer, // Number of requests for this specific Top 10 users.
"user": "string" // Typically email address.
},
{
"totalRequests": integer,
"user": "string"
},
{
"totalRequests": integer,
"user": "string"
},
{
"totalRequests": integer,
"user": "string"
},
{
"totalRequests": integer,
"user": "string"
},
{
"totalRequests": integer,
"user": "string"
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/top-10-users-by-requests?startDate=2024-01-01&endDate=2024-01-31&agentName=" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Provides the average cost per user for each date, supporting temporal analysis of user spending patterns.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/average-cost-per-user-per-date
- Body: Empty
{
"averageCostPerUser": [
{
"averageCost": number, // Expressed in USD.
"date": "string" // Date requested in format YYYY-MM-DD.
},
{
"averageCost": number,
"date": "string"
},
{
"averageCost": number,
"date": "string"
},
{
"averageCost": number,
"date": "string"
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/average-cost-per-user-per-date?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Returns the average number of requests per user for each day, supporting analysis of user activity trends over time.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/average-requests-per-user-per-date
- Body: Empty
{
"averageRequestsPerUser": [
{
"averageRequests": number, // Number of average requests.
"date": "string" // Date expressed in YYYY-MM-DD format.
},
{
"averageRequests": integer,
"date": "string"
},
{
"averageRequests": integer,
"date": "string"
},
{
"averageRequests": integer,
"date": "string"
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/average-requests-per-user-per-date?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Returns the cost, number of requests, and API Tokens grouped by user, Agent, and model, enabling detailed user activity and resource usage analysis.
| Name |
Type |
Description |
| startDate |
string |
Start date for the query (YYYY-MM-DD) |
| endDate |
string |
End date for the query (YYYY-MM-DD) |
- Method: GET
- Path: $BASE_URL/v1/analytics/requests/activity-per-user
- Body: Empty
{
"activity": [
{
"agentName": "string", // Name (if not available, returns N/D).
"modelName": "string", // If not available, returns N/D.
"totalCost": number, // Expressed in USD.
"totalRequests": integer, // Total number of requests for this user.
"totalTokens": integer, // Tokens consumed by the user.
"user": "string" // Typically user email.
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
{
"agentName": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/activity-per-user?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "OrganizationId: $GEAI_ORGANIZATIONID" \
-H "ProjectId: $GEAI_PROJECTID"
Since version 2025-09.