Versions in this module Expand all Collapse all v0 v0.1.3 Jul 4, 2026 v0.1.1 Jun 25, 2026 Changes in this version + const DefaultBaseURL + var KnownModels = map[string]ModelMetadata + func AllKnownModelIDs() []string + func EstimateCost(model string, inputTokens, outputTokens int, ...) float64 + func EstimateCostTiered(inputTokens, outputTokens int, base, tiered PricingTier, tierThreshold int) float64 + func FormatStatus(s UsageStatus) string + func NativeModelID(id string) string + func ProtocolForModel(modelID string) string + func ProtocolMapSnapshot() map[string]string + func ResetProtocolMap() + func UpdateProtocolMap(entries []struct{ ... }) + func UsesMessagesAPI(modelID string) bool + type ModelMetadata struct + CachedRead float64 + CachedWrite float64 + Context int + InputPer1M float64 + MaxOutput int + OutputPer1M float64 + Protocol string + TierThreshold int + TieredCachedRead float64 + TieredCachedWrite float64 + TieredInputPer1M float64 + TieredOutputPer1M float64 + func MetadataForModel(modelID string) (ModelMetadata, bool) + type PricingTier struct + InputPer1M float64 + OutputPer1M float64 + type UsageLimits struct + FiveHourLimit float64 + MonthlyLimit float64 + WeeklyLimit float64 + func DefaultUsageLimits() UsageLimits + type UsageRecord struct + CostUSD float64 + InputTokens int + Model string + OutputTokens int + Timestamp time.Time + type UsageStatus struct + FiveHourLimit float64 + FiveHourSpend float64 + MonthlyLimit float64 + MonthlySpend float64 + WeeklyLimit float64 + WeeklySpend float64 + type UsageTracker struct + func NewUsageTracker(limits UsageLimits) *UsageTracker + func (t *UsageTracker) Record(r UsageRecord) + func (t *UsageTracker) SpendInWindow(window time.Duration) float64 + func (t *UsageTracker) Status() UsageStatus + func (t *UsageTracker) WouldExceedLimit(additionalCost float64) error