Endpoints

Balance & usage

Two endpoints for monitoring your account: a snapshot of the current credit balance and pricing constants, and a paginated feed of recent credit transactions.


Get balance

GET https://api.dessert.dev/v1/balance Try it →

Request

curl
Python
TypeScript
MCP
curl https://api.dessert.dev/v1/balance \
  -H "Authorization: Bearer $DESSERT_API_KEY"
requests.get(
    "https://api.dessert.dev/v1/balance",
    headers={"Authorization": f"Bearer {os.environ['DESSERT_API_KEY']}"},
).json()
await fetch("https://api.dessert.dev/v1/balance", {
  headers: { Authorization: `Bearer ${process.env.DESSERT_API_KEY}` },
}).then(r => r.json());
{ "tool": "dessert.get_balance", "arguments": {} }

Response

FieldDescription
credits_balanceintegerCurrent credit balance.
credits_balance_usd_equivalentnumberBalance restated in USD ($0.10 per credit).
credits_lifetime_purchasedintegerAll-time credits purchased on this account.
auto_recharge_enabledbooleanWhether auto-recharge will kick in when balance drops.
auto_recharge_thresholdintegerBalance below which auto-recharge fires.
auto_recharge_amount_usdnumberUSD amount that gets charged when auto-recharge fires.
pricingobjectThe current per-ad credit cost — see Credits & pricing.
{
  "credits_balance": 205,
  "credits_balance_usd_equivalent": 20.50,
  "credits_lifetime_purchased": 500,
  "auto_recharge_enabled": true,
  "auto_recharge_threshold": 20,
  "auto_recharge_amount_usd": 25.0,
  "pricing": {
    "credit_usd": 0.10,
    "static_ad_credits": 5,
    "full_ad_credits": 15
  }
}

Recent usage

GET https://api.dessert.dev/v1/usage Try it →

The last 50 credit transactions on your account, most recent first.

Request

curl
Python
TypeScript
curl https://api.dessert.dev/v1/usage \
  -H "Authorization: Bearer $DESSERT_API_KEY"
requests.get(
    "https://api.dessert.dev/v1/usage",
    headers={"Authorization": f"Bearer {os.environ['DESSERT_API_KEY']}"},
).json()
await fetch("https://api.dessert.dev/v1/usage", {
  headers: { Authorization: `Bearer ${process.env.DESSERT_API_KEY}` },
}).then(r => r.json());

Response

FieldDescription
typestringOne of Deduction, Purchase, Bonus, Refund.
credits_deltaintegerSigned credit change (negative for deductions).
balance_afterintegerBalance immediately after the transaction.
usd_amountnumberUSD amount, when the transaction involved real money.
descriptionstringHuman-readable note (e.g. "API ad generation (count=3, format=full)").
atstringISO 8601 timestamp.
{
  "recent_transactions": [
    {
      "type": "Deduction",
      "credits_delta": -45,
      "balance_after": 205,
      "usd_amount": null,
      "description": "API ad generation (count=3, format=full)",
      "at": "2026-05-19T18:24:01.000Z"
    },
    {
      "type": "Purchase",
      "credits_delta": 250,
      "balance_after": 250,
      "usd_amount": 25.0,
      "description": "Auto-recharge",
      "at": "2026-05-19T18:23:48.000Z"
    },
    {
      "type": "Bonus",
      "credits_delta": 50,
      "balance_after": 50,
      "usd_amount": null,
      "description": "Welcome bonus",
      "at": "2026-05-12T15:08:22.000Z"
    }
  ]
}