Skip to content
Subako Docs
Esc
navigateopen⌘Jpreview

GET /v1/organization/credits

GET/v1/organization/credits
Authorization
AuthorizationBearer token · headerrequired
Responses
200The balance and every lot.
balanceinteger<int64>required
Hundred-millionths of a credit, the unit the deployment's billing layer names; on Subako Cloud a credit is one SC. Zero or below refuses every creation and every platform call.
lotsCreditLotBody[]required
Every lot ever granted, oldest first; `remaining` and `expires_at` tell which still count.
Show properties
Array of CreditLotBody
amountinteger<int64>required
Hundred-millionths of a credit, the unit the deployment's billing layer names; on Subako Cloud a credit is one SC.
expires_atstring<date-time> | nullrequired
granted_atstring<date-time>required
idstring<uuid>required
notestring | nullrequired
Why the lot was granted, in words; null where the grant recorded none.
remaininginteger<int64>required
What is left of `amount`; negative where the lot absorbed a shortfall.
sourceCreditSourceBodyrequired
Allowed:grantpurchase
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks org.credits.read.
errorErrorDetailrequired
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Request
curl -X GET "https://api.us.cloud.subako.ai/v1/organization/credits" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "balance": 0,
  "lots": [
    {
      "amount": 0,
      "expires_at": "2019-08-24T14:15:22Z",
      "granted_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "note": "string",
      "remaining": 0,
      "source": "grant"
    }
  ]
}