Billing

The billing API exposes your account’s plan, credit balance, and subscription management. Most billing actions can also be performed from the Usage & Billing page in the dashboard.

Get billing info

Returns your current plan, credit balance, and usage for the current period. GET /api/billing Response (200)
{
  "success": true,
  "data": {
    "billing": {
      "plan": "starter-pro",
      "planCreditsRemaining": 74.50,
      "prepaidBalance": 50.00,
      "totalBalance": 124.50,
      "currentPeriodStart": "2024-03-01T00:00:00.000Z",
      "currentPeriodEnd": "2024-04-01T00:00:00.000Z"
    }
  }
}

List plans

Returns all available subscription plans with pricing and limits. GET /api/billing/plans Response (200)
{
  "success": true,
  "data": {
    "plans": [
      {
        "id": "free",
        "name": "Free",
        "monthlyCredits": 10,
        "concurrentAgents": 1,
        "maxDurationHours": 1,
        "price": 0
      },
      {
        "id": "starter-pro",
        "name": "Starter Pro",
        "monthlyCredits": 100,
        "concurrentAgents": 5,
        "maxDurationHours": 8,
        "price": 29
      },
      {
        "id": "max",
        "name": "Max",
        "monthlyCredits": "custom",
        "concurrentAgents": "unlimited",
        "maxDurationHours": 24,
        "price": "custom"
      }
    ]
  }
}

Subscribe to a plan

Initiates a Stripe checkout session to upgrade or downgrade your subscription. Returns a checkoutUrl to redirect your user to. POST /api/billing/subscribe Body
{
  "planId": "starter-pro"
}
Response (200)
{
  "success": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/..."
  }
}

Add credits

Initiates a Stripe checkout to top up your prepaid credit balance. POST /api/billing/recharge Body
{
  "amount": 50
}
FieldTypeDescription
amountnumberUSD amount to add to prepaid balance
Response (200)
{
  "success": true,
  "data": {
    "checkoutUrl": "https://checkout.stripe.com/..."
  }
}