Skip to content

Credit API โ€‹

Get Credit Balance โ€‹

prolog
GET /auxilia/credits/balance

Authorization Required โ€‹

OAuthAPIKey
YesYes

OAuth scope: credit.read or credit.full

Response โ€‹

json
{
  "data": USER_CREDIT_OBJECT,
  "ts": 1723923923
}

Get Credit Ledger โ€‹

prolog
GET /auxilia/credits/ledger?offset=:offset&limit=:limit

Authorization Required โ€‹

OAuthAPIKey
YesYes

OAuth scope: credit.read or credit.full

Parameters โ€‹

ParameterTypeDescription
offsetnumberPagination offset.
limitnumberPagination limit (default: 16).

Response โ€‹

json
{
  "data": {
    "pagination": {
      "offset": 0,
      "next_offset": 16,
      "limit": 16
    },
    "items": [CREDIT_LEDGER_OBJECT, ...]
  },
  "ts": 1723923923
}

Topup Credit โ€‹

prolog
POST /auxilia/credits/topup

Authorization Required โ€‹

OAuthAPIKey
NoNo

Request Body โ€‹

json
{
  "amount": 10,
  "credit_amount": 1000,
  "currency": "USD",
  "channel": "stripe",
  "redirect_url": "https://example.com/credit/return"
}

Notes:

  • redirect_url is required.
  • At least one of amount or credit_amount must be positive.

Response โ€‹

json
{
  "data": {
    "order_id": 1,
    "payment_url": "https://...",
    "credit_amount": 1000
  },
  "ts": 1723923923
}

Consume Credit โ€‹

prolog
POST /auxilia/credits/consume

Authorization Required โ€‹

OAuthAPIKey
YesYes

OAuth scope: credit.full

Request Body โ€‹

json
{
  "amount_credit": 10,
  "source_id": "post_ai",
  "meta": {
    "post_id": 1
  }
}

Notes:

  • amount_credit must be positive.
  • source_id is required.

Response โ€‹

json
{
  "data": CREDIT_LEDGER_OBJECT,
  "ts": 1723923923
}