Documentation
¶
Overview ¶
Package usage provides access to the Anthropic quota usage API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CachePath = "/tmp/claude-usage-cache.json"
CachePath is the path to the usage cache file. Replaceable for testing.
View Source
var CacheTTL = 60 * time.Second
CacheTTL is the cache duration for usage data. Configurable at startup.
View Source
var HTTPGetFn httpclient.GetFn = httpclient.Get
HTTPGetFn is the function used for HTTP requests. Replaceable for testing.
Functions ¶
func CountCompactions ¶
CountCompactions counts compact_boundary entries in a session transcript JSONL.
func FormatQuotaWindow ¶
func FormatQuotaWindow(win *QuotaWindow, label string) string
FormatQuotaWindow formats a single quota window for display.
Types ¶
type Data ¶
type Data struct {
FiveHour *QuotaWindow
SevenDay *QuotaWindow
Extra *ExtraUsage
ErrorType string
}
Data is the parsed response from Anthropic usage API.
type ExtraUsage ¶
ExtraUsage represents monthly extra/overuse budget.
Click to show internal directories.
Click to hide internal directories.