Subscriptions and billing via Stripe. Checkout, plan changes, invoices, and usage tracking.
Every route and HTTP method below was checked directly against the live ts-api source on August 13, 2026. Response bodies are illustrative examples, never captured responses.
Base URL
https://api.dyva.ai/v1/v1/billing/create-checkoutCreate a Stripe Checkout session for a new subscription or a plan change. Redirect to the returned URL to complete payment. The success and cancel redirects are fixed server-side; this endpoint does not accept custom redirect URLs.
Route and method verified directly against the live ts-api source on August 13, 2026.
Request body (3)
planstringRequiredintervalstringOptionaltrialbooleanOptionalResponse
Illustrative example, not a captured response{
"url": "https://checkout.stripe.com/c/pay/cs_test_EXAMPLE_a1b2c3d4e5f6",
"session_id": "cs_test_EXAMPLE_a1b2c3d4e5f6"
}Examples (2)
curl -X POST https://api.dyva.ai/v1/billing/create-checkout \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan": "pro",
"interval": "monthly"
}'/v1/billing/subscriptionCurrent subscription state: tier, status, renewal date, and (when Stripe has one on file) the payment method on the account.
Route and method verified directly against the live ts-api source on August 13, 2026.
Response
Illustrative example, not a captured response{
"tier": "pro",
"status": "active",
"stripe_customer_id": "cus_EXAMPLE00001",
"stripe_subscription_id": "sub_EXAMPLE00001",
"cancel_at_period_end": false,
"current_period_start": "2026-02-09T00:00:00.000Z",
"current_period_end": "2026-03-09T00:00:00.000Z",
"interval": "month",
"trial_eligible": false,
"trial_end": null,
"next_invoice_amount": 2499,
"next_invoice_currency": "usd",
"payment_method": {
"brand": "visa",
"last4": "4242",
"exp_month": 12,
"exp_year": 2028
}
}Examples (2)
curl https://api.dyva.ai/v1/billing/subscription \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/cancelCancel at the end of the current billing period. Access continues until then, then the account drops to Free. Reversible with /v1/billing/reactivate before the period ends. This page previously documented this action as a DELETE on /v1/billing/subscription; no such route exists, cancellation is this POST endpoint.
Route and method verified directly against the live ts-api source on August 13, 2026.
Response
Illustrative example, not a captured response{
"ok": true,
"cancel_at_period_end": true
}Examples (2)
curl -X POST https://api.dyva.ai/v1/billing/cancel \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/portalOpen the Stripe Customer Portal to manage payment methods, view invoices, and cancel or reactivate. Fails with a 400 if the account has never made a purchase (no Stripe customer on file yet).
Route and method verified directly against the live ts-api source on August 13, 2026.
Response
Illustrative example, not a captured response{
"url": "https://billing.stripe.com/p/session/test_EXAMPLE00001"
}Examples (2)
curl -X POST https://api.dyva.ai/v1/billing/portal \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/invoicesPast invoices: real Stripe subscription invoices merged with one-time credit-pack purchases (which don't always produce a Stripe invoice), newest first. Returns a plain array, not a paginated envelope.
Route and method verified directly against the live ts-api source on August 13, 2026.
Path and query parameters (1)
limitintegerOptionalResponse
Illustrative example, not a captured response[
{
"id": "in_EXAMPLE00001",
"number": "DYVA-EXAMPLE-0001",
"amount_due": 2499,
"amount_paid": 2499,
"currency": "usd",
"status": "paid",
"created": "2026-02-09T00:01:14.000Z",
"period_start": "2026-02-09T00:00:00.000Z",
"period_end": "2026-03-09T00:00:00.000Z",
"hosted_invoice_url": "https://invoice.stripe.com/i/EXAMPLE00001",
"invoice_pdf": "https://invoice.stripe.com/i/EXAMPLE00001/pdf"
},
{
"id": "topup_EXAMPLE00002",
"number": null,
"amount_due": 999,
"amount_paid": 999,
"currency": "usd",
"status": "paid",
"created": "2026-01-22T18:04:00.000Z",
"period_start": "2026-01-22T18:04:00.000Z",
"period_end": "2026-01-22T18:04:00.000Z",
"hosted_invoice_url": null,
"invoice_pdf": null
}
]Examples (2)
curl "https://api.dyva.ai/v1/billing/invoices?limit=10" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"/v1/billing/usageUsage counters against tier limits: messages sent today, characters owned, voice minutes this month, and API calls today. A limit of 0 means unlimited for that tier. There is no knowledge-document limit in this response; the plan catalog does not cap knowledge documents per character.
Route and method verified directly against the live ts-api source on August 13, 2026.
Response
Illustrative example, not a captured response{
"messages_today": 84,
"messages_limit": 0,
"dyvas_created": 12,
"dyvas_limit": 100,
"voice_seconds_month": 1820,
"voice_minutes_limit": 0,
"api_calls_today": 47,
"api_calls_limit": 500
}Examples (2)
curl https://api.dyva.ai/v1/billing/usage \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"