Skip to main content

How Credits Work

ActumX uses a credit-based billing system:
  • Credits are stored in cents (USD)
  • Top up your balance to use paid endpoints
  • Credits are deducted when you settle x402 payments
  • View your balance and transaction history in real-time
In the demo version, the payment system is simulated. Real payment processors (Stripe, etc.) would be integrated for production.

Topping Up Credits

1

Make a Top-Up Request

Add credits to your account by making a POST request:
Response:
2

Verify Your Balance

After topping up, your new balance is returned immediately. The system automatically:
  1. Creates a payment intent with status settled
  2. Adds a credit entry to your ledger
  3. Calculates your new total balance
From api/src/modules/billing/service.ts:68-86:

Amount Limits

Top-up amounts must be between 1.00and1.00 and 1,000.00:
  • Minimum: 100 cents ($1.00)
  • Maximum: 100,000 cents ($1,000.00)
Requests outside this range will return a 400 error:

Viewing Your Balance

Get a complete billing summary for your account:
Response:

Response Fields

number
Your current account balance in cents (USD)
number
Total amount you’ve added to your account
number
Total amount spent on API requests
number
Number of non-revoked API keys
number
Total count of x402 payment transactions

Payment History

View your complete payment history:
Response:
The endpoint returns the 50 most recent payment intents, ordered by creation date (newest first).

Understanding Credit Consumption

Credits are consumed when you:
  1. Make requests to x402 paid endpoints
  2. Settle payment challenges
  3. Complete transactions

Example Cost Structure

Quote Endpoint

Cost: 25 cents per requestEndpoint: GET /v1/protected/quote

Future Endpoints

More paid endpoints with varying costs will be added
From api/src/config/constants.ts:8:

Credit Ledger System

ActumX maintains a double-entry ledger for all credit movements:

Credit Entries (Money In)

Debit Entries (Money Out)

Your balance is calculated by summing all credits and subtracting all debits from the ledger.

Handling Insufficient Balance

When trying to settle a payment without sufficient credits: Request:
Response (402 Payment Required):
Always ensure you have sufficient balance before attempting to settle x402 payments.

Best Practices

Keep extra credits in your account to avoid failed requests:
  • Calculate your expected monthly usage
  • Top up with 20-30% extra as a buffer
  • Monitor your balance regularly
Use the billing summary to understand your usage:
Monitor your balance programmatically and alert when low:

Troubleshooting

If your balance doesn’t update after topping up:
  1. Check the response for a paymentIntentId
  2. Verify the balanceCents in the response
  3. Fetch the billing summary to confirm
  4. Check payment intents to see if the transaction was recorded
If your balance seems incorrect:The balance is calculated from the credit ledger:
Verify by checking your payment history and usage events.

Next Steps

Make Paid Requests

Learn how to use x402 payment endpoints

API Reference

View complete billing API documentation