Credit Balance
Check your workspace's available credits and its most recent credit batches.
Returns your workspace's current credit balance, plus your three most recently added credit batches. Use it before an operation that spends credits, or to confirm that a purchase has landed.
If your workspace is billed through a partner, credits are not tracked here:
available_credits is 0 and batches is empty. This is expected, not an error — your
usage is invoiced to your partner instead of drawing from a credit balance.
Get credit balance
Example request
curl "https://api.getsillage.com/api/v2/credits/balance" \
-H "Authorization: Bearer $SILLAGE_API_KEY"Example response
{
"available_credits": 1250,
"batches": [
{
"id": 43,
"remaining_credits": 500,
"expires_at": "2026-11-20T00:00:00.000Z",
"source": "purchase",
"created_at": "2026-08-20T00:00:00.000Z",
"stripe_payment_intent_id": "pi_3QxYzAbCdEfGhIjK0LmNoPqR"
},
{
"id": 42,
"remaining_credits": 500,
"expires_at": "2026-10-15T00:00:00.000Z",
"source": "plan_grant",
"created_at": "2026-07-15T00:00:00.000Z",
"stripe_payment_intent_id": null
},
{
"id": 41,
"remaining_credits": 250,
"expires_at": "2026-09-01T00:00:00.000Z",
"source": "purchase",
"created_at": "2026-06-01T00:00:00.000Z",
"stripe_payment_intent_id": "pi_3QwAbCdEfGhIjKlM0NoPqRsT"
}
]
}Response fields
| Field | Type | Description |
|---|---|---|
| available_credits | integer | Your workspace's current spendable balance, in credits. This is the authoritative number — read it directly, don't recompute it by summing batches[].remaining_credits. |
| batches | array | Your three most recently added active batches, newest first. Each has credits left and an expiry still ahead. This is a capped, recent view — not your full batch history, and not the order credits are spent in. |
| batches[].id | integer | The batch's ID. This ID is specific to your environment. |
| batches[].remaining_credits | integer | Credits left on this batch. |
| batches[].expires_at | string | When this batch's remaining credits expire, in ISO 8601. |
| batches[].source | string | How this batch was granted: purchase, plan_grant, or manual. |
| batches[].created_at | string | When this batch was granted, in ISO 8601. |
| batches[].stripe_payment_intent_id | string | The Stripe PaymentIntent that paid for this batch, or null when source is not purchase. Unique per batch — match it against a payment you just made to confirm those credits have landed. |
Never derive the balance from batches. Two reasons, and both make the sum wrong: the
list is capped at three, so a workspace with more live batches has credits that no entry
here accounts for; and a spend updates available_credits immediately while the batch
it draws from is settled shortly after. available_credits is the authoritative number.
Credits are spent soonest-expiring first, which is not the order this list uses. To
see what is about to lapse, read each entry's own expires_at.
Errors
| Status | Meaning |
|---|---|
| 401 | The API key is missing or invalid. |
| 429 | Rate limit exceeded. |
| 500 | An unexpected server error occurred. |
Error responses use RFC 9457 problem documents with Content-Type: application/problem+json:
{
"type": "https://docs.getsillage.com/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "Invalid or missing API key.",
"instance": "/api/v2/credits/balance"
}