> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.chaser.sh/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.chaser.sh/_mcp/server.

# Billing API

Manage workspace balance and top-ups.

## GET /v1/usage

See the [Usage API](/docs/api-reference/usage-api) for the usage endpoint, which includes billing totals.

## POST /v1/billing/topup

Create a Stripe checkout session to add funds to the workspace balance.

```bash
curl -s https://api.chaser.sh/v1/billing/topup \
  -X POST \
  -H "Cookie: chaser_session=..." \
  -H "Content-Type: application/json" \
  -d '{"amount_usd": 50}' | jq
```

**Request body:**

| Field | Type | Default | Description |
|---|---|---|---|
| `amount_usd` | integer | — | Amount in USD. Minimum: $10. |

**Response `200`:**

```json
{
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_..."
}
```

Open `checkout_url` in a browser to complete payment. Stripe handles the entire payment flow. On success, the workspace balance is credited immediately.

This endpoint requires cookie authentication (dashboard session). It is not available via API key.

## Balance and charging

- **Prepaid.** You add funds before use. Sessions check workspace balance before provisioning.
- **Deduction.** Egress is deducted from balance at $5/GB as sessions close.
- **Minimum top-up.** $10.
- **Credits never expire.** Unused balance carries over indefinitely.
- **Insufficient balance.** If the balance runs to zero, active sessions are allowed to finish but new sessions return `402 payment_required` until the balance is topped up.