Public API v1

Tokens this key can spend

Changed on

remaining is the largest request the key can pay for right now. A request is paid by ONE plan — the key’s own plan when it can, otherwise another active plan of the account — so this is the most room any single plan has (the lowest of its total, daily and weekly caps), never a sum. plan details the plan that number is measured on. spendableTokens is the sum: what all the plans that may pay can still spend, request after request — the running total, which drops by each request’s cost. totalRemainingTokens sums every active plan on the account. The cost of a request is characters (minimum 50) × engine billingMultiplier × globalMultiplier — see GET /v1/engines.

get/api/v1/balance

Request

  • Base URL
    https://api.vieneu.io
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Response

What this key can spend, and the plan that measures it.

remainingnumber required

The largest request this key can pay for right now. A request is paid by ONE plan: the key’s own plan when it can, otherwise another active plan of the account that covers the default engine. This is the most room any single one of them has (the lowest of its total, daily and weekly caps) — never a sum. A request costing more is refused with 403 (or 429 for a daily/weekly cap).

spendableTokensnumber required

What this key can spend in total right now, request after request: the room left on every plan that may pay its requests (its own plan, then the account’s other active plans that cover the default engine), each counted only up to its own daily and weekly caps, added up. Each request lowers it by what it cost, whichever of those plans paid. Equal to remaining when only one plan can pay. One request can still spend no more than remaining.

activeGrantsnumber required

Active plans on the account. When this key’s own plan cannot pay for a request, another one pays for it.

totalRemainingTokensnumber required

Remaining tokens summed over every active plan of the account.

Example response

{
  "remaining": 15000,
  "spendableTokens": 20000,
  "plan": {
    "totalTokens": 5000000,
    "remainingTokens": 4984210,
    "dailyRemaining": 15000,
    "status": "ACTIVE"
  },
  "activeGrants": 2,
  "totalRemainingTokens": 9984210
}

Changes

    • info

      added the required property ///// to the response with the status

    • info

      added the required property to the response with the status

    • info

      endpoint added