API v3 is live and in beta: expect possible malfunctions and breaking changes in the coming days. If you find a bug, please report it to your Sillage contact.
APIv3

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

GET/api/v3/credits/balance

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

FieldTypeDescription
data.available_creditsintegerCredits your workspace can spend right now. This is the number to rely on: read it directly, do not add up batches[].remaining_credits.
data.batchesarrayYour 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[].idintegerID of the batch.
data.batches[].remaining_creditsintegerCredits left on this batch.
data.batches[].expires_atstring or nullWhen the remaining credits of this batch expire, in ISO 8601. null for a batch that never expires.
data.batches[].sourcestringHow the batch was added: purchase, plan_grant, manual or reward.
data.batches[].created_atstringWhen the batch was added, in ISO 8601.
data.batches[].stripe_payment_intent_idstring or nullThe 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

StatusMeaning
401The API key is missing or invalid.
422A query parameter is sent: this route takes none, and errors names the parameter.
429Rate limit exceeded.
500An 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.

On this page