LLMProxy.ProviderUsage (llm_proxy v0.2.0)

Copy Markdown View Source

Live upstream usage-window state for configured provider accounts.

Provider credentials stay behind the provider-token codec boundary. Public functions return only redacted account labels, quota values, timestamps, and safe status text.

Summary

Functions

account_count()

@spec account_count() :: non_neg_integer()

attention_count()

@spec attention_count() :: non_neg_integer()

available_count()

@spec available_count() :: non_neg_integer()

refresh_account(id)

@spec refresh_account(pos_integer()) ::
  {:ok, :started | :already_refreshing} | {:error, :unsupported | :unavailable}

refresh_all()

@spec refresh_all() :: {:ok, :started | :already_refreshing} | {:error, :unavailable}

rows()

@spec rows() :: %{columns: [atom()], rows: [map()]}

snapshots()

@spec snapshots() :: [LLMProxy.ProviderUsage.Snapshot.t()]

token_available?(token_id, at \\ DateTime.utc_now())

@spec token_available?(integer(), DateTime.t()) :: boolean()