Python: Billing, usage and health
Read plans, subscriptions, usage, compute and invoices, and check platform health and error traces with the Python SDK.
Read your organization's plan, usage and invoices from code — for dashboards, alerts and internal tools. Payment calls (billing_checkout, billing_pay_invoice, billing_razorpay_*) are what the console's checkout uses.
#Methods
sovaria.billing_addon_checkout
Start paying for more units of an add-on (extra_project, custom_domains, extra_environment), prorated to the period end.
await sovaria.billing_addon_checkout(
account_id: str,
addon_id: str,
quantity: int = 1,
project_id: str | None = None,
) -> dict[str, Any]Returns a Razorpay order; the units count once the payment is verified.
Parameters
account_idstrrequiredaddon_idstrrequiredquantityintoptionaldefault1project_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"mode": "razorpay_standard",
"order_id": "order_PcA…",
"amount": 57200,
"currency": "INR",
"key_id": "rzp_live_…",
"addon_id": "custom_domains",
"quantity": 1,
"usd_cents": 650,
"paid_through": "2026-11-09T00:00:00+00:00",
"monthly_price_cents": 1000
}sovaria.billing_auto_recharge
Billing auto recharge.
await sovaria.billing_auto_recharge(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_autopay_setup
₹1 (refunded) authorisation that saves a card or UPI mandate for automatic renewals.
await sovaria.billing_autopay_setup(
account_id: str,
customer_email: str | None = None,
name: str | None = None,
) -> dict[str, Any]Parameters
account_idstrrequiredcustomer_emailstr | NoneoptionaldefaultNonenamestr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"mode": "razorpay_recurring",
"order_id": "order_PcM…",
"amount": 100,
"currency": "INR",
"key_id": "rzp_live_…",
"customer_id": "cust_PcK…",
"recurring": "1",
"max_amount_paise": 1500000
}sovaria.billing_build_invoice
Billing build invoice.
await sovaria.billing_build_invoice(
org_id: str,
*, period: str | None = None,
) -> dict[str, Any]Parameters
org_idstrrequiredperiodstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"id": 311,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-10",
"plan": "pro",
"plan_fee_cents": 2900,
"compute_fee_cents": 1000,
"overage_fee_cents": 412,
"credit_cents": 1000,
"total_cents": 3312,
"line_items": [
{
"kind": "plan_fee",
"description": "Pro plan (monthly)",
"amount_cents": 2900
},
{
"kind": "compute",
"description": "Compute micro × 720 h",
"amount_cents": 1000
},
{
"kind": "compute_credit",
"description": "Included compute credit (Pro)",
"amount_cents": -1000
},
{
"kind": "overage",
"description": "Function invocations: 206,000 over",
"amount_cents": 412
}
],
"status": "draft",
"issued_at": null,
"created_at": "2026-10-01T00:05:00+00:00",
"stripe_invoice_id": null,
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51"
}sovaria.billing_buy_credit_pack_from_wallet
Buy a credit pack from the wallet (promo first, then cash).
await sovaria.billing_buy_credit_pack_from_wallet(
pack_id: str,
org_id: str | None = None,
) -> dict[str, Any]Parameters
pack_idstrrequiredorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_cancel_account
Billing cancel account.
await sovaria.billing_cancel_account(account_id: str) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"billing_cycle": "monthly",
"status": "active",
"renewal_status": "cancel_scheduled",
"autopay_enabled": false,
"grace_until": null,
"current_period_start": "2026-10-01T00:00:00+00:00",
"current_period_end": "2026-11-01T00:00:00+00:00",
"payment_provider": "razorpay",
"provider_customer_id": "cust_…",
"metadata": {},
"created_at": "2026-09-01T10:00:00+00:00"
}sovaria.billing_cancel_subscription
Cancel an organisation subscription.
await sovaria.billing_cancel_subscription(
org_id: str,
*, immediate: bool = False,
) -> dict[str, Any]Parameters
org_idstrrequiredimmediatebooloptionaldefaultFalse
Returns
dict[str, Any]
sovaria.billing_checkout
Billing checkout.
await sovaria.billing_checkout(
body: dict[str, Any],
*, org_id: str | None = None,
) -> dict[str, Any]Parameters
bodydict[str, Any]requiredorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"checkout_session_id": "order_PbX…",
"url": null,
"provider": "razorpay",
"mode": "razorpay_standard",
"order_id": "order_PbX…",
"amount": 2341900,
"currency": "INR",
"key_id": "rzp_live_…",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"plan": "pro",
"billing_cycle": "annual"
}sovaria.billing_credit_packs
Credit packs for sale, the Sovariq wallet cap and the org's packs.
await sovaria.billing_credit_packs(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_credits
Sovariq credits this month and today (credits only; one credit is $0.01 of AI use).
await sovaria.billing_credits(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_get_account
Billing get account.
await sovaria.billing_get_account(account_id: str) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"billing_cycle": "monthly",
"status": "active",
"renewal_status": "active",
"autopay_enabled": true,
"grace_until": null,
"current_period_start": "2026-10-01T00:00:00+00:00",
"current_period_end": "2026-11-01T00:00:00+00:00",
"payment_provider": "razorpay",
"provider_customer_id": "cust_…",
"metadata": {},
"created_at": "2026-09-01T10:00:00+00:00",
"plan_detail": {
"name": "pro",
"display_name": "Pro",
"monthly_price_cents": 2900,
"annual_price_cents": 27840,
"description": "Production projects with light scale.",
"limits": {
"max_projects": 3,
"max_team_members": 5,
"max_organizations": 3,
"max_storage_gb": 50,
"max_function_invocations_per_month": 2000000,
"…": "…"
},
"features": {
"cli_access": true,
"sdk_access": true,
"custom_domains": true,
"priority_support": false,
"image_transforms": true,
"…": "…"
},
"entitlements": {
"org.projects": 3,
"db.read_replicas": 0,
"fn.invocations_month": 2000000,
"…": "…"
},
"soft_limits": [
"fn.invocations_month",
"storage.bytes",
"…"
]
}
}sovaria.billing_get_account_overage
Billing get account overage.
await sovaria.billing_get_account_overage(
account_id: str,
) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"period_start": "2026-10-01T00:00:00+00:00",
"period_end": "2026-11-01T00:00:00+00:00",
"projected_overage_cents": 412,
"accrued_cents": 412,
"lines": [
{
"kind": "overage",
"metric": "function_invocations",
"label": "Function invocations",
"over_units": 206000,
"amount_cents": 412
}
],
"source": "accrual",
"org_ids": [
"b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90"
]
}sovaria.billing_get_account_overage_prefs
Billing get account overage prefs.
await sovaria.billing_get_account_overage_prefs(
account_id: str,
) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"services": [
{
"metric": "function_invocations",
"label": "Function invocations",
"enabled": true,
"billable": true
}
],
"enabled_map": {
"function_invocations": true
}
}sovaria.billing_get_compute
Billing get compute.
await sovaria.billing_get_compute(
org_id: str,
*, period: str | None = None,
) -> dict[str, Any]Parameters
org_idstrrequiredperiodstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-10",
"total_hours": 432.0,
"fee_cents": 600,
"projects": [
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"compute_size": "micro",
"hours": 432.0,
"billable_hours": 432.0,
"fee_cents": 600
}
]
}sovaria.billing_get_fx
Billing get fx.
await sovaria.billing_get_fx() -> dict[str, Any]Returns
dict[str, Any]
{
"base": "USD",
"quote": "INR",
"rate": 84.12,
"fetched_at": "2026-10-18T06:00:00+00:00",
"source": "live",
"stale": false
}sovaria.billing_get_open_invoice
Billing get open invoice.
await sovaria.billing_get_open_invoice() -> dict[str, Any]Returns
dict[str, Any]
{
"invoice": {
"id": 311,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-09",
"plan": "pro",
"plan_fee_cents": 2900,
"compute_fee_cents": 1000,
"overage_fee_cents": 412,
"credit_cents": 1000,
"total_cents": 3312,
"line_items": [
{
"kind": "plan_fee",
"description": "Pro plan (monthly)",
"amount_cents": 2900
},
{
"kind": "compute",
"description": "Compute micro × 720 h",
"amount_cents": 1000
},
{
"kind": "compute_credit",
"description": "Included compute credit (Pro)",
"amount_cents": -1000
},
{
"kind": "overage",
"description": "Function invocations: 206,000 over",
"amount_cents": 412
}
],
"status": "issued",
"issued_at": "2026-10-01T00:05:00+00:00",
"created_at": "2026-10-01T00:05:00+00:00",
"stripe_invoice_id": null,
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51"
}
}sovaria.billing_get_org_overage_prefs
The org's overage switches — one setting for the whole org, whoever changes it.
await sovaria.billing_get_org_overage_prefs(
org_id: str,
) -> dict[str, Any]Parameters
org_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"services": [
{
"metric": "function_invocations",
"label": "Function invocations",
"enabled": true,
"billable": true
},
{
"metric": "email_sends",
"label": "Emails (Sovaria sender)",
"enabled": false,
"billable": true
}
],
"enabled_map": {
"function_invocations": true,
"email_sends": false
},
"bound": true
}sovaria.billing_get_overage
Billing get overage.
await sovaria.billing_get_overage(org_id: str) -> dict[str, Any]Parameters
org_idstrrequired
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"plan": "pro",
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"period_start": "2026-10-01T00:00:00+00:00",
"period_end": "2026-11-01T00:00:00+00:00",
"projected_overage_cents": 412,
"accrued_cents": 412,
"lines": [
{
"kind": "overage",
"metric": "function_invocations",
"label": "Function invocations",
"over_units": 206000,
"amount_cents": 412
}
],
"source": "accrual"
}sovaria.billing_get_plan
Fetch a billing plan by name.
await sovaria.billing_get_plan(name: str) -> dict[str, Any]Parameters
namestrrequired
Returns
dict[str, Any]
{
"name": "pro",
"display_name": "Pro",
"monthly_price_cents": 2900,
"annual_price_cents": 27840,
"description": "Production projects with light scale.",
"limits": {
"max_projects": 3,
"max_team_members": 5,
"max_organizations": 3,
"max_storage_gb": 50,
"max_function_invocations_per_month": 2000000,
"…": "…"
},
"features": {
"cli_access": true,
"sdk_access": true,
"custom_domains": true,
"priority_support": false,
"image_transforms": true,
"…": "…"
},
"entitlements": {
"org.projects": 3,
"db.read_replicas": 0,
"fn.invocations_month": 2000000,
"…": "…"
},
"soft_limits": [
"fn.invocations_month",
"storage.bytes",
"…"
]
}sovaria.billing_get_provider
Billing get provider.
await sovaria.billing_get_provider() -> dict[str, Any]Returns
dict[str, Any]
{
"provider": "razorpay",
"configured": true,
"providers": {
"stripe": false,
"razorpay": true
},
"razorpay_key_id": "rzp_live_…",
"checkout_mode": "razorpay_standard"
}sovaria.billing_get_subscription
Fetch the active subscription for an organisation.
await sovaria.billing_get_subscription(org_id: str) -> dict[str, Any]Parameters
org_idstrrequired
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"plan": "pro",
"billing_cycle": "monthly",
"status": "active",
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"autopay_enabled": true,
"renewal_status": "active",
"current_period_end": "2026-11-01T00:00:00+00:00",
"plan_detail": {
"name": "pro",
"display_name": "Pro",
"monthly_price_cents": 2900,
"annual_price_cents": 27840,
"description": "Production projects with light scale.",
"limits": {
"max_projects": 3,
"max_team_members": 5,
"max_organizations": 3,
"max_storage_gb": 50,
"max_function_invocations_per_month": 2000000,
"…": "…"
},
"features": {
"cli_access": true,
"sdk_access": true,
"custom_domains": true,
"priority_support": false,
"image_transforms": true,
"…": "…"
},
"entitlements": {
"org.projects": 3,
"db.read_replicas": 0,
"fn.invocations_month": 2000000,
"…": "…"
},
"soft_limits": [
"fn.invocations_month",
"storage.bytes",
"…"
]
}
}sovaria.billing_get_usage
Fetch usage counters for an organisation.
await sovaria.billing_get_usage(
org_id: str,
*, period: str | None = None,
) -> dict[str, Any]Parameters
org_idstrrequiredperiodstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-10",
"plan": "pro",
"totals": {
"api_calls": 812345,
"function_invocations": 2206000,
"realtime_messages": 41200,
"egress_bytes": 3221225472,
"storage_bytes": 1073741824,
"mau": 1840
},
"limits": {
"api_calls": 10000000,
"function_invocations": 2000000,
"realtime_messages": 5000000,
"egress_bytes": 268435456000,
"storage_bytes": 53687091200,
"mau": 100000
},
"metrics": {
"…": "same as totals"
},
"gauges": {
"mau": 1840
},
"compute": {
"total_hours": 432.0,
"fee_cents": 600,
"projects": [
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"compute_size": "micro",
"hours": 432.0,
"billable_hours": 432.0,
"fee_cents": 600
}
]
}
}sovaria.billing_get_usage_history
Fetch historical usage for an organisation.
await sovaria.billing_get_usage_history(
org_id: str,
*, months: int = 6,
) -> AnyParameters
org_idstrrequiredmonthsintoptionaldefault6
Returns
Any
[
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-09",
"totals": {
"api_calls": 1904211,
"function_invocations": 1302000
},
"metrics": {
"…": "same as totals"
}
}
]sovaria.billing_list_account_addons
Add-ons on the billing account (price, paid units, what renews, paid-through) and the autopay mandate.
await sovaria.billing_list_account_addons(
account_id: str,
) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"current_period_end": "2026-11-09T00:00:00+00:00",
"billing_cycle": "monthly",
"addons": [
{
"id": "extra_project",
"label": "Extra project",
"scope": "org",
"price_cents": 1000,
"max_quantity": 10,
"available": true,
"included_in_plan": false,
"quantity": 2,
"paid_quantity": 2,
"renew_quantity": 1,
"comp_quantity": 0,
"paid_through": "2026-11-09T00:00:00+00:00",
"prorated_unit_cents": 650,
"enabled": true
},
{
"id": "custom_domains",
"label": "Custom domain",
"scope": "project",
"price_cents": 1000,
"max_quantity": 10,
"available": true,
"included_in_plan": false,
"quantity": 1,
"paid_quantity": 1,
"renew_quantity": 1,
"comp_quantity": 0,
"paid_through": "2026-11-09T00:00:00+00:00",
"prorated_unit_cents": 650,
"enabled": true
},
{
"id": "extra_environment",
"label": "Extra environment per project",
"scope": "project",
"price_cents": 500,
"max_quantity": 10,
"available": true,
"included_in_plan": false,
"quantity": 0,
"paid_quantity": 0,
"renew_quantity": 0,
"comp_quantity": 0,
"paid_through": null,
"prorated_unit_cents": 325,
"enabled": false
}
],
"autopay": {
"mandate": "active",
"method": "card",
"label": "Visa •••• 4242",
"max_amount_paise": 1500000,
"set_at": "2026-10-20T09:12:00+00:00",
"renews_automatically": true,
"last_charge": null
}
}sovaria.billing_list_invoices
Billing list invoices.
await sovaria.billing_list_invoices(org_id: str) -> list[dict[str, Any]]Parameters
org_idstrrequired
Returns
list[dict[str, Any]]
[
{
"id": 311,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-09",
"plan": "pro",
"plan_fee_cents": 2900,
"compute_fee_cents": 1000,
"overage_fee_cents": 412,
"credit_cents": 1000,
"total_cents": 3312,
"line_items": [
{
"kind": "plan_fee",
"description": "Pro plan (monthly)",
"amount_cents": 2900
},
{
"kind": "compute",
"description": "Compute micro × 720 h",
"amount_cents": 1000
},
{
"kind": "compute_credit",
"description": "Included compute credit (Pro)",
"amount_cents": -1000
},
{
"kind": "overage",
"description": "Function invocations: 206,000 over",
"amount_cents": 412
}
],
"status": "issued",
"issued_at": "2026-10-01T00:05:00+00:00",
"created_at": "2026-10-01T00:05:00+00:00",
"stripe_invoice_id": null,
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51"
}
]sovaria.billing_list_plans
List public billing plans.
await sovaria.billing_list_plans() -> AnyReturns
Any
[
{
"name": "free",
"display_name": "Free",
"monthly_price_cents": 0,
"annual_price_cents": 0,
"description": "Production projects with light scale.",
"limits": {
"max_projects": 3,
"max_team_members": 5,
"max_organizations": 3,
"max_storage_gb": 50,
"max_function_invocations_per_month": 2000000,
"…": "…"
},
"features": {
"cli_access": true,
"sdk_access": true,
"custom_domains": true,
"priority_support": false,
"image_transforms": true,
"…": "…"
},
"entitlements": {
"org.projects": 3,
"db.read_replicas": 0,
"fn.invocations_month": 2000000,
"…": "…"
},
"soft_limits": [
"fn.invocations_month",
"storage.bytes",
"…"
]
},
{
"name": "pro",
"display_name": "Pro",
"monthly_price_cents": 2900,
"annual_price_cents": 27840,
"description": "Production projects with light scale.",
"limits": {
"max_projects": 3,
"max_team_members": 5,
"max_organizations": 3,
"max_storage_gb": 50,
"max_function_invocations_per_month": 2000000,
"…": "…"
},
"features": {
"cli_access": true,
"sdk_access": true,
"custom_domains": true,
"priority_support": false,
"image_transforms": true,
"…": "…"
},
"entitlements": {
"org.projects": 3,
"db.read_replicas": 0,
"fn.invocations_month": 2000000,
"…": "…"
},
"soft_limits": [
"fn.invocations_month",
"storage.bytes",
"…"
]
}
]sovaria.billing_list_subscriptions
List subscriptions visible to the authenticated caller.
await sovaria.billing_list_subscriptions() -> AnyReturns
Any
sovaria.billing_pay_invoice
Billing pay invoice.
await sovaria.billing_pay_invoice(
org_id: str,
period: str,
) -> dict[str, Any]Parameters
org_idstrrequiredperiodstrrequired
Returns
dict[str, Any]
{
"mode": "razorpay_standard",
"provider": "razorpay",
"order_id": "order_…",
"amount": 278600,
"currency": "INR",
"key_id": "rzp_live_…",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-10",
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"total_cents": 3312
}sovaria.billing_razorpay_create_order
Billing razorpay create order.
await sovaria.billing_razorpay_create_order(
body: dict[str, Any],
*, org_id: str | None = None,
) -> dict[str, Any]Parameters
bodydict[str, Any]requiredorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"order_id": "order_PbX…",
"amount": 195100,
"currency": "INR",
"key_id": "rzp_live_…",
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"plan": "pro",
"billing_cycle": "monthly"
}sovaria.billing_razorpay_verify_payment
Billing razorpay verify payment.
await sovaria.billing_razorpay_verify_payment(
body: dict[str, Any],
*, org_id: str | None = None,
) -> dict[str, Any]Parameters
bodydict[str, Any]requiredorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"verified": true,
"kind": "checkout",
"duplicate": false,
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"billing_cycle": "monthly",
"payment_id": "pay_PbY…",
"order_id": "order_PbX…"
}sovaria.billing_remove_autopay_mandate
Remove the saved mandate; renewals become invoices to pay by hand.
await sovaria.billing_remove_autopay_mandate(
account_id: str,
) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"autopay": {
"mandate": "removed",
"method": null,
"label": null,
"max_amount_paise": null,
"set_at": null,
"renews_automatically": false,
"last_charge": null
}
}sovaria.billing_resume_account
Billing resume account.
await sovaria.billing_resume_account(account_id: str) -> dict[str, Any]Parameters
account_idstrrequired
Returns
dict[str, Any]
{
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"billing_cycle": "monthly",
"status": "active",
"renewal_status": "active",
"autopay_enabled": true,
"grace_until": null,
"current_period_start": "2026-10-01T00:00:00+00:00",
"current_period_end": "2026-11-01T00:00:00+00:00",
"payment_provider": "razorpay",
"provider_customer_id": "cust_…",
"metadata": {},
"created_at": "2026-09-01T10:00:00+00:00"
}sovaria.billing_set_account_overage_prefs
Billing set account overage prefs.
await sovaria.billing_set_account_overage_prefs(
account_id: str,
services: dict[str, bool],
) -> dict[str, Any]Parameters
account_idstrrequiredservicesdict[str, bool]required
Returns
dict[str, Any]
sovaria.billing_set_addon_renewal
How many units renew at the period end (0 cancels); paid units keep working until then.
await sovaria.billing_set_addon_renewal(
account_id: str,
addon_id: str,
renew_quantity: int,
) -> dict[str, Any]Parameters
account_idstrrequiredaddon_idstrrequiredrenew_quantityintrequired
Returns
dict[str, Any]
sovaria.billing_set_auto_recharge
Auto-recharge from the autopay mandate (24 h pre-debit notice; at most Rs 15,000 a debit).
await sovaria.billing_set_auto_recharge(
*, enabled: bool,
threshold_cents: int,
amount_cents: int,
max_per_month: int = 4,
max_month_cents: int | None = None,
org_id: str | None = None,
) -> dict[str, Any]Parameters
enabledboolrequiredthreshold_centsintrequiredamount_centsintrequiredmax_per_monthintoptionaldefault4max_month_centsint | NoneoptionaldefaultNoneorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_set_org_overage_prefs
Change the org's overage switches (org owners and admins).
await sovaria.billing_set_org_overage_prefs(
org_id: str,
services: dict[str, bool],
) -> dict[str, Any]Parameters
org_idstrrequiredservicesdict[str, bool]required
Returns
dict[str, Any]
sovaria.billing_set_spend_cap
Billing set spend cap.
await sovaria.billing_set_spend_cap(
*, mode: str,
cap_cents: int | None = None,
alert_thresholds: list[int] | None = None,
org_id: str | None = None,
) -> dict[str, Any]Parameters
modestrrequiredcap_centsint | NoneoptionaldefaultNonealert_thresholdslist[int] | NoneoptionaldefaultNoneorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"bound": true,
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"plan_name": "Pro",
"applies": true,
"period_start": "2026-10-01T00:00:00+00:00",
"period_end": "2026-11-01T00:00:00+00:00",
"spent_cents": 412,
"cap_cents": 10000,
"cap_source": "owner",
"default_cap_cents": 8700,
"percent": 4.1,
"capped": false,
"mode": "custom",
"owner_cap_cents": 10000,
"alert_thresholds": [
50,
90,
100
],
"alerts_sent": [],
"staff_override": null,
"updated_by": null,
"updated_at": null,
"lines": [
{
"kind": "overage",
"metric": "function_invocations",
"label": "Function invocations",
"over_units": 206000,
"amount_cents": 412
}
]
}sovaria.billing_set_subscription
Create or update an organisation subscription.
await sovaria.billing_set_subscription(
org_id: str,
*, plan: str,
billing_cycle: str = 'monthly',
stripe_customer_id: str | None = None,
metadata: dict[str, Any] | None = None,
) -> dict[str, Any]Parameters
org_idstrrequiredplanstrrequiredbilling_cyclestroptionaldefault'monthly'stripe_customer_idstr | NoneoptionaldefaultNonemetadatadict[str, Any] | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_spend_cap
The monthly spend cap and period-to-date overage.
await sovaria.billing_spend_cap(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"bound": true,
"account_id": "6e19c0a2-3f5b-4a8e-9b1d-0c7f2e8a4d51",
"plan": "pro",
"plan_name": "Pro",
"applies": true,
"period_start": "2026-10-01T00:00:00+00:00",
"period_end": "2026-11-01T00:00:00+00:00",
"spent_cents": 412,
"cap_cents": 8700,
"cap_source": "plan_default",
"default_cap_cents": 8700,
"percent": 4.7,
"capped": false,
"mode": "plan_default",
"owner_cap_cents": null,
"alert_thresholds": [
50,
80,
100
],
"alerts_sent": [],
"staff_override": null,
"updated_by": null,
"updated_at": null,
"lines": [
{
"kind": "overage",
"metric": "function_invocations",
"label": "Function invocations",
"over_units": 206000,
"amount_cents": 412
}
]
}sovaria.billing_usage
Usage counters for a billing month ("YYYY-MM"; the current one when left out).
await sovaria.billing_usage(
*, period: str | None = None,
org_id: str | None = None,
) -> dict[str, Any]Parameters
periodstr | NoneoptionaldefaultNoneorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
"period": "2026-10",
"plan": "pro",
"totals": {
"api_calls": 812345,
"function_invocations": 2206000,
"realtime_messages": 41200,
"egress_bytes": 3221225472,
"storage_bytes": 1073741824,
"mau": 1840
},
"limits": {
"api_calls": 10000000,
"function_invocations": 2000000,
"realtime_messages": 5000000,
"egress_bytes": 268435456000,
"storage_bytes": 53687091200,
"mau": 100000
},
"metrics": {
"…": "same as totals"
},
"gauges": {
"mau": 1840
},
"compute": {
"total_hours": 432.0,
"fee_cents": 600,
"projects": [
{
"project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
"compute_size": "micro",
"hours": 432.0,
"billable_hours": 432.0,
"fee_cents": 600
}
]
}
}sovaria.billing_usage_forecast
Period-to-date pay-as-you-go spend and the projection to the period's end.
await sovaria.billing_usage_forecast(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_wallet
The wallet: cash and promotional credit (USD cents; rupees for India), runway, the zero state, auto-recharge.
await sovaria.billing_wallet(
org_id: str | None = None,
) -> dict[str, Any]Parameters
org_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.billing_wallet_checkout
A wallet top-up order to open in Razorpay Checkout (never takes a card itself).
await sovaria.billing_wallet_checkout(
*, usd_cents: int | None = None,
inr_paise: int | None = None,
org_id: str | None = None,
) -> dict[str, Any]Parameters
usd_centsint | NoneoptionaldefaultNoneinr_paiseint | NoneoptionaldefaultNoneorg_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
sovaria.gateway_health
Gateway health.
await sovaria.gateway_health() -> dict[str, Any]Returns
dict[str, Any]
sovaria.get_engines_health
Return aggregate gateway health for downstream engines.
await sovaria.get_engines_health() -> list[dict[str, Any]]Returns
list[dict[str, Any]]
sovaria.get_error_trace
Get error trace.
await sovaria.get_error_trace(trace_id: str) -> dict[str, Any]Parameters
trace_idstrrequired
Returns
dict[str, Any]
sovaria.list_error_traces
List error traces.
await sovaria.list_error_traces(
*, service: str | None = None,
project_id: str | None = None,
error_class: str | None = None,
severity: str | None = None,
resolved: bool | None = None,
since: str | None = None,
limit: int | None = None,
) -> list[dict[str, Any]]Parameters
servicestr | NoneoptionaldefaultNoneproject_idstr | NoneoptionaldefaultNoneerror_classstr | NoneoptionaldefaultNoneseveritystr | NoneoptionaldefaultNoneresolvedbool | NoneoptionaldefaultNonesincestr | NoneoptionaldefaultNonelimitint | NoneoptionaldefaultNone
Returns
list[dict[str, Any]]
sovaria.resolve_error_trace
Resolve error trace.
await sovaria.resolve_error_trace(
trace_id: str,
resolved: bool,
) -> dict[str, Any]Parameters
trace_idstrrequiredresolvedboolrequired
Returns
dict[str, Any]