pub struct SessionUsageGetMetricsResult {
pub code_changes: UsageMetricsCodeChanges,
pub current_model: Option<String>,
pub last_call_input_tokens: i64,
pub last_call_output_tokens: i64,
pub model_metrics: HashMap<String, UsageMetricsModelMetric>,
pub session_start_time: String,
pub token_details: Option<HashMap<String, UsageMetricsTokenDetail>>,
pub total_api_duration_ms: i64,
pub total_nano_aiu: Option<f64>,
pub total_premium_request_cost: f64,
pub total_user_requests: i64,
}Expand description
Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
Fields§
§code_changes: UsageMetricsCodeChangesAggregated code change metrics
current_model: Option<String>Currently active model identifier
last_call_input_tokens: i64Input tokens from the most recent main-agent API call
last_call_output_tokens: i64Output tokens from the most recent main-agent API call
model_metrics: HashMap<String, UsageMetricsModelMetric>Per-model token and request metrics, keyed by model identifier
session_start_time: StringISO 8601 timestamp when the session started
token_details: Option<HashMap<String, UsageMetricsTokenDetail>>Session-wide per-token-type accumulated token counts
total_api_duration_ms: i64Total time spent in model API calls (milliseconds)
total_nano_aiu: Option<f64>Session-wide accumulated nano-AI units cost
Total user-initiated premium request cost across all models (may be fractional due to multipliers)
total_user_requests: i64Raw count of user-initiated API requests
Trait Implementations§
Source§impl Clone for SessionUsageGetMetricsResult
impl Clone for SessionUsageGetMetricsResult
Source§fn clone(&self) -> SessionUsageGetMetricsResult
fn clone(&self) -> SessionUsageGetMetricsResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more