Skip to main content
The billing summary endpoint gives your backend a single snapshot of everything relevant to the current billing cycle: which plan the app is on, the active subscription period, cumulative usage totals, a day-by-day fee timeline, overage charges, and owner/retail USD breakdowns. All monetary values are wei as decimal strings to preserve precision across the full BigInt range. USD micro values (integer strings, 1000000 = $1.00) are computed once at signing time using the ETH/USD oracle and stored immutably.

Authentication

Two auth modes are accepted. The tenant boundary is enforced identically in both: the clientId in the URL path must match the authenticated principal’s app.

Provider dashboard session

A logged-in session whose user is the app’s owner, a platform admin, or a providerAdmins team member may call this endpoint without Basic auth.
Requests that satisfy neither auth mode, or whose authenticated principal does not match the path clientId, receive 404 Not Found. The endpoint deliberately does not distinguish “unauthenticated” from “not found” to avoid leaking app existence.

Endpoint

Path parameters

No query parameters.

Response

200 OK

Response fields

All *Wei fields are decimal strings, not numbers. They can exceed Number.MAX_SAFE_INTEGER. Parse with BigInt(field) in JavaScript or an equivalent in your language. Use viem’s formatEther (or equivalent) for human-readable display.

Plan types and overage logic

For free plans, overageUnits and overageWei are always "0".

Starter plan

Every app has a Starter plan created automatically (isStarterDefault: true). It is separate from custom billing plans and from the Network Price discovery plan. Starter carries an includedUsdMicros allowance (default 5000000 = $5.00) and is automatically synced to OpenMeter. New end-users are auto-subscribed to the Starter plan when provisioned (via POST /users, signer token mint, or signed-ticket ingest) if they have no existing subscription. Providers can update the Starter allowance via:
This triggers an immediate OpenMeter plan sync. The response echoes the updated Starter plan. For per-user entitlement balances and manual top-ups, see Allowances.

Invoices

Tenant-scoped invoice list (OpenMeter DTO mapped):
Auth: provider dashboard session (read). Returns a list of invoices for the app’s OpenMeter subscriptions.

Merchant billing (Stripe Connect)

Stripe Connect is used for invoicing and end-user checkout, not for plan provisioning in OpenMeter.
All Stripe Connect operations require a provider dashboard session. M2M Basic auth is not accepted on these routes.

Period fallback

When the app has no active subscription, the billing period defaults to the current calendar month in UTC (midnight on the 1st to the last millisecond of the last day). This fallback applies whenever subscription is null in the response.

Example

Extract overage in wei with jq:
Display owner charge in USD (Node.js):

Error responses

Security boundaries

  • Tenant isolation: the authenticated M2M client’s appId must equal the path clientId. A valid credential for a different app returns 404.
  • Provider sessions must be the app owner, a platform admin, or a providerAdmins team member.
  • No secrets, signer material, or per-request payloads are returned.
  • Confidential client secrets must stay server-side. Do not call this endpoint from the browser with Basic auth.

Key design decisions

  1. Single-call snapshot. Plan, subscription, usage totals, timeline, overage, and USD breakdowns are assembled in one response so dashboard UIs can render a complete billing view without multiple round trips.
  2. Day-granularity timeline, not raw records. The timeline buckets fee and request data by calendar day (UTC), keeping the response size bounded. For raw per-pipeline/model data, use GET /api/v1/apps/{clientId}/usage?groupBy=pipeline_model (see Usage API).
  3. Calendar-month fallback when no subscription. Apps on the Starter plan or free-tier state still get a consistent period reference (the current calendar month).
  4. 404 for all auth and tenant-mismatch failures. Prevents enumeration of valid clientIds.
  5. USD micros stored at signing time. Historical USD accuracy depends on the oracle at signing time; do not recompute historical values from the current oracle rate.

Implementation tasks

  • Parse all *Wei fields with BigInt before any arithmetic. Do not cast to Number before comparing or summing.
  • Use networkFeeUsdMicros and ownerChargeUsdMicros for fiat-denominated cost reporting; totalFeeWei for wei-denominated analytics.
  • Use the timeline array to drive sparklines or bar charts — every calendar day in the period is always present, so you never need to fill gaps client-side.
  • When plan is null, surface a “No plan configured” state rather than treating it as an error.
  • For overage alerting, poll this endpoint on a schedule and compare cycle.overage.overageUnits against thresholds you define in your system.
  • For per-user attribution and pipeline/model breakdown, use the Usage API with groupBy=user or groupBy=pipeline_model.
  • To create or change plans, use Plans from a provider dashboard session (not M2M).
  • For per-user entitlement balances and allowance top-ups, see Allowances.