Skip to main content

obol_core/transcript/provider/
mod.rs

1//! Provider-keyed usage normalizers. Each turns a provider's raw `usage`
2//! object into token buckets. The agent dialects and the `obol` house dialect
3//! share these so the per-provider accounting — the cache-bucket split, the
4//! OpenAI cached-subtraction, the part naive summers get wrong — lives in one
5//! place, not once per dialect.
6
7pub mod anthropic;
8pub mod openai;
9
10/// Token buckets extracted from a provider `usage` object. Model, provider,
11/// namespace and service_tier are the caller's to attach; `request_input_tokens`
12/// is derived from these by the caller.
13#[derive(Debug, Clone, Default, PartialEq, Eq)]
14pub struct ProviderTokens {
15    pub input_uncached: u64,
16    pub cache_read: u64,
17    pub cache_write_5m: u64,
18    pub cache_write_1h: u64,
19    pub output: u64,
20}