h2oGPTe icon

h2oGPTe

h2oGPTe is an AI-powered search assistant for your internal teams to answer questions gleaned from large volumes of documents, websites and workplace content.

Actions198

Overview

This node operation "Returns Usage Statistics Grouped by Models and Users" under the "Model" resource fetches usage statistics data aggregated by both AI models and users over a specified time interval. It is useful for monitoring and analyzing how different AI models are being utilized by various users within a given timeframe.

Typical use cases include:

  • Tracking model usage patterns to optimize resource allocation.
  • Auditing user activity related to AI model consumption.
  • Generating reports on AI model performance and user engagement.

For example, an organization can use this node to retrieve hourly usage stats of their deployed language models segmented by each user, helping them understand which users or teams are most active and which models are most popular.

Properties

Name Meaning
Interval The length of the time interval for which usage statistics will be obtained. The interval ends at the current time. Example: "24 hours".

Output

The output JSON contains usage statistics grouped by both models and users for the specified interval. This typically includes metrics such as counts of requests, tokens processed, or other usage-related data per model-user pair.

The exact structure depends on the API response but generally includes:

  • Model identifiers/names.
  • User identifiers/names.
  • Usage metrics aggregated over the requested interval.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential for authentication with the external service.
  • The node sends an HTTP GET request to the endpoint /stats/usage_by_model_and_user with the interval query parameter.
  • The base URL and headers (including Content-Type) are configured via credentials and node settings.

Troubleshooting

  • Missing or invalid interval: The interval property is required. Ensure it is provided in a valid format (e.g., "24 hours").
  • Authentication errors: Verify that the API key credential is correctly configured and has sufficient permissions.
  • Network issues: Check connectivity to the API endpoint.
  • Unexpected response structure: Confirm that the API version matches the expected schema.

Links and References

  • Refer to the API documentation of the external AI platform for detailed information about the /stats/usage_by_model_and_user endpoint and its response format.
  • Consult n8n documentation on configuring API key credentials and HTTP request nodes for integration setup.

Discussion