Skip to main content
ai-cmo.dev uses a micro-USD credit system. 1,000,000 µUSD = $1.00. Every metered operation (measurement run, SEO refresh, chat, research) reserves credits up front and settles the actual cost after completion.

Endpoints

Credit model

  1. Free grant: New workspaces receive 1,000,000 µUSD ($1.00), expiring in 30 days. One grant per user.
  2. Reserve-then-settle: An operation reserves an estimated amount. As the operation runs, incremental leases are authorized against the reservation. When complete, the actual cost is settled.
  3. Insufficient credits: If the balance cannot cover a reservation, the operation fails with 402 insufficient_credits including requiredMicrousd and availableMicrousd in details.

Read balance

Response:

Read usage

Returns minimal ledger and metered-operation data. The limit parameter defaults to 100 and has a maximum of 500.

Stripe checkout

Session-only. Creates a Stripe Checkout Session for a credit top-up.
Request body: Response:

Mock top-up

Available only in local/test mode (when STRIPE_SECRET_KEY is not set or GEO_OPERATOR_MODE=local). Session-only.
When Stripe is configured, mock top-ups return 409 mock_topup_disabled.

Reservation amounts

Billing status

Returns receipts for the latest 20 checkout sessions with their status (pending, succeeded, failed).

Stripe webhook

POST /api/v1/webhooks/stripe (public route) Stripe sends checkout.session.completed and checkout.session.expired events to this endpoint. The server verifies the signature against STRIPE_WEBHOOK_SECRET. If the secret is unset, the webhook fails closed with 503 billing_unavailable. The webhook is idempotent: a replayed checkout.session.completed event never double-credits.