Documentation
¶
Overview ¶
Package usage provides access to the Anthropic quota usage API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AuthFailPath = "/tmp/claude-usage-auth-failed"
AuthFailPath stores the token hash of the last authentication failure. Replaceable for testing.
var CachePath = "/tmp/claude-usage-cache.json"
CachePath is the path to the usage cache file. Replaceable for testing.
var CacheTTL = 10 * time.Minute
CacheTTL is the cache duration for usage data. Configurable at startup.
var ErrUnexpectedStatus = errors.New("unexpected status from usage API")
ErrUnexpectedStatus is returned when the usage API returns a non-200/401/429 status code.
var HTTPGetFn httpclient.GetFn = httpclient.Get
HTTPGetFn is the function used for HTTP requests. Replaceable for testing.
var LastGoodCachePath = "/tmp/claude-usage-last-good.json"
LastGoodCachePath stores the last successful API response. Replaceable for testing.
var RetryAfterPath = "/tmp/claude-usage-retry-after"
RetryAfterPath stores the retry-after deadline. Replaceable for testing.
Functions ¶
func FetchLastGood ¶ added in v0.2.0
FetchLastGood returns the last successful usage data (no TTL).
Types ¶
This section is empty.