Skip to content
gist.link ↗

purchaseCredits

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

Buy prepaid AI credits now. Raises its OWN credit-category invoice, charges it immediately against the saved card through the pay rail, and credits the wallet on success — the top-up appears on the billing page as a distinct invoice, separate from the monthly subscription invoice. Requires a saved payment method. Any org member.

billing:mutation:purchaseCredits

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

type Mutation {
purchaseCredits(amountMinor: Int!): CreditPurchaseResult!
}
Argument Type Required Description
amountMinor Int! Yes —

CreditPurchaseResult! — 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": "mutation PurchaseCredits($amountMinor: Int!) { purchaseCredits(amountMinor: $amountMinor) { status } }",
"variables": {
"amountMinor": 10
}
}
JSON