Skip to content
Good MorningDocs
Dashboard

Get credit balance

GET
/credits
curl --request GET \
--url https://api.saygm.com/v1/credits \
--header 'Authorization: Bearer <token>'

Returns the current spendable prepaid balance for the authenticated GM API key. This is a GM-native endpoint, not part of the OpenAI API. The read is authoritative rather than TTL-cached, so external top-ups are visible immediately.

The API key’s current spendable balance. The response is never cacheable.

Media typeapplication/json
object
object
required
string
Allowed value: credit_balance
balance
required
object
usd
required

Exact decimal USD with nine fractional digits. Keep this as a decimal string when exact accounting matters.

string
/^[0-9]+\.[0-9]{9}$/
nano_usd
required

The same balance in GM’s native integer accounting unit: one nano-USD is 10^-9 USD.

integer
Example
{
"object": "credit_balance",
"balance": {
"usd": "12.345678901",
"nano_usd": 12345678901
}
}
Cache-Control
string
Allowed value: no-store

Always no-store.

Missing, malformed, revoked, or unknown GM API key.

Media typeapplication/json
object
error
object
message
string
type
string
code
string | null
Examplegenerated
{
"error": {
"message": "example",
"type": "example",
"code": "example"
}
}
Cache-Control
string
Allowed value: no-store

Always no-store.

The authoritative credit service is unavailable; no stale balance is returned.

Media typeapplication/json
object
error
object
message
string
type
string
code
string | null
Examplegenerated
{
"error": {
"message": "example",
"type": "example",
"code": "example"
}
}
Cache-Control
string
Allowed value: no-store

Always no-store.