Documentation
¶
Overview ¶
Package pricing applies Anthropic's published per-million-token rates to parsed usage events and returns costs in USD. Rates are snapshots of https://platform.claude.com/docs/en/about-claude/pricing as of 2026-04.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bucket ¶ added in v0.8.2
type Bucket struct {
Kind string // "input" | "cache_write_5m" | "cache_write_1h" | "cache_read" | "output"
Tokens int
Rate float64 // USD per 1M tokens
Cost float64 // USD
}
Bucket is one row of the 5-bucket cost breakdown.
Click to show internal directories.
Click to hide internal directories.