Account Balance
curl --request GET \
--url https://api.aisa.one/v1/credits/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/v1/credits/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/v1/credits/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/v1/credits/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/v1/credits/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/v1/credits/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/v1/credits/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account_balance_micros_usd": 3250000,
"api_key": {
"remaining_micros_usd": 1000000,
"unlimited": false,
"used_micros_usd": 300000
},
"as_of": "2026-08-27T10:36:29Z",
"available_balance_micros_usd": 1750000,
"currency": "USD",
"go_to_market_balance_micros_usd": 750000,
"gtm": {
"active": true,
"balance_micros_usd": 750000,
"expires_at": "2026-10-31T12:00:00Z",
"subscription_balance_micros_usd": 500000,
"trial_balance_micros_usd": 250000,
"trial_expires_at": "2026-09-30T12:00:00Z"
}
}Overview
Credit Balance
Read the current wallet balance and the amount available to an API key.
GET
https://api.aisa.one/v1
/
credits
/
balance
Account Balance
curl --request GET \
--url https://api.aisa.one/v1/credits/balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/v1/credits/balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/v1/credits/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/v1/credits/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/v1/credits/balance"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/v1/credits/balance")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/v1/credits/balance")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"account_balance_micros_usd": 3250000,
"api_key": {
"remaining_micros_usd": 1000000,
"unlimited": false,
"used_micros_usd": 300000
},
"as_of": "2026-08-27T10:36:29Z",
"available_balance_micros_usd": 1750000,
"currency": "USD",
"go_to_market_balance_micros_usd": 750000,
"gtm": {
"active": true,
"balance_micros_usd": 750000,
"expires_at": "2026-10-31T12:00:00Z",
"subscription_balance_micros_usd": 500000,
"trial_balance_micros_usd": 250000,
"trial_expires_at": "2026-09-30T12:00:00Z"
}
}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.
The endpoint requires a standard AIsa API key in the
All monetary values are integer microdollars. One dollar is
See Error Codes for general status-code and retry
guidance, and Rate Limits for request limits.
Request
curl
curl -sS https://api.aisa.one/v1/credits/balance \
-H "Authorization: Bearer $AISA_API_KEY"
Authorization header. It
does not accept MPP payment authorization.
Response
{
"currency": "USD",
"account_balance_micros_usd": 3250000,
"available_balance_micros_usd": 1750000,
"go_to_market_balance_micros_usd": 750000,
"gtm": {
"active": true,
"balance_micros_usd": 750000,
"trial_balance_micros_usd": 250000,
"trial_expires_at": "2026-10-31T12:00:00Z",
"subscription_balance_micros_usd": 400000,
"subscription_addon_balance_micros_usd": 100000,
"subscription_addon_available_micros_usd": 100000,
"subscription_addon_frozen_micros_usd": 0,
"expires_at": "2026-10-31T12:00:00Z"
},
"media_promo": {
"balance_micros_usd": 200000,
"next_expires_at": "2026-10-31T12:00:00Z"
},
"api_key": {
"unlimited": false,
"remaining_micros_usd": 1000000,
"used_micros_usd": 300000
},
"as_of": "2026-10-12T12:00:00Z"
}
1,000,000
microdollars. This avoids floating-point rounding in automated clients.
Top-level fields
| Field | Type | Description |
|---|---|---|
currency | string | The balance currency. Currently always USD. |
account_balance_micros_usd | integer | Effective PAYG balance plus the GTM balance. |
available_balance_micros_usd | integer | PAYG balance available to the authenticated API key plus the GTM balance. |
go_to_market_balance_micros_usd | integer | Total GTM balance. This equals gtm.balance_micros_usd. |
gtm | object | GTM balance details, including trial and subscription balances. |
media_promo | object | Provider-scoped media credit, reported separately from general available balance. |
api_key | object | Remaining and used balance for this API key. |
as_of | string | UTC timestamp for the balance snapshot. |
GTM fields
| Field | Type | Description |
|---|---|---|
active | boolean | Whether GTM funds are available or a GTM subscription period exists. |
balance_micros_usd | integer | Total GTM balance. |
trial_balance_micros_usd | integer | Unexpired GTM trial balance. |
trial_expires_at | string | UTC expiry of the GTM trial balance. Omitted when no trial expiry applies. |
subscription_balance_micros_usd | integer | GTM subscription balance. |
subscription_addon_balance_micros_usd | integer | Total add-on credit, including available and frozen parts. |
subscription_addon_available_micros_usd | integer | Add-on credit spendable during an active paid plan period; included in GTM balance. |
subscription_addon_frozen_micros_usd | integer | Add-on credit currently frozen without an active paid plan period; excluded from available and GTM totals. |
expires_at | string | UTC expiry of the current GTM subscription period. Omitted when no period applies. |
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.
error field:
{
"error": "invalid api key"
}
Request contract
- Method and path: GET /credits/balance
- Request URL template:
https://api.aisa.one/v1/credits/balance
{
"operationId": "accountCreditsBalance",
"method": "GET",
"path": "/credits/balance",
"servers": [
{
"url": "https://api.aisa.one/v1"
}
],
"parameters": [],
"security": [
{
"BearerAuth": []
}
],
"components": {
"securitySchemes": {
"BearerAuth": {
"bearerFormat": "AISA API Key or OAuth access token",
"scheme": "bearer",
"type": "http"
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
200 - application/json
Current balance snapshot.
Effective PAYG balance plus the GTM balance, in micro-USD.
Per-key limit view for the calling API key (absent for OAuth callers).
Show child attributes
Show child attributes
Snapshot timestamp (RFC 3339, UTC).
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.
ISO currency code (always USD).
Total GTM balance in micro-USD. Equal to gtm.balance_micros_usd.
GTM balance details. The total includes GTM trial and subscription balances.
Show child attributes
Show child attributes