Read the organization's balance
curl --request GET \
--url https://api.zerogen.com/v1/balance \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"currency": "USD",
"balanceMicroUsd": 0,
"heldMicroUsd": 4503599627370495,
"availableMicroUsd": 0,
"unlimited": true,
"limits": {
"organizationMonthly": {
"limitMicroUsd": 4503599627370495,
"spentMicroUsd": 0,
"enforced": true
},
"projectMonthly": {
"limitMicroUsd": 4503599627370495,
"spentMicroUsd": 0
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Account
Read the organization's balance
The organization’s funds and monthly limits, shared by every member and project. A new generation’s quote must fit within availableMicroUsd.
Needs the account:read scope.
GET
/
balance
Read the organization's balance
curl --request GET \
--url https://api.zerogen.com/v1/balance \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"currency": "USD",
"balanceMicroUsd": 0,
"heldMicroUsd": 4503599627370495,
"availableMicroUsd": 0,
"unlimited": true,
"limits": {
"organizationMonthly": {
"limitMicroUsd": 4503599627370495,
"spentMicroUsd": 0,
"enforced": true
},
"projectMonthly": {
"limitMicroUsd": 4503599627370495,
"spentMicroUsd": 0
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Authorizations
A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.
Query Parameters
Also report this project's monthly budget
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Response
The organization's balance.
Allowed value:
"USD"Required range:
-9007199254740991 <= x <= 9007199254740991Reserved for generations that have not settled; a hold is not a charge
Required range:
0 <= x <= 9007199254740991What a new generation's quote must fit within; it can be negative
Required range:
-9007199254740991 <= x <= 9007199254740991The funds check is bypassed; usage is still charged
Show child attributes
Show child attributes