Docs

JavaScript: Billing and usage

Read plans, subscriptions, usage, compute and invoices, and check platform health with @sovaria/sdk.

Updated Nov 11, 2026

Read your organization's plan, usage and invoices from code — for dashboards, alerts or internal tools. Payment methods (checkout, payInvoice, razorpay*) are used by the console's checkout.

const usage = await sovaria.billing.getUsage(orgId)
const plan = await sovaria.billing.getSubscription(orgId)

#sovaria.billing

sovaria.billing.listPlans

List plans.

sovaria.billing.listPlans(): Promise<JsonValue>

Returns

Promise<JsonValue>

[
  {
    "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.getPlan

Get plan.

sovaria.billing.getPlan(name: string): Promise<JsonObject>

Parameters

namestringrequired

Returns

Promise<JsonObject>

{
  "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.getSubscription

Get subscription.

sovaria.billing.getSubscription(orgId: string): Promise<JsonObject>

Parameters

orgIdstringrequired

Returns

Promise<JsonObject>

{
  "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.setSubscription

Set subscription.

sovaria.billing.setSubscription(
  orgId: string,
  payload: { plan: string billingCycle?: 'monthly' | 'annual' stripeCustomerId?: string metadata?: JsonObject },
): Promise<JsonObject>

Parameters

orgIdstringrequired
payload{ plan: string billingCycle?: 'monthly' | 'annual' stripeCustomerId?: string metadata?: JsonObject }required

Returns

Promise<JsonObject>

sovaria.billing.cancelSubscription

Cancel subscription.

sovaria.billing.cancelSubscription(
  orgId: string,
  options?: { immediate?: boolean } = {},
): Promise<JsonObject>

Parameters

orgIdstringrequired
options{ immediate?: boolean }optionaldefault {}

Returns

Promise<JsonObject>

sovaria.billing.listSubscriptions

List subscriptions.

sovaria.billing.listSubscriptions(): Promise<JsonValue>

Returns

Promise<JsonValue>

HTTP
GET /api/v1/subscriptions

sovaria.billing.getUsage

Get usage.

sovaria.billing.getUsage(
  orgId: string,
  period?: string,
): Promise<JsonObject>

Parameters

orgIdstringrequired
Organization id.
periodstringoptional
YYYY-MM; default the current month.

Returns

Promise<JsonObject>

{
  "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,
    "fee_cents": 600,
    "projects": [
      {
        "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
        "compute_size": "micro",
        "hours": 432,
        "billable_hours": 432,
        "fee_cents": 600
      }
    ]
  }
}

sovaria.billing.getUsageHistory

Get usage history.

sovaria.billing.getUsageHistory(
  orgId: string,
  months?: number = 6,
): Promise<JsonValue>

Parameters

orgIdstringrequired
monthsnumberoptionaldefault 6
How many months back.

Returns

Promise<JsonValue>

[
  {
    "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
    "period": "2026-09",
    "totals": {
      "api_calls": 1904211,
      "function_invocations": 1302000
    },
    "metrics": {
      "…": "same as totals"
    }
  }
]

sovaria.billing.listInvoices

List invoices.

sovaria.billing.listInvoices(orgId: string): Promise<JsonValue>

Parameters

orgIdstringrequired

Returns

Promise<JsonValue>

[
  {
    "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.buildInvoice

Build invoice.

sovaria.billing.buildInvoice(
  orgId: string,
  period?: string,
): Promise<JsonObject>

Parameters

orgIdstringrequired
periodstringoptional

Returns

Promise<JsonObject>

{
  "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.getCompute

Get compute.

sovaria.billing.getCompute(
  orgId: string,
  period?: string,
): Promise<JsonObject>

Parameters

orgIdstringrequired
periodstringoptional

Returns

Promise<JsonObject>

{
  "org_id": "b2f4a1c8-7d3e-4f0a-9c6b-5e8d2a1f3c90",
  "period": "2026-10",
  "total_hours": 432,
  "fee_cents": 600,
  "projects": [
    {
      "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
      "compute_size": "micro",
      "hours": 432,
      "billable_hours": 432,
      "fee_cents": 600
    }
  ]
}

sovaria.billing.checkout

Checkout.

sovaria.billing.checkout(body: JsonObject): Promise<JsonObject>

Parameters

bodyJsonObjectrequired

Returns

Promise<JsonObject>

{
  "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.getProvider

Get provider.

sovaria.billing.getProvider(): Promise<JsonObject>

Returns

Promise<JsonObject>

{
  "provider": "razorpay",
  "configured": true,
  "providers": {
    "stripe": false,
    "razorpay": true
  },
  "razorpay_key_id": "rzp_live_…",
  "checkout_mode": "razorpay_standard"
}

sovaria.billing.getFx

Get fx.

sovaria.billing.getFx(): Promise<JsonObject>

Returns

Promise<JsonObject>

{
  "base": "USD",
  "quote": "INR",
  "rate": 84.12,
  "fetched_at": "2026-10-18T06:00:00+00:00",
  "source": "live",
  "stale": false
}

sovaria.billing.getOverage

Get overage.

sovaria.billing.getOverage(orgId: string): Promise<JsonObject>

Parameters

orgIdstringrequired

Returns

Promise<JsonObject>

{
  "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.getOpenInvoice

Get open invoice.

sovaria.billing.getOpenInvoice(): Promise<JsonObject>

Returns

Promise<JsonObject>

{
  "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.payInvoice

Pay invoice.

sovaria.billing.payInvoice(
  orgId: string,
  period: string,
  body?: JsonObject = {},
): Promise<JsonObject>

Parameters

orgIdstringrequired
periodstringrequired
bodyJsonObjectoptionaldefault {}

Returns

Promise<JsonObject>

{
  "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.razorpayCreateOrder

Razorpay create order.

sovaria.billing.razorpayCreateOrder(
  body: JsonObject,
): Promise<JsonObject>

Parameters

bodyJsonObjectrequired

Returns

Promise<JsonObject>

{
  "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.razorpayVerifyPayment

Razorpay verify payment.

sovaria.billing.razorpayVerifyPayment(
  body: JsonObject,
): Promise<JsonObject>

Parameters

bodyJsonObjectrequired

Returns

Promise<JsonObject>

{
  "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.getAccount

Get account.

sovaria.billing.getAccount(accountId: string): Promise<JsonObject>

Parameters

accountIdstringrequired

Returns

Promise<JsonObject>

{
  "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.cancelAccount

Cancel account.

sovaria.billing.cancelAccount(accountId: string): Promise<JsonObject>

Parameters

accountIdstringrequired

Returns

Promise<JsonObject>

{
  "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.resumeAccount

Resume account.

sovaria.billing.resumeAccount(accountId: string): Promise<JsonObject>

Parameters

accountIdstringrequired

Returns

Promise<JsonObject>

{
  "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.listAddons

Add-ons on the billing account (price, paid units, what renews, paid-through) and the autopay mandate.

sovaria.billing.listAddons(accountId: string): Promise<JsonObject>

Parameters

accountIdstringrequired

Returns

Promise<JsonObject>

{
  "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.addonCheckout

Start paying for quantity more units of an add-on (extra_project, custom_domains, extra_environment), prorated to the period end.

sovaria.billing.addonCheckout(
  accountId: string,
  addonId: string,
  quantity?: number = 1,
  projectId?: string,
): Promise<JsonObject>

Returns a Razorpay order to open in Checkout; the units count once the payment is verified (razorpayVerifyPayment). Uses the scoped org.

Parameters

accountIdstringrequired
addonIdstringrequired
quantitynumberoptionaldefault 1
projectIdstringoptional

Returns

Promise<JsonObject>

{
  "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.setAddonRenewal

How many units renew at the period end (0 cancels).

sovaria.billing.setAddonRenewal(
  accountId: string,
  addonId: string,
  renewQuantity: number,
): Promise<JsonObject>

Units already paid for keep working until then.

Parameters

accountIdstringrequired
addonIdstringrequired
renewQuantitynumberrequired

Returns

Promise<JsonObject>

sovaria.billing.autopaySetup

₹1 (refunded) authorisation that saves a card or UPI mandate; open it in Checkout with recurring: '1'.

sovaria.billing.autopaySetup(
  accountId: string,
  body?: { customer_email?: string; name?: string } = {},
): Promise<JsonObject>

Parameters

accountIdstringrequired
body{ customer_email?: string; name?: string }optionaldefault {}

Returns

Promise<JsonObject>

{
  "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.removeAutopayMandate

Remove the saved mandate; renewals become invoices to pay by hand.

sovaria.billing.removeAutopayMandate(
  accountId: string,
): Promise<JsonObject>

Parameters

accountIdstringrequired

Returns

Promise<JsonObject>

{
  "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.wallet

The wallet: cash and promotional credit (USD cents; rupees for India), runway, the zero state, auto-recharge.

sovaria.billing.wallet(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
GET {…}/wallet

sovaria.billing.walletCheckout

A wallet top-up order (Razorpay Checkout); { inr_paise } in India or { usd_cents }.

sovaria.billing.walletCheckout(
  amount: { usd_cents?: number; inr_paise?: number },
  orgId?: string,
): Promise<JsonObject>

Never takes a card itself.

Parameters

amount{ usd_cents?: number; inr_paise?: number }required
orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
POST {…}/wallet/checkout

sovaria.billing.credits

Sovariq credits this month and today (credits only; one credit is $0.01 of AI use).

sovaria.billing.credits(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

sovaria.billing.creditPacks

Credit packs for sale, the Sovariq wallet cap and the org's packs.

sovaria.billing.creditPacks(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
GET {…}/ai-credits/packs

sovaria.billing.buyCreditPackFromWallet

Buy a credit pack from the wallet (promo first, then cash).

sovaria.billing.buyCreditPackFromWallet(
  packId: string,
  orgId?: string,
): Promise<JsonObject>

Parameters

packIdstringrequired
orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
POST {…}/ai-credits/packs/from-balance

sovaria.billing.spendCap

The monthly spend cap and period-to-date overage.

sovaria.billing.spendCap(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
GET {…}/spend-cap

sovaria.billing.setSpendCap

Set spend cap.

sovaria.billing.setSpendCap(
  cap: { mode: 'plan_default' | 'custom' | 'none'; cap_cents?: number | null; alert_thresholds?: number[] },
  orgId?: string,
): Promise<JsonObject>

Parameters

cap{ mode: 'plan_default' | 'custom' | 'none'; cap_cents?: number | null; alert_thresholds?: number[] }required
orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
PUT {…}/spend-cap

sovaria.billing.autoRecharge

Auto recharge.

sovaria.billing.autoRecharge(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
GET {…}/auto-recharge

sovaria.billing.setAutoRecharge

Set auto recharge.

sovaria.billing.setAutoRecharge(
  settings: { enabled: boolean; threshold_cents: number; amount_cents: number; max_per_month?: number; max_month_cents?: number | null },
  orgId?: string,
): Promise<JsonObject>

Parameters

settings{ enabled: boolean; threshold_cents: number; amount_cents: number; max_per_month?: number; max_month_cents?: number | null }required
orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
PUT {…}/auto-recharge

sovaria.billing.usage

Usage counters for a billing month (period "YYYY-MM"; the current one when left out).

sovaria.billing.usage(
  opts?: { period?: string; orgId?: string } = {},
): Promise<JsonObject>

Parameters

opts{ period?: string; orgId?: string }optionaldefault {}

Returns

Promise<JsonObject>

{
  "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,
    "fee_cents": 600,
    "projects": [
      {
        "project_id": "f0c3e9a2-1b4d-4e7f-8a6c-2d9b5e3f1a07",
        "compute_size": "micro",
        "hours": 432,
        "billable_hours": 432,
        "fee_cents": 600
      }
    ]
  }
}

sovaria.billing.usageForecast

Period-to-date pay-as-you-go spend and the projection to the period's end.

sovaria.billing.usageForecast(orgId?: string): Promise<JsonObject>

Parameters

orgIdstringoptional

Returns

Promise<JsonObject>

HTTP
GET {…}/usage/forecast

#Platform health

sovaria.system.enginesHealth

Engines health.

sovaria.system.enginesHealth(): Promise<JsonValue>

Returns

Promise<JsonValue>

HTTP
GET /api/v1/system/engines/health