Layers
Partner APIAPI referenceOrganizationsChild credits

GET /v1/organizations/:orgId/credits

A child organization's wallet - both gross balance and spendable available.

View as Markdown
GET/v1/organizations/{orgId}/credits
Phase 1stable
Auth
Bearer
Scope
org:admin

To see how much funding one of your customers has left, read that customer's child wallet. You call this with your parent (org:admin) key. The shape is identical to your own GET /v1/credits - same balances, same per-format estimates - but scoped to the child named in the path.

The wallet reports two numbers, and the difference matters:

  • balance - the gross wallet: included credits remaining this period plus the prepaid balance.
  • available - what the child can actually spend on new work right now: balance minus credits already reserved for in-flight generations. Generations reserve credits the moment a workflow starts and settle when it finishes, so available can be lower than balance while work is mid-flight.

Gate a "can this customer generate?" decision on available, not balance - reserving against the gross number double-spends credits already committed to running jobs.

Path
  • orgId
    string (org_…)required
    The child organization whose wallet you want. Must be a direct child of your org - otherwise 404.

Example

curl https://api.layers.com/v1/organizations/org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80/credits \
  -H "Authorization: Bearer $LAYERS_PARENT_KEY"
200OK
{
  "organizationId": "org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80",
  "balance": 6000,
  "available": 5880,
  "includedRemaining": 600,
  "prepaidBalance": 5400,
  "reservedCredits": 120,
  "includedThisPeriod": 1000,
  "usedThisPeriod": 400,
  "currentPeriod": {
    "start": "2026-06-01T00:00:00.000Z",
    "end": "2026-07-01T00:00:00.000Z",
    "usedCredits": 400
  },
  "subscriptionTier": "pro",
  "billingStatus": "active",
  "estimatedCreditsPerFormat": {
    "slideshow_builder": 50,
    "slideshow_remix": 50,
    "video_remix": 120,
    "ugc_remix": 120,
    "auto": 120
  },
  "ingestCostsBilled": {
    "github": false,
    "website": false,
    "appstore": false
  }
}

Field notes

  • balance = includedRemaining + prepaidBalance (gross). available = balance - reservedCredits, floored at 0.
  • reservedCredits is credit committed to in-flight work. It exists so balance - reservedCredits === available reconciles client-side. When nothing is running, reservedCredits is 0 and available === balance.
  • prepaidBalance here is the portion you've funded into the child via allocate (plus any direct top-ups), net of the child's spend. includedRemaining is the child's own subscription allotment, if any.
  • estimatedCreditsPerFormat is a defensive upper bound for pre-flight UI prompts; the authoritative deduction happens server-side after generation.
  • ingestCostsBilled flags whether ingest debits credits. All three are false today.

Errors

StatusCodeWhen
404NOT_FOUND:orgId is not a direct child of your org (anti-enumeration - a stranger's org looks identical to a missing one).
422VALIDATIONMalformed :orgId.
503KILL_SWITCHYour key or org is suspended; or the child org is suspended/archived.

See also

On this page