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

# billing_required

> HTTP 402 — subscription is in a state that blocks API access.

|                 |                                           |
| --------------- | ----------------------------------------- |
| **HTTP status** | `402 Payment Required`                    |
| **Code**        | `billing_required`                        |
| **Retry?**      | After resolving billing in the dashboard. |

## When this happens

The tenant's subscription is in a state that blocks production API
access:

* **Past due** — Stripe could not charge the payment method on file.
* **Canceled** — the subscription has been canceled.
* **No active subscription** — the trial expired and no plan was
  selected.

The API surfaces subscription health in the
`X-Subscription-Status` and `X-Billing-Status` response headers on
every response, so you can detect the impending block before the 402
fires.

## Example response

```json theme={null}
{
  "detail": "Subscription is past due. Update the payment method to restore API access.",
  "code": "billing_required",
  "request_id": "5b3f6c7e-7d24-4d40-9b12-3a59c01c6e91",
  "doc_url": "https://docs.lasscyber.com/errors/billing_required"
}
```

## How to fix

1. Sign in at
   [`agnes.lasscyber.com/agnes-info/billing`](https://agnes.lasscyber.com/agnes-info/billing).
2. Click **Manage billing** to open the Stripe Customer Portal.
3. Update the payment method or pay the outstanding invoice.
4. Once Stripe marks the subscription `active`, API access resumes
   automatically (the next request after the webhook is processed).

If you intended to remain on a paid tier, contact
[`sales@lasscyber.com`](mailto:sales@lasscyber.com) for help with
purchase orders or non-card billing.

## Sandbox keys are unaffected

`ak_test_*` keys never trigger this error — sandbox traffic bypasses
billing entirely. See [Sandbox mode](/testing/sandbox-mode).

## SDK behaviour

| SDK        | Exception            |
| ---------- | -------------------- |
| Python     | `agnes.BillingError` |
| TypeScript | `BillingError`       |

SDKs do not retry 402s — billing must be resolved before traffic
flows.

## Related

* [`billing_grace_period`](/errors/billing_grace_period) — same
  underlying state, but inside the grace window where requests are
  warned, not blocked.
* [Billing](/administration/billing)
