---
title: LiumBudgetExceededError
sidebar_label: LiumBudgetExceededError
sidebar_position: 11
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lium.io/llms.txt
> Use this file to discover all available pages before exploring further.

<!-- Generated by scripts/generate_sdk_reference.py. Do not edit directly. -->

# LiumBudgetExceededError

```python
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`](/developers/sdk/reference/exceptions/lium-permission-error) handler keeps working; this
class is for callers that want the numbers.

```python
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

| Name | Type | Description |
| --- | --- | --- |
| `budget_usd` |  |  |
| `spent_usd` |  |  |
| `window` |  |  |
| `api_key_id` |  |  |
