The Analytics API module via PyGEAI allows you to interact with Globant Enterprise AI to get informantion on how it is being used across Projects, Agents, Users, and time periods.
It allows you to analyze usage, costs, performance, and adoption metrics through both the CLI and the Python SDK, enabling informed decisions around optimization, monitoring, and reporting.
Through the geai analytics CLI commands and the AnalyticsManager class in PyGEAI, you can retrieve aggregated metrics, detect trends, export reports, and share insights with technical and business stakeholders.
The Analytics module is designed to support operational monitoring, cost control, and strategic analysis, with flexible date filtering and multiple levels of granularity.
The Analytics module exposes metrics across several dimensions:
- Lab metrics: Track the creation and modification of Agents, Flows, and Processes.
- Request metrics: Monitor total requests, error rates, and response times.
- Cost metrics: Analyze total spend and average cost per request.
- Token metrics: Track input, output, and total token consumption.
- User and Agent activity: Measure active users, active agents, and active projects.
- Top performers: Identify top Agents and Users by requests, tokens, and cost.
All analytics queries support custom date ranges and automatically default to the previous month when no dates are provided.
Before using Analytics, ensure the following:
- CLI installed: The geai CLI must be available.
- Authentication configured: An API token must be generated from the GEAI platform.
- Permissions: Your user must have access to Analytics data.
Set your API token as an environment variable:
export GEAI_APITOKEN="your-api-token-here"
All analytics commands accept optional start_date and end_date parameters.
If no dates are provided, the system automatically uses the previous calendar month.
For example, if today is January 15, 2024:
- Start date defaults to 2023-12-01
- End date defaults to 2023-12-31
This behavior ensures consistent monthly reporting without requiring manual date input.
Most analytics commands support the following parameters:
- --start-date (-s): Start date in YYYY-MM-DD format.
- --end-date (-e): End date in YYYY-MM-DD format.
- --agent-name (-a): Filter results by a specific Agent (when applicable).
Use the help command to explore all available analytics operations:
geai analytics help
Lab metrics provide insight into how your AI assets evolve over time.
This metric returns the total number of Agents created and modified within the selected period.
Use this to understand development velocity and iteration frequency.
Request metrics help you understand traffic volume, reliability, and performance.
Returns the number of requests executed per day, including error counts.
You can optionally filter results by Agent.
This is useful for identifying usage patterns, traffic spikes, or regressions.
Calculates the overall error rate as a percentage across all requests in the selected period.
Use this metric to monitor system stability and detect failures early.
Cost metrics provide financial visibility into model usage.
Returns the total cost incurred during the selected period.
This metric is commonly used for monthly reporting and budgeting.
Calculates the average cost of each request, helping you assess efficiency and optimize configurations.
Token metrics allow you to track model consumption in detail.
Returns aggregated token usage, including:
- Input tokens
- Output tokens
- Total tokens
This data helps correlate cost, usage patterns, and model behavior.
These metrics provide insight into platform adoption.
Returns the total number of users who executed requests during the selected period.
Use this to measure engagement and adoption across teams.
Top performer metrics help identify high-impact Agents and Users.
Returns the top 10 Agents ranked by number of executed requests.
This is useful for identifying critical Agents and prioritizing optimization efforts.
The Full Report aggregates all available metrics into a single execution.
It can be generated using default dates or a custom date range and optionally exported to CSV.
The report includes:
- The Lab metrics
- Agents created and modified
- Flows created and modified
- Processes created and modified
- Request metrics
- Total requests
- Requests with errors
- Error rate
- Average request time
- Cost metrics
- Total cost
- Average cost per request
- Token metrics
- Input, output, and total tokens
- Average tokens per request
- User and Agent metrics
- Active users
- Active agents
- Active projects
- Top performers
- Top 10 Agents by requests
- Top 10 Agents by tokens
- Top 10 Users by requests
- Top 10 Users by cost
The full report is ideal for executive summaries, monthly reviews, and operational dashboards.
Analytics reports can be exported in CSV format for further analysis in spreadsheets or BI tools.
The exported file includes:
- Report metadata (period, generation time)
- One metric per row
- Numeric values ready for aggregation or visualization
In addition to the CLI, Analytics can be accessed programmatically using the AnalyticsManager class.
The Python SDK enables you to:
- Automate reports
- Integrate analytics into internal tools
- Perform custom aggregations and comparisons
Typical use cases include scheduled reporting, dashboards, and data pipelines.
- get_agents_created_and_modified
- get_agents_created_and_modified_per_day
- get_flows_created_and_modified
- get_flows_created_and_modified_per_day
- get_processes_created_and_modified
- get_total_requests
- get_total_requests_per_day
- get_total_requests_with_error
- get_overall_error_rate
- get_average_request_time
- get_average_requests_per_day
- get_average_requests_per_user
- get_total_cost
- get_total_cost_per_day
- get_average_cost_per_request
- get_average_cost_per_user
- get_total_tokens
- get_number_of_tokens_per_agent
- get_number_of_tokens_per_day
- get_average_tokens_per_request
- get_total_active_users
- get_total_active_agents
- get_total_active_projects
- get_agent_usage_per_user
- get_top_10_agents_by_requests
- get_top_10_agents_by_tokens
- get_top_10_users_by_requests
- get_top_10_users_by_cost
- Run reports regularly to identify trends early.
- Export to CSV for deeper analysis or BI integration.
- Compare periods to measure growth and regressions.
- Monitor costs to avoid unexpected spending.
- Track error rates to maintain reliability.
- Use adoption metrics for capacity planning.
- Correlate tokens and cost to optimize model usage.
- Monthly reporting: Automatically generate full reports using default dates.
- Cost tracking: Compare spend across quarters or projects.
- Performance monitoring: Track error rates and latency over time.
- Agent analysis: Identify high-impact or underperforming Agents.
- Authentication errors: Verify the API token is configured correctly.
- Permission errors: Ensure your user has Analytics access.
- Empty results: Confirm the selected date range includes activity.
- Date format issues: Always use YYYY-MM-DD.
Since Version 2026-02