This API provides access to the data and metrics available in the Usage Dashboard,
Check the generic variables needed to use the API.
| Method |
Path |
Description |
| GET |
/analytics/requests/total-cost |
Returns the total accumulated cost of all requests made. |
| GET |
/analytics/requests/total-tokens |
Returns the total number of tokens processed across all requests. |
| GET |
/analytics/requests/total-request-time |
Returns the total processing time for all requests (expressed in hours). |
| GET |
/analytics/requests/average-cost-per-request |
Returns the average cost per request, displayed in USD. |
| GET |
/analytics/requests/average-request-time |
Provides the average time taken to process a request. |
| GET |
/analytics/requests/total-requests-with-error |
Returns the total number of requests that resulted in errors. |
| GET |
/analytics/requests/overall-error-rate |
Calculates the percentage of requests that resulted in errors. |
| GET |
/analytics/requests/-per-day |
Provides a breakdown of total costs incurred per day. |
| GET |
/analytics/requests/total-requests-per-day |
Returns the number of requests made per day. |
| GET |
/analytics/requests/agent-usage-per-project |
Provides cost, request count, and token usage grouped by user, API Token, Project, Agent, and model. |
| GET |
/analytics/requests/agent-usage-per-organization-and-project |
Returns cost, request count, and token usage grouped by organization, user, project API Token, 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: $PROJECT_ID (otherwise, this and OrganizationId:$ORGANIZATION_ID headers are optional)
Some endpoints may require additional headers such as:
- Content-Type: application/json
Returns the total accumulated cost of all requests made within the selected period, expressed in USD, supporting analysis of overall platform usage expenses.
| 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/total-cost
- Body: Empty
{
"totalCost": number // the total cost for the requested period. Expressed in USD.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-cost?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the total number of tokens processed across all requests, supporting overall usage and billing calculations.
| 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/total-tokens
- Body: Empty
{
"total": integer // Total tokens in the period selected.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-tokens?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the total number of requests made, offering a high-level overview of activity and adoption.
| 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/total-requests
- Body: Empty
{
"totalRequests": integer // Total number of requests in the period.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-requests?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the total processing time (expressed in hours) for all requests, providing insight into aggregate system workload and performance.
| 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/total-request-time
- Body: Empty
{
"time": number // Total processing time in hours.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-request-time?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the average cost incurred per request during the selected period. Expressed in USD.
| 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-request
- Body: Empty
{
"averageCostPerRequest": number // Expressed in USD
}
curl -X GET "$BASE_URL/v1/analytics/requests/average-cost-per-request?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Provides the average processing time for each request, enabling performance monitoring and optimization 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-request-time
- Body: Empty
{
"averageRequestTime": number // average request time in milliseconds.
}
curl -X GET "$BASE_URL/v1/analytics/requests/average-request-time?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the total number of requests that resulted in errors, supporting error tracking and reliability assessment.
| 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/total-requests-with-error
- Body: Empty
{
"totalRequestsWithError": integer // number of requests with error in the period.
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-requests-with-error?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Calculates the percentage of requests that failed, supporting analysis of overall error rate and system stability.
| 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/overall-error-rate
- Body: Empty
{
"overallErrorRate": number // error rate as expressed from 0 to 1
curl -X GET "$BASE_URL/v1/analytics/requests/overall-error-rate?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Provides a breakdown of total costs incurred per day, allowing for daily cost monitoring and trend 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/total-cost-per-day
- Body: Empty
{
"totalCostPerDay": [
{
"date": "string", // Date in YYYY-MM-DD.
"totalCost": number // Total cost for the day (USD).
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-cost-per-day?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the number of requests made per day.
| 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-requests-per-day
- Body: Empty
{
"totalRequestsPerDay": [
{
"date": "string", // Format YYYY-MM-DD (one response for each day of the requested period).
"totalRequests": integer, // Total requests during the date specified above
"totalRequestsWithError": integer // Total requests with error during the date specified above.
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/total-requests-per-day?startDate=2024-01-01&endDate=2024-01-31&agentName=" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the cost, number of requests, and token usage grouped by project, Agent, API Token, user, and model, supporting project-level resource tracking.
| 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/agent-usage-per-project
- Body: Empty
{
"agentUsage": [
{
"agent": "string", // Agent name, If not found, returns N/D.
"apiToken": "string",// API Token name.
"inputTokens": integer,// Total number of Input Tokens.
"model": "string", // Model name.
"outputTokens": integer, // Total number of Output Tokens.
"project": "string",// Expressed in USD.
"totalCost": number,// Expressed in USD.
"totalRequests": integer,// Total requests for this Agent.
"totalTokens": integer,// Total tokens consumed by this Agent.
"user": "string"// Typically identified by email address.
},
{
"agent": "string",
"apiToken": "string",
"inputTokens": integer,
"model": "string",
"outputTokens": integer,
"project": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/agent-usage-per-project?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Returns the cost, number of requests, and token usage grouped by organization, project, Agent, user, API Token, and model, enabling multi-level 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/agent-usage-per-organization-and-project
- Body: Empty
{
"agentUsage": [
{
"agent": "string", // Agent name, if not found, will return N/D.
"apiToken": "string", // API Token name.
"inputTokens": integer, // Total number of in Input Tokens.
"model": "string", // Model used by Agent.
"organization": "string", // Organization name.
"outputTokens": integer, // Total number of Output Tokens.
"project": "string", // Project name.
"totalCost": number, // Expressed in USD.
"totalRequests": integer, // Total number of requests.
"totalTokens": integer, // Total number of Tokens.
"user": "string" // User name.
},
{
"agent": "string",
"apiToken": "string",
"inputTokens": integer,
"model": "string",
"organization": "string",
"outputTokens": integer,
"project": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer,
"user": "string"
},
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/agent-usage-per-organization-and-project?startDate=2024-01-01&endDate=2024-01-31" \
-H "Authorization: Bearer $GEAI_APITOKEN" \
-H "Content-Type: application/json" \
-H "organization-id: $GEAI_ORGANIZATIONID" \
-H "project-id: $GEAI_PROJECTID"
Since version 2025-09.