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 so lf usage reads instantly and only polls windows that have gone stale.

Structs§

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§

account_home
Where each managed account’s credential home lives, for poll_account callers that only have the store row.
poll_account
Poll one managed account’s provider for its live subscription state.