Get credit balance
Check how many credits your workspace can spend, and its most recent batches of credits.
Returns how many credits your workspace can spend right now, plus your three most recently added batches of credits. Use it before an action that spends credits, or to confirm that a purchase has landed. To see where credits went, read the credit usage.
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.
Route
Access modes
Use a workspace API key. The workspace is inferred from the key.
Authorization: Bearer sk_live_...Example request
curl "https://api.getsillage.com/api/v3/credits/balance" \
-H "Authorization: Bearer $SILLAGE_API_KEY"Success response
Status: 200 OK
{
"data": {
"available_credits": 1250,
"batches": [
{
"id": 42,
"remaining_credits": 500,
"expires_at": "2026-12-01T00:00:00.000Z",
"source": "plan_grant",
"created_at": "2026-06-01T00: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 |
|---|---|---|
| data.available_credits | integer | Credits your workspace can spend right now. This is the number to rely on: read it directly, do not add up batches[].remaining_credits. |
| data.batches | array | Your three most recently added batches of credits that still have credits left and have not expired, newest first. It is a recent view, not your full history, and not the order credits are spent in. |
| data.batches[].id | integer | ID of the batch. |
| data.batches[].remaining_credits | integer | Credits left on this batch. |
| data.batches[].expires_at | string or null | When the remaining credits of this batch expire, in ISO 8601. null for a batch that never expires. |
| data.batches[].source | string | How the batch was added: purchase, plan_grant, manual or reward. |
| data.batches[].created_at | string | When the batch was added, in ISO 8601. |
| data.batches[].stripe_payment_intent_id | string or null | The Stripe PaymentIntent that paid for this batch, or null when source is not purchase. Match it against a payment you just made to confirm those credits have landed. |
Credits are spent from the batch that expires first, which is not the order of this
list. To see what is about to expire, read the expires_at of each entry.
Errors
| Status | Meaning |
|---|---|
| 401 | The API key is missing or invalid. |
| 422 | A query parameter is sent: this route takes none, and errors names the parameter. |
| 429 | Rate limit exceeded. |
| 500 | An unexpected server error occurred. |
Error responses use RFC 9457 problem documents with Content-Type: application/problem+json. type is always about:blank; code tells one problem from another, detail says what went wrong this time, and errors names the field at fault.