# Billing and usage

SigWise is prepaid: you add funds, and each analysis draws down the balance.
There is no subscription and every account starts with free credit.

## Balance

```bash
curl "$API/v1/billing?api_key=$ANALYZE_API_KEY" -H "Authorization: Bearer $(sign)"
```

```json
{
  "balance_cents": 1250,
  "currency": "usd",
  "metering_enabled": true,
  "enforcement": "block",
  "self_serve_topup": true,
  "low_balance_threshold_cents": 100,
  "topup_min_cents": 500,
  "topup_max_cents": 100000
}
```

When the balance reaches zero under `block` enforcement, analyses pause:
ingestion answers `402 payment_required` and records nothing, and
[direct moderation](https://sigwise.ai/docs/guides/moderation.md) records the events but doesn't score
them. Console users are emailed when the balance runs low and when it runs out.

## Adding funds

Add funds in the console with a card, or through the API:

```bash
curl -X POST "$API/v1/billing/checkout?api_key=$ANALYZE_API_KEY" \
  -H "Authorization: Bearer $(sign)" -H 'Content-Type: application/json' \
  -d '{"amount_cents":2500}'
```

This returns a Stripe Checkout `url` to send the payer to. The balance is
credited once Stripe confirms the payment; check with
`GET /v1/billing/checkout/{session_id}` (`pending` until then, `credited` after).

## Ledger

Every change to the balance is an entry in the ledger: a negative
`delta_cents` for each analysis, a positive one for each credit.

```bash
curl "$API/v1/billing/ledger?type=charge&limit=50&api_key=$ANALYZE_API_KEY" -H "Authorization: Bearer $(sign)"
```

A single analysis usually costs a fraction of a cent, which rounds to `0` in
`delta_cents`; `delta_micros` has the exact amount in micro-dollars (1e-6 USD).
Pages are newest first: pass `next_cursor` as `cursor` for the next page, until
it comes back empty.

## Usage

`GET /v1/usage?from=2026-09-01&to=2026-09-30` summarizes a date range (UTC,
inclusive, at most 366 days, the last 30 by default): analyses, spend and
tokens in total and per day, broken down by model, by source (`async` or
`sync`) and by signal, with your average daily spend and how many days the
balance would last at that rate (`runway_days`).
