# AI usage billing with Switchboard

Switchboard connects AI requests to end-user sessions, usage metering, checkout,
and billing state.

## Billing modes

- End-user paid mode: the customer pays provider cost, Switchboard's 15%
  provider-cost margin, and your configured markup.
- Developer-paid mode: your organization pays provider cost plus Switchboard's
  15% provider-cost margin; end-user charge is zero.
- Credit wallet mode: customers buy recurring credits and usage debits the
  wallet balance.

## Billing gates

Switchboard evaluates billing state before live chat requests:

- `sandbox`: allow sandbox chat.
- `active`: allow paid chat.
- `pending`: send the customer to checkout.
- `past_due`: send the customer to the billing portal.
- `blocked`: disable chat.

## Stripe Connect

Connect Stripe when customers should pay for their own AI usage. Switchboard
creates checkout sessions, records usage, and routes billing state into the
request path.

Use `/docs` for public examples and `/v1/openapi.json` for endpoint details.
