Wallet, payments & plans
Balance
Chat done events and send responses also return the new balance, so you rarely need to poll.
Buy tokens
Start a checkout with a packid:
- POST /api/payment/checkout/stripe/ — USD, returns a Stripe Checkout URL - POST /api/payment/checkout/esewa/ / …/khalti/ — NPR - POST /api/payment/verify-return/ — confirm the payment when the gateway redirects back
GET /api/payment/transactions/ lists purchases.
Promo codes
POST /api/payment/promo/redeem/ applies it (same body).
Plans
GET /api/subscription/me/ · POST /api/subscription/requests/ to request an upgrade · …/{id}/cancel/.
Usage
GET /api/usage/stats/ and GET /api/usage/history/ — tokens and cost over time.