Skip to main content

Module subscription

Module subscription 

Source
Expand description

On-demand subscription usage for managed provider accounts.

Answers “how much of this account’s plan is left” by asking the provider directly: Claude through its OAuth usage endpoint (refreshing the stored token when it has expired), Codex through a one-shot codex app-server JSON-RPC exchange against the account’s home. Results are persisted to provider_account_limits by live auth status. Cached auth reads never poll; lf usage separately reports Run token/cost evidence.

Structs§

RateLimitResetCredit
RateLimitResetCredits
Wire fields from account/rateLimits/read. Missing details are not an empty list.
SubscriptionUsage
The freshly observed subscription state of one account.

Enums§

SubscriptionError
Why an account’s subscription state could not be read. NeedsLogin is an answer, not a failure: the account exists but its credential was revoked or expired beyond refresh, and only lf auth connect fixes that.

Functions§

poll_account
Poll one managed account’s provider for its live subscription state.