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

# Billing

> Rolling-30 free floors, per-action credit pricing, slider top-up. D173/D174 — packs retired, capabilities 4.4.0.

Pricing shape ruled D173 (2026-08-19), amended D174 (2026-08-20) — retires the Spark/Sprint/Mission/Deploy pack model in favor of rolling-30-day free floors plus per-action credit pricing and a volume-discount slider. **`GET /v1/capabilities`** is authoritative for numeric rates and tier copy.

## Check status

```bash theme={null}
GET /v1/billing
Authorization: Bearer ltx_your_key
```

Returns a snapshot of the authenticated agent:

| Field                                         | Meaning                                                                                 |
| --------------------------------------------- | --------------------------------------------------------------------------------------- |
| `tier`                                        | DB tier column (`spark`, legacy pack names, or `starter`/`pro` for older subscriptions) |
| `credits_remaining_usd`                       | Current spendable credit balance (USD string, 4 decimal places)                         |
| `credits_expire_at`                           | Legacy pack expiry for historical rows; purchased slider credits do not expire (D174)   |
| `tier_label`                                  | Human-readable tier name                                                                |
| `auto_topup`                                  | `true` if auto top-up is configured                                                     |
| `over_limit`                                  | `true` if storage, memory, or parse quota is at cap                                     |
| `memory_ops_this_month`                       | Memory operations logged this UTC month                                                 |
| `memory_storage_bytes`                        | KV JSON storage (bytes)                                                                 |
| `blob_embed_storage_bytes`                    | Bytes used by parsed document chunk embeddings                                          |
| `combined_memory_storage_bytes`               | `memory_storage_bytes + blob_embed_storage_bytes`                                       |
| `search_calls_this_month`                     | Web-discovery calls this UTC month                                                      |
| `browse_calls_this_month`                     | Browse calls this UTC month                                                             |
| `parse_ops_this_month` / `parse_ops_lifetime` | Parse usage                                                                             |

## Free floors (D173/D174)

Before any credit is charged:

| Action       | Free floor | Window          |
| ------------ | ---------- | --------------- |
| Memory write | 1,000      | Rolling 30 days |
| Search       | 50         | Rolling 30 days |
| Browse       | 20         | Rolling 30 days |

Past the floor: memory write **1 credit ($0.01)**, search **2 credits ($0.02)**, browse **static 3 credits ($0.03)** / **dynamic 5 credits ($0.05)**. See [Pricing](/pricing) for the volume-discount slider rates.

## Buy credits (slider)

```bash theme={null}
POST /v1/billing/credits/checkout
Authorization: Bearer ltx_your_key
Content-Type: application/json

{
  "credits": 2500
}
```

Returns honest **`unit_rate_usd`** and **`total_usd`** at the D173 volume-discount table. Until business registration completes (**D125**) and `STRIPE_SLIDER_CHECKOUT_ENABLED` is set, expect **503** with `status: not_live` and `error_code: STRIPE_GATED_D125` — no Stripe Checkout Session is created.

| Credits      | Rate            | Discount |
| ------------ | --------------- | -------- |
| 1–999        | \$0.01/credit   | base     |
| 1,000–4,999  | \$0.009/credit  | 10%      |
| 5,000–19,999 | \$0.0075/credit | 25%      |
| 20,000+      | \$0.006/credit  | 40%      |

**Purchased credit never expires** (D174). Retired fixed packs used **180-day** expiry on grant-only rows; slider purchases do not set `expires_at`.

### Retired pack checkout

`POST /v1/billing/packs/checkout` returns **410 Gone** (`PACK_CHECKOUT_RETIRED`). Fixed packs are historical only — use the slider endpoint above.

## Auto top-up

Set a threshold and saved payment method — Lithtrix refills automatically when your balance drops below it.

```bash theme={null}
POST /v1/billing/auto-topup
Authorization: Bearer ltx_your_key
Content-Type: application/json

{
  "enabled": true,
  "threshold_usd": "5.00",
  "pack": "sprint",
  "payment_method_id": "pm_..."
}
```

The `pack` field still reflects the pre-D173 auto-topup shape — slider migration is a follow-up when D125 unblocks charging.

## Webhook

`POST /v1/billing/webhook` — Stripe-signed events. Configure `STRIPE_WEBHOOK_SECRET` on the host. Slider purchases use metadata `purchase_type=slider` when live.

## Environment (ops)

* `STRIPE_SLIDER_CHECKOUT_ENABLED` — `false` until D125 go-live (default)
* `STRIPE_SECRET_KEY`, `STRIPE_PUBLISHABLE_KEY`, `STRIPE_WEBHOOK_SECRET`
* Legacy pack Price IDs (`STRIPE_PRICE_PACK_*`) — dormant; retained for historical webhook rows only

See also [`GET /v1/capabilities`](https://api.lithtrix.ai/v1/capabilities) for the `pricing` block and per-call rates, and [Pricing](/pricing) for the full D173/D174 shape.
