Wallet API
Credit wallet balance for the authenticated user.
Base Path
https://api.chainabit.com/api/v1/walletAuthentication
JWT Bearer token required. The user must also have an active entitlement that includes wallet access.
Environment Variables
Set these variables before running any example on this page:
bash
export BASE_URL="https://api.chainabit.com/api/v1"
export TOKEN="your-access-token"Get your access token by calling POST /auth/login.
Endpoints
| Method | Path | Description | Auth | Rate Limit |
|---|---|---|---|---|
| GET | /wallet/me | Get credit wallet balance | JWT + Entitlement | -- |
GET /wallet/me
Returns the authenticated user's current credit wallet balance, including subscription credits and purchased credit packs.
Authentication: JWT Bearer token + active wallet entitlement required.
Request
No path or query parameters.
Response
Response Example
json
{
"data": {
"balance": {
"total": 1158,
"subscriptionCredits": 658,
"purchasedCredits": 500
},
"subscription": {
"planCode": "pro-monthly",
"creditUnits": 1000,
"used": 342,
"remaining": 658,
"resetsAt": "2026-04-01T00:00:00.000Z"
}
},
"meta": null,
"error": null
}Response Fields
| Field | Type | Description |
|---|---|---|
balance.total | number | Total available credits (subscription + purchased) |
balance.subscriptionCredits | number | Credits remaining from the current subscription period |
balance.purchasedCredits | number | Credits from one-time credit pack purchases |
subscription.planCode | string | Active subscription plan code |
subscription.creditUnits | number | Total credits allocated per billing cycle |
subscription.used | number | Credits consumed in the current period |
subscription.remaining | number | Credits remaining in the current period |
subscription.resetsAt | string | ISO 8601 timestamp when subscription credits reset |
Code Example
bash
curl https://api.chainabit.com/api/v1/wallet/me \
-H "Authorization: Bearer $TOKEN"javascript
const response = await fetch(`${BASE_URL}/wallet/me`, {
headers: {
'Authorization': `Bearer ${TOKEN}`,
},
});
const data = await response.json();python
import requests
response = requests.get(
f"{BASE_URL}/wallet/me",
headers={"Authorization": f"Bearer {TOKEN}"},
)
data = response.json()Notes
- The wallet balance combines subscription credits and purchased credits. Subscription credits reset at the start of each billing cycle. Purchased credits do not expire.
- If the user has no active subscription, the
subscriptionfield will benulland onlypurchasedCreditswill be available. - This endpoint requires an active entitlement. Users on a free plan without wallet access will receive a
403 Forbiddenresponse.