Mager API

Moods and billing

What a mood is, how the multiplier changes the cost, and how to check your balance.

Generation is paid for in moods, the same balance the Mager dashboard uses. One account, one balance, whether the work comes from the product or from the API.

What a task costs

Every task response carries a billing object:

"billing": {
  "base_moods": 10,
  "charged_moods": 15,
  "extra_moods_charged": 5
}
  • base_moods — what the generation itself costs. Set by the model and the tier you asked for.
  • charged_moods — what you actually pay: ceil(base_moods × price_multiplier).
  • extra_moods_charged — the difference, charged_moods − base_moods.

The multiplier is a per-account rate agreed for API access. A multiplier of 1.5 on a 10-mood generation costs 15 moods.

Cost depends on the model, the model_tier, and output_count. Asking for four outputs costs roughly four times one.

Checking your balance

curl https://api.mageran.ai/api/v1/balance \
  --header 'x-mager-api-key: YOUR_API_KEY'
{
  "moodsBalance": 250,
  "moodsUsed": 50,
  "moodsGranted": 300,
  "priceMultiplier": 1.5,
  "rateLimit": {
    "perMinute": 60,
    "perDay": 5000,
    "accountPerMinute": 60,
    "accountPerDay": 5000
  }
}

moodsBalance is what you have left. moodsGranted is the lifetime total added to the account.

This endpoint needs the BALANCE scope.

Running out

A task that would take you below zero is rejected rather than partially run. Check the balance before a batch, or handle the failure and surface it — a job that dies mid-batch with no explanation is the worst version of this.

Treat GET /balance as a health check, not a per-request call. Reading it before every generation wastes your rate limit on a number that changes slowly.

On this page