Show the credit balance
https://api.mozartai.com/v1/creditsShows the user's credit balance, what this key spent today against its daily limit, what each spending operation costs, and the plans page link.
- Cost
- Free
- Rate limit
- Read
- MCP tool
get_credit_balance- CLI (coming soon)
mozart credits
When to use: Before several spends, or when the user asks how many credits are left. Show the user available: what they can spend now. balance also counts credits held by jobs still running, so it stays higher until those jobs settle. When credits run out, give the user plans_url if it is set.
When not to use: To price one request, use POST /v1/estimates. For other limits, use GET /v1/limits.
Side effects: None. Reads only; safe to repeat.
Authentication
Send your API key as Authorization: Bearer <key>. The key needs these scopes:
account:read
Response 200
Success.
balancenumberRequiredCredits on the account, including credits held by jobs that have not finished. Show users
availableinstead:balancedrops only when those jobs settle.availablenumberRequiredCredits that can be spent now: the balance minus credits held by jobs that have not finished. This is the number to show users, and the one estimates and spending checks use.
key_daily_limitnumberor nullRequiredkey_spent_todaynumberor nullRequiredplans_urlstringor nullRequiredWhere this caller gets more credits: the API pricing page for an API key spending the API wallet, the Mozart plans page for every other caller, and null for an app that shows no plan links.
walletenumRequiredAllowed valuesapiplan
allowance_creditsnumberor nullRequiredtop_up_creditsnumberor nullRequiredallowance_resets_atstringor nullRequiredoperation_creditslist of objector nullRequiredWhat each spending operation costs this caller, in credits per request or per started minute of input audio.
Show 3 properties
operationenumRequiredShow 9 values
songs.createcovers.createstems.createmidi.createmasters.createlyrics.createcoverArt.createinpaints.createstems.generate
creditsintegerRequiredat least 0perenumRequiredAllowed valuesrequestinputMinuteminuteBilledPerSecond
Response headers
x-request-idThe id of this request; quote it when asking for help.x-mozart-api-versionThe API version that answered.x-ratelimit-limitRequests allowed in the current window for this caller.x-ratelimit-remainingRequests left in the current window.x-ratelimit-resetWhen the window resets, in Unix seconds.idempotent-replayedtruewhen this answer is the stored answer to an earlier call with the same idempotency key; the work was not done again.
Errors
What to do: PUBLIC_API_RATE_LIMITED: wait retry_after_seconds, then call again.
| Status | Type | Meaning |
|---|---|---|
| 400 | invalid_request | The request is malformed or an input is invalid. |
| 401 | authentication | The key or token is missing, invalid or revoked. |
| 402 | insufficient_credits | The account has too few credits for this call. A REST key also needs an API plan (Starter, Build, Scale or Growth) or API credits; with neither, every call is refused with PUBLIC_API_CREDITS_REQUIRED. payment_required: The account's plan does not include this; it needs an upgrade. |
| 403 | permission | The caller may not do this: a missing scope, a Mozart CLI sign-in whose account is below Pro, or access not enabled. |
| 404 | not_found | The resource or route does not exist for this caller. |
| 409 | conflict | The request conflicts with the current state, or an idempotency key was reused with a different body. |
| 422 | content_refused | The input was refused by content screening. |
| 429 | rate_limited | Too many requests; retry after Retry-After seconds. limit_reached: A daily, concurrent or total limit was reached. |
| 500 | internal | Mozart failed to answer; retry later. |
| 503 | provider_unavailable | A generation provider is unavailable; retry later. service_unavailable: A Mozart check the request needs, such as content screening, is temporarily unavailable; retry after retry_after_seconds. |