Skip to main content

Utility API

Get Balance

Check your current diamond balance using your API key.

Endpoint


GET https://open.eternalai.org/v1/balance

Authentication

Provide your API key using one of the following methods:

MethodHeader
API Keyx-api-key: <your_api_key>

Request Examples

Using x-api-key:


curl --request GET \
--location 'https://open.eternalai.org/v1/balance' \
--header 'x-api-key: sa_your_api_key_here'

Responses

200 OK


{
"api_key": "sa_your_api_key_here",
"diamond_balance": 2205.861643999995
}
FieldTypeDescription
api_keystringThe API key used for the request
diamond_balancenumberCurrent diamond balance of the account

401 Unauthorized — Missing authentication


{
"error": "Missing authentication",
"detail": "Provide either x-api-key header or Authorization: Bearer <api_key>"
}

401 Unauthorized — Invalid API key


{
"error": "Invalid API key",
"detail": "..."
}