Skip to main content

LiumBudgetExceededError

from lium.sdk import LiumBudgetExceededError

Defined in lium.sdk.exceptions.

The API key's budget refused the request (402, error.code API_KEY_BUDGET_EXCEEDED).

A per-key daily, monthly or lifetime budget (lium keys create --daily-budget / --monthly-budget / --max-budget, lium keys budget) is reached: the billing tick deletes the key's pods (data outside a volume is lost), and a rent, a pod extend / schedule change or a key-initiated top-up (lium fund, lium topup, lium topup card) through that key is refused with this one error (server support pending). The message names the window hit. budget_usd, spent_usd, window (daily, monthly or max) and api_key_id are filled when the server's error body carried them, else None. A LiumPermissionError handler keeps working; this class is for callers that want the numbers.

LiumBudgetExceededError(
message: str,
*,
budget_usd: float | None = None,
spent_usd: float | None = None,
window: str | None = None,
api_key_id: str | None = None,
code: str | None = None,
hint: str | None = None,
request_id: str | None = None
)

Attributes​

NameTypeDescription
budget_usd
spent_usd
window
api_key_id