Billing API
Manage subscriptions and billing via Stripe integration. Create checkout sessions, upgrade or downgrade plans, view invoices, and track usage against your plan limits.
https://api.replr.ai/v1Plan Comparison
| Plan | Price | Messages | REPLRs | Knowledge Docs |
|---|---|---|---|---|
| Free | $0 | 50 / day | 3 | 5 |
| Plus | $12 / mo | 500 / day | 15 | 50 |
| Pro | $30 / mo | 2,000 / day | 50 | 200 |
| Creator | $50 / mo | Unlimited | Unlimited | 1,000 |
Annual billing available at checkout (2 months free). All paid plans include priority support and advanced analytics.
/v1/billing/checkoutAuth RequiredCreate a Stripe Checkout session. Redirect the user to the returned URL to complete payment.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
plan | string | Required | Target plan: "plus", "pro", or "creator". |
interval | string | Required | Billing interval: "month" or "year". Annual billing saves ~17% (2 months free). |
success_url | string | Required | URL to redirect to after successful payment. |
cancel_url | string | Required | URL to redirect to if the user cancels checkout. |
Response
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0#fidkdWxOYHwnPyd1blppbHNgWjA0T",
"session_id": "cs_live_a1b2c3d4e5f6g7h8i9j0",
"expires_at": "2026-03-09T15:22:11.000Z"
}Examples
curl -X POST https://api.replr.ai/v1/billing/checkout \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan": "pro",
"interval": "month",
"success_url": "https://replr.ai/dashboard?upgraded=true",
"cancel_url": "https://replr.ai/pricing"
}'/v1/billing/subscriptionAuth RequiredGet the current subscription details for the authenticated user, including plan, status, and renewal date.
Response
{
"id": "sub_1Oa2Bb3Cc4Dd5Ee6Ff7Gg8Hh",
"plan": "pro",
"status": "active",
"interval": "month",
"current_period_start": "2026-02-09T00:00:00.000Z",
"current_period_end": "2026-03-09T00:00:00.000Z",
"cancel_at": null,
"canceled_at": null,
"created_at": "2025-12-09T14:22:11.000Z",
"stripe_customer_id": "cus_Qa1Rb2Sc3Td4Ue5V"
}Examples
curl https://api.replr.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/subscriptionAuth RequiredUpgrade or downgrade the current subscription. Changes are prorated automatically by Stripe.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
plan | string | Required | New target plan: "plus", "pro", or "creator". Upgrades apply immediately; downgrades take effect at the end of the current billing period. |
Response
{
"id": "sub_1Oa2Bb3Cc4Dd5Ee6Ff7Gg8Hh",
"plan": "creator",
"previous_plan": "pro",
"status": "active",
"interval": "month",
"proration_amount": -1463,
"proration_currency": "usd",
"current_period_end": "2026-03-09T00:00:00.000Z",
"updated_at": "2026-03-05T10:30:00.000Z"
}Examples
curl -X PUT https://api.replr.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "plan": "creator" }'/v1/billing/subscriptionAuth RequiredCancel the current subscription. Access remains active until the end of the current billing period, then reverts to the Free plan.
Response
{
"id": "sub_1Oa2Bb3Cc4Dd5Ee6Ff7Gg8Hh",
"plan": "pro",
"status": "active",
"cancel_at": "2026-03-09T00:00:00.000Z",
"canceled_at": "2026-03-05T10:45:22.000Z",
"message": "Subscription will remain active until the end of the current billing period."
}Examples
curl -X DELETE https://api.replr.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/portalAuth RequiredCreate a Stripe Customer Portal session. Redirect the user to manage payment methods, view invoices, and update billing details.
Response
{
"portal_url": "https://billing.stripe.com/p/session/live_YWNjdF8xT2EyQmIzQ2M0RGQ1RWU2RmY3R2c4SGg",
"expires_at": "2026-03-09T15:45:00.000Z"
}Examples
curl -X POST https://api.replr.ai/v1/billing/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/invoicesAuth RequiredList past invoices for the authenticated user. Supports pagination via limit and offset query parameters.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | Optional | Maximum number of invoices to return (default 20, max 100). |
offset | integer | Optional | Number of invoices to skip for pagination (default 0). |
Response
{
"data": [
{
"id": "inv_a1b2c3d4e5f6g7h8",
"number": "REPLR-2026-0042",
"amount": 3000,
"currency": "usd",
"status": "paid",
"plan": "pro",
"interval": "month",
"period_start": "2026-02-09T00:00:00.000Z",
"period_end": "2026-03-09T00:00:00.000Z",
"paid_at": "2026-02-09T00:01:14.000Z",
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1Oa2Bb/live_inv_a1b2c3d4/pdf"
},
{
"id": "inv_z9y8x7w6v5u4t3s2",
"number": "REPLR-2026-0031",
"amount": 3000,
"currency": "usd",
"status": "paid",
"plan": "pro",
"interval": "month",
"period_start": "2026-01-09T00:00:00.000Z",
"period_end": "2026-02-09T00:00:00.000Z",
"paid_at": "2026-01-09T00:01:08.000Z",
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1Oa2Bb/live_inv_z9y8x7w6/pdf"
}
],
"total": 4,
"limit": 20,
"offset": 0
}Examples
curl "https://api.replr.ai/v1/billing/invoices?limit=10&offset=0" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/usageAuth RequiredGet current usage statistics for the authenticated user, including messages sent, REPLRs created, and knowledge documents uploaded against plan limits.
Response
{
"plan": "pro",
"period_start": "2026-02-09T00:00:00.000Z",
"period_end": "2026-03-09T00:00:00.000Z",
"usage": {
"messages_sent": 847,
"messages_limit": 2000,
"replrs_created": 12,
"replrs_limit": 50,
"knowledge_docs": 38,
"knowledge_limit": 200
}
}Examples
curl https://api.replr.ai/v1/billing/usage \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"