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 for All Models" under the "Model" resource fetches usage statistics data for all available models over a specified time interval. It is useful for monitoring and analyzing how different AI or machine learning models are being utilized within a system, helping teams understand model performance, usage patterns, and potentially optimize resource allocation.

Common scenarios:

  • Tracking API usage of various AI models to manage costs.
  • Auditing model utilization for compliance or reporting.
  • Identifying popular or underused models in an AI platform.

Practical example:
A data science team wants to see how many requests each model received in the last 24 hours to decide which models to scale up or down. They configure this node with an interval of "24 hours" to retrieve aggregated usage stats.

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 values: "24 hours", "7 days".

Output

The output JSON contains usage statistics for all models aggregated over the specified interval. This typically includes metrics such as request counts, usage duration, or other relevant usage data grouped by model identifiers.

The exact structure depends on the external API response but generally provides a list or map of models with their corresponding usage metrics.

No binary data output is indicated for this operation.

Dependencies

  • Requires connection to an external API endpoint that provides model usage statistics.
  • Needs an API key credential configured in n8n to authenticate requests.
  • The base URL for the API is dynamically constructed from credentials.
  • The node sends a GET request to the /stats/usage endpoint with the interval query parameter.

Troubleshooting

  • Missing or invalid interval: The interval property is required. Omitting it or providing an invalid format may cause errors or empty responses.
  • Authentication errors: Ensure the API key credential is correctly set up and has permissions to access usage statistics.
  • Network issues: Verify connectivity to the API endpoint.
  • Unexpected response format: If the API changes its response schema, the node's output might not parse correctly.

Links and References

  • Refer to the API documentation of the service providing model usage statistics for details on the /stats/usage endpoint and supported interval formats.
  • Consult n8n documentation on setting up API key credentials and HTTP request nodes for authentication guidance.

Discussion