Credits available to this project
GET
/projects/{projectId}/billing/balance
const url = 'https://zkao.io/api/v1/projects/example/billing/balance';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://zkao.io/api/v1/projects/example/billing/balance \ --header 'Authorization: Bearer <token>'Requires scope: read. The organization’s shared prepaid balance, available to this project and to the organization’s other projects. All amounts are in credits.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”projectId
required
string
Responses
Section titled “ Responses ”OK
Media typeapplication/json
object
organization
required
The organization whose shared balance this is.
object
id
required
string
slug
required
URL segment of the organization (/orgs/<slug>), unique across zkao.
string
name
required
string
balanceCredits
required
The organization’s total prepaid credit balance, shared by all of its projects.
integer
availableCredits
required
Balance minus credits reserved by the organization’s in-flight scans.
integer
reservedCredits
required
Credits held by the organization’s queued/running scans.
integer
Examplegenerated
{ "organization": { "id": "example", "slug": "example", "name": "example" }, "balanceCredits": 1, "availableCredits": 1, "reservedCredits": 1}Missing, malformed, expired, or revoked token
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}The token lacks the required scope
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}Resource not in this token’s project or repo allowlist
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "unauthorized" }}
