Skip to main content
GET
Account Balance
Read the current wallet balance and the amount available to the API key used for the request. This is a read-only endpoint and does not accept query parameters.

Request

curl
The endpoint requires a standard AIsa API key in the Authorization header. It does not accept MPP payment authorization.

Response

All monetary values are integer microdollars. One dollar is 1,000,000 microdollars. This avoids floating-point rounding in automated clients.

Top-level fields

GTM fields

Media promo fields

media_promo.balance_micros_usd is credit restricted to the providers named by its credit lots. It is excluded from both general account and available balance totals. next_expires_at is the next lot expiry and is omitted when none applies. A positive media promo balance does not imply that an unrelated API request can be funded.

Balance calculation

The PAYG balance is the sum of the effective cash, Trial, promo, and credit buckets. An expired Trial balance is excluded. go_to_market_balance_micros_usd is the GTM balance. It is also exposed as gtm.balance_micros_usd, with its trial, subscription, and available add-on components in the gtm object. Frozen add-on credit is reported separately and excluded from this total. account_balance_micros_usd is the PAYG balance plus go_to_market_balance_micros_usd. For a limited API key, available_balance_micros_usd is the lower of the PAYG balance and api_key.remaining_micros_usd, plus the GTM balance. For an unlimited API key, it equals the PAYG balance plus the GTM balance. The PAYG portion available to the key is clamped at zero when the PAYG or key balance is negative. Expired Trial credit is not included in the effective balance.

Errors

  • 401 Unauthorized — the API key is missing, invalid, revoked, or expired.
  • 403 Forbidden — the user is disabled or the key is not allowed from the requesting IP address.
  • 500 Internal Server Error — the balance snapshot could not be read.
Errors from this endpoint use a string-valued error field:
See Error Codes for general status-code and retry guidance, and Rate Limits for request limits.

Request contract

  • Method and path: GET /credits/balance
  • Request URL template: https://api.aisa.one/v1/credits/balance
Complete OpenAPI definition Effective request and pricing declaration (including authentication and referenced schemas):

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json

Current balance snapshot.

account_balance_micros_usd
integer<int64>

Effective PAYG balance plus the GTM balance, in micro-USD.

api_key
object

Per-key limit view for the calling API key (absent for OAuth callers).

as_of
string<date-time>

Snapshot timestamp (RFC 3339, UTC).

available_balance_micros_usd
integer<int64>

PAYG balance available to the authenticated API key plus the GTM balance, in micro-USD. For a limited key this is min(PAYG balance, key remaining balance) + GTM balance.

currency
string

ISO currency code (always USD).

go_to_market_balance_micros_usd
integer<int64>

Total GTM balance in micro-USD. Equal to gtm.balance_micros_usd.

gtm
object

GTM balance details. The total includes GTM trial and subscription balances.