Table of contents
Official Content
  • This documentation is valid for:

This article provides access to the data and metrics available in the API Dashboard.

Check the generic variables needed to use the API.

Endpoints

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.

Authentication

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

GET /analytics/requests/total-cost

Returns the total accumulated cost of all requests made within the selected period, expressed in USD, supporting analysis of overall platform usage expenses.

Parameters

Name Type Description
startDate string Start date for the query (YYYY-MM-DD)
endDate string End date for the query (YYYY-MM-DD)

Request

  • Method: GET
  • Path: $BASE_URL/v1/analytics/requests/total-cost
  • Body: Empty

Response

{
  "totalCost": number                                                    // the total cost for the requested period. Expressed in USD.
}

cURL Sample

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"

GET /analytics/requests/total-requests

Returns the total number of requests made, offering a high-level overview of activity and adoption.

Parameters

Name Type Description
startDate string Start date for the query (YYYY-MM-DD)
endDate string End date for the query (YYYY-MM-DD)

Request

  • Method: GET
  • Path: $BASE_URL/v1/analytics/requests/total-requests
  • Body: Empty

Response

{
  "totalRequests": integer                                      // Total number of requests in the period.
}

cURL Sample

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"

GET /analytics/requests/total-tokens

Returns the total number of tokens processed across all requests, supporting overall usage and billing calculations.

Parameters

Name Type Description
startDate string Start date for the query (YYYY-MM-DD)
endDate string End date for the query (YYYY-MM-DD)

Request

  • Method: GET
  • Path: $BASE_URL/v1/analytics/requests/total-tokens
  • Body: Empty

Response

{
  "total": integer                                          // Total tokens in the period selected.
}

cURL Sample

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"

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.

Parameters

Name Type Description
startDate string Start date for the query (YYYY-MM-DD)
endDate string End date for the query (YYYY-MM-DD)

Request

  • Method: GET
  • Path: $BASE_URL/v1/analytics/requests/activity-per-api-token
  • Body: Empty

Response

{
"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 Sample

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"
Last update: December 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant