Subscriptions and billing via Stripe. Checkout, plan changes, invoices, and usage tracking.
https://api.dyva.ai/v1| Plan | Price | Messages | Dyvas | 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 to the returned URL to complete payment.
| 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. |
{
"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"
}curl -X POST https://api.dyva.ai/v1/billing/checkout \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan": "pro",
"interval": "month",
"success_url": "https://dyva.ai/dashboard?upgraded=true",
"cancel_url": "https://dyva.ai/pricing"
}'/v1/billing/subscriptionAuth RequiredCurrent subscription: plan, status, and renewal date.
{
"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"
}curl https://api.dyva.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/subscriptionAuth RequiredUpgrade or downgrade. Prorated automatically by Stripe.
| 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. |
{
"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"
}curl -X PUT https://api.dyva.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "plan": "creator" }'/v1/billing/subscriptionAuth RequiredCancel subscription. Access remains until the billing period ends, then reverts to Free.
{
"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."
}curl -X DELETE https://api.dyva.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/portalAuth RequiredOpen Stripe Customer Portal to manage payment methods and billing details.
{
"portal_url": "https://billing.stripe.com/p/session/live_YWNjdF8xT2EyQmIzQ2M0RGQ1RWU2RmY3R2c4SGg",
"expires_at": "2026-03-09T15:45:00.000Z"
}curl -X POST https://api.dyva.ai/v1/billing/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/invoicesAuth RequiredList past invoices. Supports pagination.
| 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). |
{
"data": [
{
"id": "inv_a1b2c3d4e5f6g7h8",
"number": "Dyva-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": "Dyva-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
}curl "https://api.dyva.ai/v1/billing/invoices?limit=10&offset=0" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/usageAuth RequiredCurrent usage: messages, Dyvas, and knowledge documents against plan limits.
{
"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,
"dyvas_created": 12,
"dyvas_limit": 50,
"knowledge_docs": 38,
"knowledge_limit": 200
}
}curl https://api.dyva.ai/v1/billing/usage \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"