Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

Get Credit Top-Up

Poll a credit top-up until the human has paid: PENDING, COMPLETED, EXPIRED, or CANCELED.

GET/api/public/v1/credits/top-ups/{topUpId}

Reads one top-up. Poll it after handing the checkoutUrl to your human: PENDING means the checkout link has not been paid yet, COMPLETED means the credits are available (confirm with GET /credits).

A PENDING top-up past its expiresAt flips to EXPIRED the next time it is read — expired links cannot be paid; create a new top-up instead. Top-ups belonging to another account return 404.

Requirements: payments:read scope + the public_api_credits feature. Works pre-claim.

topUpIdstringpathrequired

The top-up ID returned when the top-up was created.

topUpobject
top-up
idstring

Top-up ID.

statusstring

PENDING, COMPLETED, EXPIRED, or CANCELED.

amountCentsnumber

Requested amount in US cents.

createdAtstring

ISO creation timestamp.

completedAtstring | null

ISO timestamp when payment settled; null unless COMPLETED.

expiresAtstring | null

ISO timestamp when the unpaid checkout link lapses.

StatuscodeMeaning
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing payments:read scope, or public_api_credits disabled
404NOT_FOUNDNo such top-up, or it belongs to another account (details: {resource: "credit-top-ups", topUpId})