usage

The key owner's balance and every endpoint's cost

The allowance of the key's owner for the current month, what their keys spent and what remains, when it resets, their purchased credits left, and what every keyed endpoint costs in API credits. ownerType says whose balance it is: the user's own on a personal key, the organisation's on an organisation key. The allowance pays first, then purchased credits, no more of them in a month than spendLimit less purchasedSpent; a call is refused with 402 when its cost exceeds remaining and what purchased credits may still pay together. This call costs nothing and is served whatever the balance. Costs 0 API credits (call class free).

get/v1/balance

Request

  • Base URL: https://api.mermaid.ai
  • URL: https://api.mermaid.ai/v1/balance
  • Auth: HTTP bearer

Response

The owner's month and the endpoint costs

ownerType'user' | 'organisation' required

Whose balance: the key owner's own on a personal key, the organisation's on an organisation key

monthstring required

The current calendar month, YYYY-MM, UTC

allowanceinteger required

The owner's API credits per month across all their keys

spentinteger required

The API credits charged to all the owner's keys this month, purchased ones included

remaininginteger required

What is left of the allowance, never below zero; purchased credits are apart

resetAtstring date-time required

When the allowance resets: the first instant of next month, UTC

purchasedSpentinteger required

The purchased API credits charged to the owner's keys this month

spendLimitinteger nullable required

The most purchased API credits the keys may spend in a calendar month, UTC; null, no limit

Changes

No recorded changes to this operation across all 1 revision of this API.