IPXdocs
API reference

Credits

Read your prepaid balance and top it up. Every rental is metered against the credits in your account, so this is the endpoint that tells you how much runway you have.

IPX is prepaid. You hold a balance of credits, we meter each rental per second from tunnel-connect to teardown, and we draw that balance down. You cannot be charged past your balance, so before you provision a box it is worth checking that you have enough to cover it. The Credits API gives you two things: a way to read the current balance, and a way to start a Stripe top-up without leaving your code.

All amounts the API returns are in micro-USD. One US dollar is 1,000,000 micro. A balance of 5000000 is $5.00, and a box at $0.68/hr meters at 680000 per hour.

Authentication

Both endpoints require a bearer token. Create or rotate one under Settings → API access, then send it on every request:

header
Authorization: Bearer $IPX_TOKEN

Get your balance

GET/api/v1/credits

Returns the current credit balance for the account that owns the token. There are no parameters and no pagination. The single field balance_micro_usd is your spendable credits in micro-USD.

request
$ curl https://gpu.ipxtechholding.com/api/v1/credits \\
    -H "Authorization: Bearer $IPX_TOKEN"

Response

balance_micro_usdinteger
Spendable credits in micro-USD. Divide by 1,000,000 for dollars. 5000000 is $5.00.
response
{
  "balance_micro_usd": 5000000
}

Poll this before you rent. A box meters per second, so confirm balance_micro_usd comfortably exceeds the hourly rate times how long you expect to run. Set a hard spend cap on the rental if you want a guaranteed ceiling.

Add credits

POST/api/v1/credits

Starts a top-up by creating a Stripe PaymentIntent for the amount you ask for. This does not charge a card on its own. It returns a client_secret that you confirm with Stripe (in a browser, mobile SDK, or your own server-side flow). Once Stripe confirms the payment, the credits land on your balance.

Body parameters

amount_centsintegerrequired
How much to add, in US cents. 500 tops up $5.00. Note this is cents, not micro-USD.
request
# top up $5.00 = 500 cents
$ curl -X POST https://gpu.ipxtechholding.com/api/v1/credits \\
    -H "Authorization: Bearer $IPX_TOKEN" \\
    -H "Content-Type: application/json" \\
    -d '{ "amount_cents": 500 }'

Response

Returns 201 Created with the Stripe identifiers you need to finish the payment.

payment_intent_idstring
The Stripe PaymentIntent id, for example pi_3Q.... Use it to track or reconcile the charge.
client_secretstring
The secret you pass to Stripe to confirm the payment client-side. Treat it like a credential.
response
{
  "payment_intent_id": "pi_3QabcDEF456ghiJK0lmno",
  "client_secret": "pi_3QabcDEF456ghiJK0lmno_secret_XyZ"
}

The top-up is not complete until Stripe confirms the PaymentIntent. The returned client_secret only authorizes the charge. Your balance updates after confirmation succeeds, so re-read GET /api/v1/credits to verify the credits landed.

Confirm the payment

  1. Create the intent

    Call POST /api/v1/credits with amount_cents and keep the client_secret from the response.

  2. Confirm with Stripe

    Hand the client_secret to Stripe.js, a mobile SDK, or a server-side confirm call to collect and charge the card. This step happens against Stripe, not IPX.

  3. Verify the balance

    Once Stripe reports success, re-read your balance. The new credits are reflected in balance_micro_usd.

    terminal
    $ curl https://gpu.ipxtechholding.com/api/v1/credits \\
        -H "Authorization: Bearer $IPX_TOKEN"
    # { "balance_micro_usd": 5500000 }

Prefer not to script payments? Top up from the console at Billing with a single click. The API is there for when you want balances and top-ups in your own tooling.

Units at a glance

Two different units show up around credits. Keep them straight:

  • amount_cents (request input) is US cents. 500 · $5.00.
  • balance_micro_usd (response) is micro-USD. 5000000 · $5.00.

The two differ by a factor of 10,000: cents times 10,000 equals micro-USD. So 500 cents adds 5000000 micro to your balance.

Next steps