Skip to main content
GET
/
api
/
public
/
v1
/
credits
/
top-ups
/
{topUpId}
curl -sS https://app.opentrain.ai/api/public/v1/credits/top-ups/<TOP_UP_ID> \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "topUp": {
    "id": "<TOP_UP_ID>",
    "status": "COMPLETED",
    "amountCents": 10000,
    "createdAt": "2026-06-12T10:00:00.000Z",
    "completedAt": "2026-06-12T10:12:00.000Z",
    "expiresAt": "2026-06-13T10:00:00.000Z"
  }
}
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.

Request

topUpId
string
required
The top-up ID returned when the top-up was created.

Response

topUp
object

Errors

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})
curl -sS https://app.opentrain.ai/api/public/v1/credits/top-ups/<TOP_UP_ID> \
  -H "Authorization: Bearer $OT_API_TOKEN"
{
  "topUp": {
    "id": "<TOP_UP_ID>",
    "status": "COMPLETED",
    "amountCents": 10000,
    "createdAt": "2026-06-12T10:00:00.000Z",
    "completedAt": "2026-06-12T10:12:00.000Z",
    "expiresAt": "2026-06-13T10:00:00.000Z"
  }
}