Credits are the unit of spend — every enrichment debits your organization’s balance. This API reads the balance and plan, purchases credits (hosted checkout, inline payment, or one-click top-up), keeps a floor under the balance with auto-recharge, and reports payment, transaction, and daily-usage history.
How billing works
GET /v2/billing/credits./checkout), inline Stripe Elements (/payment-intent), or one-click with a saved card (/quick-topup). Credits are awarded by the Stripe webhook once the payment succeeds.All endpoints live under /v2/billing and return the snake_case { data, actions, meta } envelope; errors are RFC 9457 problem+json.
What you have and what your tier allows
Hosted checkout for the full packages; payment-intent or quick-topup for the inline top-up ladder
Payments are money; transactions are credits (signed); daily usage breaks debits down by day and job
Keep a floor under the balance — top up automatically from a saved card when it drops below your threshold
Two kinds: credit_grant adds credits directly (validate → redeem); stripe_discount reduces a purchase (validate → pass promo_code to /payment-intent or /quick-topup)
The two calls most integrations need
# Current balance
curl -s https://api.abm.dev/api/v2/billing/credits \
-H "x-api-key: YOUR_API_KEY" | jq .data.balance
# Buy the Starter pack via hosted Stripe Checkout
curl -s https://api.abm.dev/api/v2/billing/checkout \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"package_id": "starter_100",
"currency": "USD",
"success_url": "https://your-app.com/billing/success",
"cancel_url": "https://your-app.com/billing"
}' | jq .data.checkout_urlSee also: Enrichment (what spends the credits), Webhooks (get notified when jobs complete instead of polling).