Credits

Check your team's remaining OpenGateway balance, model-specific credits, and the calling API key's spending limits with GET /v1/credits.

GET https://apis.opengateway.ai/v1/credits returns the balance of the team that owns the API key, its model-specific credits, and the key's own status and spending limits. Use it to check your balance from scripts, CI, or agents without opening the console.

The call is free: it is not billed and does not appear in usage or logs.

Endpoint and authentication#

ItemValue
Method and pathGET https://apis.opengateway.ai/v1/credits
AuthenticationRequired: Authorization: Bearer <key>, or x-api-key: <key> when no Authorization header is sent
Request bodyNone

A key suspended because the team ran out of balance still gets 200 here, so you can confirm the balance is zero. A disabled, deleted, or unknown key gets the usual 401 invalid_api_key.

Bash
curl https://apis.opengateway.ai/v1/credits \
-H "Authorization: Bearer $OPENGATEWAY_API_KEY"

Response#

JSON
{
"object": "credits",
"currency": "USD",
"balance": 12.34,
"credit_limit": 0.0,
"available_balance": 12.34,
"model_credits": [
{
"models": ["deepseek/*"],
"remaining": 5.0,
"expires_at": "2026-12-31T00:00:00Z"
}
],
"key": {
"status": "active",
"suspension_reason": null,
"spending_limit": {
"enforcement": "hard",
"daily": null,
"weekly": null,
"monthly": {
"limit": 50.0,
"spent": 10.2,
"remaining": 39.8,
"resets_at": "2026-12-01T00:00:00Z"
},
"as_of": "2026-11-12T04:10:00Z"
}
}
}

All amounts are USD, rounded half-up to 6 decimal places. Fields without data are null, never omitted.

FieldTypeMeaning
objectstringAlways credits.
currencystringAlways USD.
balancenumberGeneral balance, usable for any model. Negative while a postpaid credit line is in use.
credit_limitnumberPostpaid credit line. 0 for prepaid teams.
available_balancenumberbalance + credit_limit: what can still be spent on any model.
model_creditsarrayUnexpired model-specific credits, soonest expiry first, which is the order usage consumes them. Empty when there are none.
model_credits[].modelsstring[]Models the credit pays for: creator/model IDs, or creator/* for every model of a creator.
model_credits[].remainingnumberUnused amount.
model_credits[].expires_atstringExpiry time (ISO 8601, UTC).
key.statusstringactive, or suspended when the team ran out of balance.
key.suspension_reasonstring or nullinsufficient_balance while suspended, otherwise null.
key.spending_limitobject or nullThe key's spending limits from the Quota page. null when the key has none.
key.spending_limit.enforcementstringhard: requests get 429 budget_exceeded at 100%. soft: requests continue and carry an X-OG-Budget-Warn header. none: not enforced.
key.spending_limit.daily, .weekly, .monthlyobject or nullOne limit window, or null when that window has no limit. Windows are UTC: the calendar day, the week starting Monday, and the calendar month.
...limitnumberLimit for the window.
...spentnumberSpend counted against the limit in the current window.
...remainingnumberlimit - spent, never below 0.
...resets_atstringStart of the next window (ISO 8601, UTC).
key.spending_limit.as_ofstringWhen spent was computed. Spend can trail live usage slightly (normally under a minute); this timestamp shows by how much.

The response never includes team IDs, key IDs, or key secrets. A key only ever sees its own team.

The team-wide monthly limit on the Quota page is not part of this response; see it in the console.

Errors#

StatusCodeWhen
401invalid_api_keyMissing, unknown, disabled, or deleted key.
403apikey_suspendedThe key is suspended by a guardrail policy.
503service_unavailableThe balance could not be read right now. Retry after the Retry-After seconds.

Balance and model credits are cached for up to 5 seconds per key, so polling faster than that returns the same numbers.

Credits — OpenGateway