Skip to content

Latest commit

 

History

History
91 lines (59 loc) · 3.45 KB

AiRuntimeControlUsageMetricsApi.md

File metadata and controls

91 lines (59 loc) · 3.45 KB

AiRuntimeControlUsageMetricsApi

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
arc_export_usage_metrics GET /ai-runtime-control/v1/usage-metrics/export Export usage metrics
arc_get_usage_metrics GET /ai-runtime-control/v1/usage-metrics Get usage metrics

arc_export_usage_metrics

Returns usage metrics for AI Runtime Control requests. Accepts the same filter parameters as get usage metrics, except sort and granularity, which aren't supported here. Set the Accept header to text/csv to receive a CSV file download instead of a JSON response. In the CSV output, the column named time corresponds to the date field in the JSON response.

let cfg = &Configuration::default();
let params = ArcExportUsageMetricsParams {
    // parameters
};
arc_export_usage_metrics(cfg, params)

Parameters

Name Type Description Required Notes
key Option<String> Filter results to a specific virtual key ID.
provider Option<String> Filter results by AI provider connection ID.
model Option<String> Filter results by AI model identifier.
from Option<String> The start of the time range, in RFC 3339 format.
to Option<String> The end of the time range, in RFC 3339 format. Defaults to now.

Return type

crate::models::ArcUsageMetricsResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/csv, application/problem+json

[Back to top] [Back to API list] [Back to README]

arc_get_usage_metrics

Returns usage metrics for AI Runtime Control requests, including request counts, session counts, input token counts, and output token counts.

let cfg = &Configuration::default();
let params = ArcGetUsageMetricsParams {
    // parameters
};
arc_get_usage_metrics(cfg, params)

Parameters

Name Type Description Required Notes
key Option<String> Filter results to a specific virtual key ID.
provider Option<String> Filter results by AI provider connection ID.
model Option<String> Filter results by AI model identifier.
from Option<String> The start of the time range, in RFC 3339 format.
to Option<String> The end of the time range, in RFC 3339 format. Defaults to now.
granularity Option<String> The time granularity to aggregate usage by. [default to daily]
sort Option<String> Sort field. Prefix with - for descending order (e.g., sort=-date). [default to date]

Return type

crate::models::ArcUsageMetricsResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to README]