This article provides access to the data and metrics available in the API 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-requests |
Returns the total number of requests made. |
| GET |
/analytics/requests/total-tokens |
Returns the total number of tokens processed across all requests. |
| GET |
/analytics/requests/activity-per-api-token |
Returns the cost, number of requests, and token usage grouped by API Token and model, supporting API key-level monitoring and billing. |
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 "OrganizationId: $ORGANIZATION_ID" \
-H "ProjectId: $PROJECT_ID"
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 "OrganizationId: $ORGANIZATION_ID" \
-H "ProjectId: $PROJECT_ID"
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 "OrganizationId: $ORGANIZATION_ID" \
-H "ProjectId: $PROJECT_ID"
Returns the cost, number of requests, and token usage grouped by API Token and model, supporting API key-level monitoring and billing.
| 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-api-token
- Body: Empty
{
"activity": [
{
"apiToken": "string", // Given name for the API Token.
"modelName": "string", // Model for the API Token.
"totalCost": number, // Expressed in USD.
"totalRequests": integer, // Total number of requests
"totalTokens": integer // The number of tokens consumed by this API Token.
},
{
"apiToken": "string",
"modelName": "string",
"totalCost": number,
"totalRequests": integer,
"totalTokens": integer
}
]
}
curl -X GET "$BASE_URL/v1/analytics/requests/activity-per-api-token?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"