Credit API
Get Credit Balance
prolog
GET /auxilia/credits/balanceAuthorization Required
| OAuth | APIKey |
|---|---|
| Yes | Yes |
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=:limitAuthorization Required
| OAuth | APIKey |
|---|---|
| Yes | Yes |
OAuth scope: credit.read or credit.full
Parameters
| Parameter | Type | Description |
|---|---|---|
offset | number | Pagination offset. |
limit | number | Pagination 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/topupAuthorization Required
| OAuth | APIKey |
|---|---|
| No | No |
Request Body
json
{
"amount": 10,
"credit_amount": 1000,
"currency": "USD",
"channel": "stripe",
"redirect_url": "https://example.com/credit/return"
}Notes:
redirect_urlis required.- At least one of
amountorcredit_amountmust be positive.
Response
json
{
"data": {
"order_id": 1,
"payment_url": "https://...",
"credit_amount": 1000
},
"ts": 1723923923
}Consume Credit
prolog
POST /auxilia/credits/consumeAuthorization Required
| OAuth | APIKey |
|---|---|
| Yes | Yes |
OAuth scope: credit.full
Request Body
json
{
"amount_credit": 10,
"source_id": "post_ai",
"meta": {
"post_id": 1
}
}Notes:
amount_creditmust be positive.source_idis required.
Response
json
{
"data": CREDIT_LEDGER_OBJECT,
"ts": 1723923923
}