MaveraMavera Docs
Account & billing
Checking…
Use or share this pageSend the page itself, print it, or open its complete context in your AI workspace.

Plans, credits & usage

How credits meter model work.

1 min readDocs build Updated Jul 26, 2026

How credits work

  • Each request that calls a model meters input + output tokensUSD (from the live price table) → credits.
  • Default conversion: 1 credit = $0.01 (set CREDITS_PER_USD to change). Credits always round up, minimum 0.
  • Pure-code tools cost 0 credits — e.g. mine_insights, list_*, organize tools. You only pay for model work.
  • Each response carries X-Credits-Used and X-Tokens-Total headers; the body's meta.estimateCredits mirrors it.

Plans

PlanIncluded credits / period
FREE1,000
STARTER25,000
PRO250,000
ENTERPRISE5,000,000

Allowances reset each 30-day period; purchased top-ups roll over. Override per-plan amounts with PLAN_CREDITS_<PLAN> env vars when self-hosting.

Check your balance & usage

GET /api/v1/billing            -H "x-api-key: $MAVERA_API_KEY"
# → data.balance: { plan, used, allowed, remaining, ok }

GET /api/v1/usage?days=30      -H "x-api-key: $MAVERA_API_KEY"
# → data: { totals:{ inputTokens, outputTokens, costUsd, credits, modelCalls },
#           byTool:{ chat_with_audience:{credits,calls,costUsd}, }, balance }

When you run out

Calls that would incur model cost return 402 PAYMENT_REQUIRED once the period allowance + top-ups are exhausted. Discovery and read endpoints keep working.

Response
{ "ok": false, "error": { "code": "PAYMENT_REQUIRED", "message": "out of credits (250000/250000 used this period)" } }

Admin: change plan / add credits

PATCH /api/v1/billing
  -H "x-admin-token: $MAVERA_ADMIN_TOKEN"   # or an OWNER/ADMIN API key
  -d '{ "workspaceId": "ws_…", "plan": "PRO" }'           # set plan
  -d '{ "workspaceId": "ws_…", "addCredits": 50000 }'     # top up (rolls over)

Stripe wiring: CreditBalance.stripeCustomerId + the @mavera/billing provider seam are in place for metered/subscription billing. Connect your Stripe keys and map plan changes to subscription webhooks; the credit ledger is the source of truth either way.

On this page