Get account
curl --request GET \
--url https://api.mage.space/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mage.space/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mage.space/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"gems": {
"balance": 1250
}
}{
"error": {
"code": "unauthorized",
"message": "The API key is invalid or has been revoked."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side. Retry, and contact support if it persists."
}
}Endpoints
Get account
GET /v1/account returns the gems balance the Mage API draws from.
GET
/
v1
/
account
Get account
curl --request GET \
--url https://api.mage.space/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mage.space/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mage.space/v1/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"gems": {
"balance": 1250
}
}{
"error": {
"code": "unauthorized",
"message": "The API key is invalid or has been revoked."
}
}{
"error": {
"code": "internal_error",
"message": "Something went wrong on our side. Retry, and contact support if it persists."
}
}The gems balance the API’s generations draw from. A generation whose price exceeds the balance is refused with
402 insufficient_gems and gems_required. If auto top-up is on for the account, an API request can trigger it exactly as a generation in the app would.Last modified on September 17, 2026

