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
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
| Field | Description |
|---|---|
| credits_balanceinteger | Current credit balance. |
| credits_balance_usd_equivalentnumber | Balance restated in USD ($0.10 per credit). |
| credits_lifetime_purchasedinteger | All-time credits purchased on this account. |
| auto_recharge_enabledboolean | Whether auto-recharge will kick in when balance drops. |
| auto_recharge_thresholdinteger | Balance below which auto-recharge fires. |
| auto_recharge_amount_usdnumber | USD amount that gets charged when auto-recharge fires. |
| pricingobject | The 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
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
| Field | Description |
|---|---|
| typestring | One of Deduction, Purchase, Bonus, Refund. |
| credits_deltainteger | Signed credit change (negative for deductions). |
| balance_afterinteger | Balance immediately after the transaction. |
| usd_amountnumber | USD amount, when the transaction involved real money. |
| descriptionstring | Human-readable note (e.g. "API ad generation (count=3, format=full)"). |
| atstring | ISO 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"
}
]
}