Skip to content
nexdoc.design Docs

Billing

Understand charge_usd, wallet balances, 402 errors, and how to add funds.

Every completed generative run appears on your wallet as a USD charge (charge_usd on the run). Failed runs are not charged.

Add funds and manage payment methods in the dashboard: app.nexdoc.design. Minimum top-up is $10.

Wallet summary

code
curl -sS "$NXD_API_URL/v1/credits" \
  -H "Authorization: Bearer $NXD_API_KEY" | jq
code
{
  "free_balance_usd": 5.0,
  "paid_balance_usd": 20.0,
  "balance_usd": 25.0,
  "past_due": false,
  "has_payment_method": true
}
FieldMeaning
balance_usdTotal spendable (free + paid)
free_balance_usdPromotional / grant balance
paid_balance_usdPurchased balance
past_dueAccount blocked until topped up

Run charges

code
curl -sS "$NXD_API_URL/v1/jobs/$JOB/runs/$RUN_ID" \
  -H "Authorization: Bearer $NXD_API_KEY" | jq '{status, charge_usd}'

Ledger:

code
curl -sS "$NXD_API_URL/v1/credits/ledger" \
  -H "Authorization: Bearer $NXD_API_KEY" | jq

Starting a run — 402

If the wallet cannot cover a run (or past_due is true), POST …/runs returns 402:

code
{ "detail": "insufficient credits" }

or

code
{ "detail": "account past due — add credits to continue" }

Send the user to app.nexdoc.design. Do not retry in a loop.

Optional: POST /v1/credits/checkout with { "amount_usd": 20 } returns a Stripe Checkout URL (whole dollars, minimum $10) if they asked for a programmatic top-up. GET /v1/billing/portal returns the Stripe customer portal URL.