Versions in this module Expand all Collapse all v0 v0.1.1 Oct 4, 2026 Changes in this version type Engine + func (e *Engine) PriceStoredEvent(ev model.UsageEvent) (int64, string, bool) v0.1.0 Oct 3, 2026 Changes in this version + const ModelsDevURL + const RefreshURL + const SourceOverride + func BuildModelsDevSnapshot(data []byte) ([]byte, error) + func SnapshotField(key string) bool + type Charge struct + AdditiveReasoning bool + Aggregate bool + CacheRead int64 + CacheWrite1h int64 + CacheWrite5m int64 + Input int64 + Model string + Output int64 + Provider string + Reasoning int64 + ServiceTier string + func ChargeFor(e model.UsageEvent) Charge + func (c Charge) ContextTokens() int64 + func (c Charge) Tokens() int64 + type Engine struct + func New(opt Options) *Engine + func (e *Engine) Price(c Charge) (int64, string, bool) + func (e *Engine) PriceEvent(ev model.UsageEvent) (int64, string, bool) + func (e *Engine) Refresh(ctx context.Context) error + func (e *Engine) Revision() string + type LongContext struct + CacheRead float64 + CacheWrite1h float64 + CacheWrite5m float64 + Input float64 + Output float64 + Threshold int64 + type Options struct + DataDir string + Overrides map[string]Rates + Refresh bool + type Rates struct + CacheRead float64 + CacheWrite1h float64 + CacheWrite5m float64 + Free bool + Input float64 + InputBatch float64 + Long LongContext + Output float64 + OutputBatch float64 + func (r Rates) Cost(c Charge) int64 + func (r Rates) Priceable() bool + type Table struct + Models map[string]Rates + ProviderScoped bool + Source string + func (t *Table) Lookup(provider, name string) (Rates, bool)