pub struct ApiSpend {
pub daily: f64,
pub weekly: f64,
pub monthly: f64,
pub limit: Option<f64>,
pub limit_remaining: Option<f64>,
pub limit_reset: Option<String>,
pub expires_at: Option<String>,
}Expand description
Per-key spend for a pay-per-token account, in USD.
Not ExtraUsage, which is Anthropic overage: that type’s money
fields arrive in minor units and are divided by 100 on the way in,
and it carries a utilization percentage. These are decimal USD
straight off the wire, and an uncapped key has no denominator to be
a percentage of.
Every figure is scoped to one key. The account-wide balance comes
from a different endpoint with a different scope and lives on
UsageSnapshot::balance, not here.
Fields§
§daily: f64§weekly: f64§monthly: f64§limit: Option<f64>Spending cap on this key, in USD, with what is left of it and
the cadence it resets on. All None on an uncapped key, which
is a normal state - a cap can be added or removed from the
provider’s dashboard between one poll and the next, so nothing
may assume a denominator exists.
limit_remaining: Option<f64>§limit_reset: Option<String>§expires_at: Option<String>When the key stops working, when it says.