pub struct UsageRecord {
pub session_id: String,
pub parent_session: Option<String>,
pub project: Option<String>,
pub request_id: Option<String>,
pub model: Option<String>,
pub ts: Option<Timestamp>,
pub usage: Usage,
pub sidechain: bool,
pub thinking_chars: u64,
pub thinking_encrypted: bool,
pub has_thinking: bool,
}Expand description
One deduplicated API request with its finalized usage.
Fields§
§session_id: String§parent_session: Option<String>Parent session id when this spend came from a sub-agent transcript.
project: Option<String>§request_id: Option<String>§model: Option<String>§ts: Option<Timestamp>§usage: Usage§sidechain: boolRequest belongs to a sub-agent (sidechain) transcript.
thinking_chars: u64Visible extended-thinking chars measured across this request’s lines — the
basis for thinking ATTRIBUTION. These tokens are ALREADY counted inside
usage.output (Claude Code, verified), so this answers “how much of output
was thinking”, never an addition to the billable total. 0 when there was no
thinking, or when every thinking block was encrypted (thinking_encrypted).
thinking_encrypted: boolThinking blocks were present but none were measurable (encrypted/redacted:
"thinking":"" + signature). The thinking share of output is unknown here —
surfaced as such, never guessed (CLAUDE.md §8.5). On the sampled machine
~85% of thinking requests were encrypted, so this is the common case.
has_thinking: boolThinking blocks were present at all (measurable or encrypted).
Trait Implementations§
Source§impl Clone for UsageRecord
impl Clone for UsageRecord
Source§fn clone(&self) -> UsageRecord
fn clone(&self) -> UsageRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more