Skip to content
gist.link ↗

creditBalance

Query Billing API — POST https://billing.api.gist.link/graphql

THE cross-service prepaid-credit hard-stop check: product apps running billable AI work (e.g. agentworkforce) call this with an org-bound token before a model call and must STOP when has_credits is false. Callable by ROLE_SERVICE tokens or an org member for their own org.

billing:query:creditBalance

The calling IAM key must hold this permission (or a wildcard that covers it: billing:query:* or billing:*) and the access token must have been minted with audience=billing. See Permissions.

type Query {
creditBalance(organizationId: ID!): CreditBalance!
}
Argument Type Required Description
organizationId ID! Yes —

CreditBalance! — see the Billing types reference.

Terminal window
curl https://billing.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query CreditBalance($organizationId: ID!) { creditBalance(organizationId: $organizationId) { organization_id has_credits auto_recharge_enabled } }",
"variables": {
"organizationId": "01a01234-abcd-7000-9000-0123456789ab"
}
}
JSON