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
}