Atmee.aiDocs
APIAPI referenceAccount

Get the balance

GET
/v1/account/balance

Returns the credits the account can spend on sessions, in microcredits (100 microcredits = 1 credit). An avatar's sponsor pool is not included (see GET /v1/avatars/{avatarId}/sponsor).

  • spendableMicrocredits is what a session is admitted on: every bucket, for every key and signed-in user. There is one kind of credit: it pays for every model, each at its own rate.
  • Live sessions' reservations are already taken out, and reported as heldByLiveSessionsMicrocredits.
  • unlimited is true when sessions are not charged, whatever the buckets say.
  • nextExpiry lists the credits that will expire, soonest first.
  • Readable by any key with sessions or avatars:read (an avatar-scoped key included), or a signed-in user of the account.

Authorization

headerX-Api-Key<token>

Your secret API key (sk_atmee_...; older keys start sk_live_), sent as X-Api-Key. Keep it on your server and never send it to a browser.

Response Body

The balance.

application/json
  1. response
wallet*"direct"

The wallet API usage spends; always direct.

Value in"direct"
spendableMicrocredits*integer

What a session is admitted on for this caller (see the operation).

Formatint64
planMicrocredits*integer

Credits of the plan's cycle grant left. Negative when the bucket is in debt.

Formatint64
topupMicrocredits*integer

Purchased credits left.

Formatint64
couponMicrocredits*integer

Coupon credits left.

Formatint64
couponSpendable*boolean

Whether coupon credits pay for this key's sessions. True for every key (one kind of credit); false only from older billing, for a metered key.

v2SpendableMicrocredits?integer

No longer reported (one kind of credit; Atmee V2 access decides who may build V2, GET /v1/account v2Access). Kept for older clients.

Formatint64
heldByLiveSessionsMicrocredits*integer

Reserved by sessions running now (already taken out of the buckets); what they do not use comes back when they end.

Formatint64
unlimited*boolean

Sessions are not charged (an unlimited plan, or billing switched off).

nextExpiry*array<>

Credits that will expire, soonest first.

Example Request
curl -X GET 'https://api.atmanity.us/v1/account/balance'
Example Response
{  "wallet": "direct",  "spendableMicrocredits": 0,  "planMicrocredits": 0,  "topupMicrocredits": 0,  "couponMicrocredits": 0,  "couponSpendable": true,  "v2SpendableMicrocredits": 0,  "heldByLiveSessionsMicrocredits": 0,  "unlimited": true,  "nextExpiry": [    {      "bucket": "string",      "amountMicrocredits": 0,      "expiresAt": "2019-08-24T14:15:22Z"    }  ]}