> ## 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

> Credit packs, usage status, and auto top-up. Spark trial on register; Sprint / Mission / Deploy via API.

## Check status

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

Returns a snapshot of the authenticated agent:

| Field                                         | Meaning                                                                 |
| --------------------------------------------- | ----------------------------------------------------------------------- |
| `tier`                                        | `spark`, `sprint`, `mission`, or `deploy`                               |
| `credits_remaining_usd`                       | Current spendable credit balance (USD string, 4 decimal places)         |
| `credits_expire_at`                           | ISO-8601 UTC — when the current pack expires (`null` if no active pack) |
| `tier_label`                                  | Human-readable tier name (e.g. `"Spark Pack"`)                          |
| `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 (paid packs only)                           |
| `parse_ops_this_month` / `parse_ops_lifetime` | Parse usage                                                             |

## Buy a credit pack

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

{
  "pack": "sprint"
}
```

`pack` must be one of: `sprint` ($25), `mission` ($50), `deploy` (\$100).

Returns a Stripe Checkout URL — open it to complete payment. On success, credits are granted immediately via webhook and pack expiry is set to **90 days from grant (UTC)**.

| Pack              | Price                    | Credits                           | Browse       |
| ----------------- | ------------------------ | --------------------------------- | ------------ |
| **Spark** (trial) | \$5 on register, no card | \~1,000 searches                  | Not included |
| **Sprint**        | \$25 one-off             | \~5,000 searches or browse calls  | Included     |
| **Mission**       | \$50 one-off             | \~10,000 searches or browse calls | Included     |
| **Deploy**        | \$100 one-off            | \~20,000 searches or browse calls | Included     |

Per-call rates: Search **$0.005**, Browse **$0.005**.

## 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_..."
}
```

## Webhook

`POST /v1/billing/webhook` — Stripe-signed events. Configure `STRIPE_WEBHOOK_SECRET` on the host.

## Environment (ops)

* `STRIPE_PRICE_PACK_SPRINT` — Stripe Price ID for Sprint
* `STRIPE_PRICE_PACK_MISSION` — Stripe Price ID for Mission
* `STRIPE_PRICE_PACK_DEPLOY` — Stripe Price ID for Deploy
* `STRIPE_SECRET_KEY`, `STRIPE_PUBLISHABLE_KEY`, `STRIPE_WEBHOOK_SECRET`

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