pub struct AssistantUsageData {Show 17 fields
pub api_call_id: Option<String>,
pub cache_read_tokens: Option<f64>,
pub cache_write_tokens: Option<f64>,
pub copilot_usage: Option<AssistantUsageCopilotUsage>,
pub cost: Option<f64>,
pub duration: Option<f64>,
pub initiator: Option<String>,
pub input_tokens: Option<f64>,
pub inter_token_latency_ms: Option<f64>,
pub model: String,
pub output_tokens: Option<f64>,
pub parent_tool_call_id: Option<String>,
pub provider_call_id: Option<String>,
pub quota_snapshots: HashMap<String, AssistantUsageQuotaSnapshot>,
pub reasoning_effort: Option<String>,
pub reasoning_tokens: Option<f64>,
pub ttft_ms: Option<f64>,
}Expand description
LLM API call usage metrics including tokens, costs, quotas, and billing information
Fields§
§api_call_id: Option<String>Completion ID from the model provider (e.g., chatcmpl-abc123)
cache_read_tokens: Option<f64>Number of tokens read from prompt cache
cache_write_tokens: Option<f64>Number of tokens written to prompt cache
copilot_usage: Option<AssistantUsageCopilotUsage>Per-request cost and usage data from the CAPI copilot_usage response field
cost: Option<f64>Model multiplier cost for billing purposes
duration: Option<f64>Duration of the API call in milliseconds
initiator: Option<String>What initiated this API call (e.g., “sub-agent”, “mcp-sampling”); absent for user-initiated calls
input_tokens: Option<f64>Number of input tokens consumed
inter_token_latency_ms: Option<f64>Average inter-token latency in milliseconds. Only available for streaming requests
model: StringModel identifier used for this API call
output_tokens: Option<f64>Number of output tokens produced
parent_tool_call_id: Option<String>Parent tool call ID when this usage originates from a sub-agent
provider_call_id: Option<String>GitHub request tracing ID (x-github-request-id header) for server-side log correlation
quota_snapshots: HashMap<String, AssistantUsageQuotaSnapshot>Per-quota resource usage snapshots, keyed by quota identifier
reasoning_effort: Option<String>Reasoning effort level used for model calls, if applicable (e.g. “low”, “medium”, “high”, “xhigh”)
reasoning_tokens: Option<f64>Number of output tokens used for reasoning (e.g., chain-of-thought)
ttft_ms: Option<f64>Time to first token in milliseconds. Only available for streaming requests
Trait Implementations§
Source§impl Clone for AssistantUsageData
impl Clone for AssistantUsageData
Source§fn clone(&self) -> AssistantUsageData
fn clone(&self) -> AssistantUsageData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more