API & Developer Guides

How to Estimate API Credit Spend Before a Batch Run Using Your Dashboard Balance and the $0.01 Per Mockup Price

By Mockupanda11 min read
How to Estimate API Credit Spend Before a Batch Run Using Your Dashboard Balance and the $0.01 Per Mockup Price

Running a large mockup generation job without checking your balance first is a bit like starting a long drive without glancing at the fuel gauge. Everything feels fine until it suddenly is not. If your wallet runs dry mid-batch, Mockupanda returns an INSUFFICIENT_CREDITS error and stops processing before any charge is applied to that failed request. That is good news for your wallet, but it means your job is incomplete and you have to retry those requests after adding funds.

The good news is that you can now avoid that situation entirely. The Dashboard lets you turn on automatic refills so your balance tops itself up whenever it drops below a level you set. This guide covers the full pre-flight process: reading your current balance, doing the arithmetic for your planned run, accounting for batch mode, and deciding whether to top up manually or let automatic refills handle it for you.

Understanding the Credit System Before You Do Any Math

One Credit, One Mockup, One Cent

The pricing model on Mockupanda is about as simple as it gets. Every credit is worth exactly $0.01 USD, and every successfully generated mockup costs exactly one credit. That relationship holds regardless of template complexity, output resolution, or whether you are rendering a single-frame poster or a multi-frame diptych.

Here is how that scales:

  • 100 mockups = 100 credits = $1.00 USD

  • 1,000 mockups = 1,000 credits = $10.00 USD

  • 10,000 mockups = 10,000 credits = $100.00 USD

There are no volume discounts and no bonus credits on top-ups. Every dollar you add converts at the same flat rate, so the math is always the same: number of mockups you need equals number of credits you need equals that number of cents.

One important thing to flag right away: credits never expire and there are no monthly fees on the API wallet. Your API wallet is also completely separate from your web app subscription. Credits are only consumed by API requests, not by mockups you generate inside the web editor. So if you top up more than you need for a particular run, the remainder sits in your wallet indefinitely and is available for the next job.

What Counts as a Billable Mockup

Only successful mockup generation consumes credits. Failed requests cost zero credits. That means if a request returns an error (network timeout, invalid template ID, malformed payload), you are not charged for it. This is worth keeping in mind when you are estimating: your credit budget should reflect the number of mockups you expect to succeed, not the total number of requests you plan to send.

With batch requests, the full credit amount for all templates in the batch is checked against your balance before generation starts, and deducted once all mockups in the batch have been generated. Multi-frame templates (diptychs, triptychs) where you pass multiple artwork URLs for a single template still cost one credit per template render. The credit is attached to the template, not the number of frames.

Takeaway: Your credit budget is always (designs x templates). One credit, one mockup, one cent, no exceptions.

Reading Your Current Balance

Checking the Dashboard

The fastest way to see your balance is to log in and navigate to Dashboard, then Billing. Your balance is displayed in USD alongside an estimate of how many mockups it covers. This is the most human-readable view and it is where you will also go to add funds or configure automatic refills.

The minimum top-up amount is $5.00 USD and the maximum per transaction is $1,000.00 USD. Payment is handled through Stripe, which accepts Visa, Mastercard, Amex, debit cards, Apple Pay, and Google Pay. Credits land in your wallet as soon as the payment is confirmed, so there is no delay between paying and being able to run your job. If you need more than $1,000.00 at once, you can top up more than once.

Pulling Your Balance Programmatically

If you want to check your balance as part of an automated workflow or just want the raw numbers, the GET /billing/wallet endpoint returns your current balance and recent transactions:

curl -X GET https://www.mockupanda.com/api/v1/billing/wallet \
  -H "Authorization: Bearer YOUR_SUPABASE_ACCESS_TOKEN"

Note a critical detail here: this endpoint is authenticated with a logged-in dashboard session, not with an API key. If you send an mk_ API key, you will get a 401 response. This endpoint cannot be called from a server-to-server integration.

The response looks like this:

{
  "wallet": {
    "balance_cents": 1250,
    "lifetime_topup_cents": 5000,
    "lifetime_spent_cents": 3750
  },
  "mockup_cost_cents": 1,
  "transactions": [...]
}

The field you care about most is balance_cents. Divide that by mockup_cost_cents to get the exact number of mockups your current balance will cover. In the example above: 1250 divided by 1 equals 1,250 mockups remaining.

The mockup_cost_cents field is included deliberately as a live figure rather than a hardcoded assumption. If the price ever changes, your calculation will still be correct because it reads the actual current rate from the API.

Takeaway: Before any large run, open Dashboard, Billing, note the USD balance, and divide by $0.01 to get your mockup capacity. Or fetch GET /billing/wallet and do the same division with balance_cents / mockup_cost_cents.

Calculating What Your Batch Run Will Cost

The Basic Formula

Once you know your balance, estimating the cost of a planned run is straightforward:

Credits needed = number of designs x number of templates per design

Say you have 50 designs and you want to render each one across 20 templates. That is 50 x 20 = 1,000 mockups = 1,000 credits = $10.00 USD.

If your current balance_cents is 450 (meaning $4.50), you have a shortfall of 550 credits ($5.50). You would top up at least $5.50, but since the minimum top-up is $5.00 and $5.00 alone would not cover the gap, you would add $10.00 to comfortably cover the run and leave a buffer.

The formula is always:

  • Mockups needed = designs x templates per design

  • Credits needed = mockups needed (1:1 ratio)

  • Shortfall = credits needed minus current balance (if positive, top up; if negative, you are covered)

  • Top-up amount = the shortfall, but at least $5.00, since the minimum top-up is $5.00

Accounting for Batch Mode

Batch mode lets you pass up to 12 template IDs in a single API request using the template_ids parameter, which dramatically reduces the number of HTTP calls your code makes. But it is important not to confuse request count with credit count.

Each template in a batch request generates one mockup and costs one credit. If you send one request with 12 template IDs, that is 1 request but 12 credits consumed. The batch size limit affects your request count, not your credit math.

For large catalog runs, understanding both numbers matters. You might plan 5,000 mockups (5,000 credits, $50.00) and need roughly 417 API requests to send them in batches of 12. Your credit budget is driven by the total mockup count, not by how many requests it takes to send them.

If you want to go deeper on how to structure batch requests efficiently, the approach is covered well in the context of generating 12 mockup variations per design in a single API call.

Takeaway: Calculate credits using (designs x templates), not (number of API requests). Batch mode reduces requests but each template in a batch still costs one credit. Plan your top-up against the total mockup count.

Keeping Your Balance Topped Up: Manual and Automatic Options

Manual Top-Ups

The straightforward approach is to add credits by hand before you run. Go to Dashboard, then Billing, enter your top-up amount in USD, and complete payment via Stripe. Credits appear immediately once the payment is confirmed. This works well for occasional runs where you know the scope in advance and want full control over when money moves.

A practical buffer is 10 to 15 percent above your estimate. For a 1,000-mockup run, top up to 1,100 or 1,150 credits ($11.00 to $11.50). Since credits never expire, any unused balance rolls into your next run.

Automatic Refills

If you run batches regularly or want unattended jobs to complete without you watching the balance, automatic refills are the better option. In Dashboard Billing, you pick a balance level to refill at and an amount to add. Whenever your balance drops below the threshold you set, your saved card is charged automatically and credits are added to your wallet. Refills stay off until you turn them on.

With automatic refills active, a batch no longer stops halfway because the wallet ran dry. The balance refills on its own as the job runs. You no longer need to pause mid-run, check the dashboard, add funds, and retry the remaining requests. For anyone running large or regularly scheduled jobs, turning on automatic refills is the simpler way to work.

For context on how to think about wallet management over time, the approach to forecasting and controlling monthly mockup costs is worth reading alongside this guide.

Top-Up Amounts and What They Cover

Here is a quick reference for how the standard top-up amounts map to mockup capacity:

Top-up amount

Credits

Mockups covered

$10.00

1,000

1,000

$25.00

2,500

2,500

$40.00

4,000

4,000

$100.00

10,000

10,000

These are just examples; you can enter any value between $5.00 and $1,000.00.

Takeaway: For occasional runs, top up by hand with a small buffer before you start. For regular or unattended jobs, turn on automatic refills in Dashboard Billing so your balance stays funded without you having to intervene.

Putting It All Together: A Pre-Run Checklist

Step One: Define the Scope of Your Run

Before you open your wallet, nail down exactly what you are generating. Write out:

  1. Number of designs (artwork files) you are processing

  2. Number of templates you want per design

  3. Total mockups = (1) x (2)

  4. Total credits needed = same number as (3)

  5. Total cost = credits needed x $0.01

If you are using Sets via the API, you can call GET /sets/{id} to retrieve the number of templates in a set, which makes it easy to calculate the per-design cost without counting templates manually. That approach is covered in more detail for people rendering a full collection with a single request.

Step Two: Check Your Current Balance

Log in, go to Dashboard, then Billing, and note your balance in USD. Convert to credits by multiplying by 100 (since 1 USD = 100 credits). Or fetch GET /billing/wallet and read balance_cents directly.

Subtract your required credits from your current balance:

  • If the result is positive, you are covered. Consider whether you still want a small buffer.

  • If the result is negative, that is your shortfall. Round up to the nearest top-up amount that covers the shortfall plus a buffer.

Step Three: Top Up or Enable Automatic Refills

If you need to add funds manually, go to Dashboard, then Billing, enter your top-up amount in USD, and complete payment via Stripe. Credits appear immediately once the payment is confirmed.

Alternatively, if you want your balance to manage itself, go to Dashboard Billing and turn on automatic refills. Set the balance threshold and the refill amount, and your saved card will be charged automatically whenever your balance drops below that level. This is the better choice for large or repeated runs where stopping to top up mid-job would be disruptive.

Step Four: Verify Before You Fire the First Request

Do one final balance check immediately before starting the run. If you are running this from a script, you can fetch GET /billing/wallet and assert that balance_cents is greater than or equal to the credits your run requires, then proceed.

Step Five: Monitor During the Run

Budget limits and usage caps are not built into the API, so if you are running a large unattended job without automatic refills, consider tracking in your code how many credits you have used and checking your balance in Dashboard Billing during the run. If you have automatic refills turned on, this monitoring is less critical since the balance will top up on its own, but it is still a useful way to audit how many mockups were generated and what they cost.

Takeaway: The five-step checklist (scope, check, calculate shortfall, top up or enable refills, verify) takes about five minutes and prevents the frustration of a mid-run stop. Make it a standard part of your batch job setup.

Common Estimation Mistakes and How to Avoid Them

Confusing Requests With Mockups

This is the most common slip. If you batch 12 templates per request, 100 requests equals 1,200 mockups, not 100. Always calculate your credit budget from the total mockup count, not the total request count.

Forgetting That the API Wallet Is Separate

Your web app subscription (Free, Starter, Pro, or Lifetime) does not share a balance with your API wallet. Downloads on the web app do not consume API credits, and API calls do not count against your web app download limit. If you are used to tracking credits in your web app context, remember that the API wallet is a completely separate prepaid balance that you fund independently.

Underestimating Retries

If your code retries failed requests (which is good practice), those retries consume credits when they succeed. A job that you estimated as 1,000 mockups might actually generate 1,010 successful renders if 10 requests were retried after a transient error. Build at least a small buffer to account for this. With automatic refills turned on, retries are much less likely to cause a problem, but the buffer is still worth having.

Not Accounting for Multi-Frame Templates

A diptych or triptych template still costs one credit even though it displays multiple artwork images. If your run includes multi-frame templates, you are still paying one credit per template render, not one credit per artwork URL. This is actually in your favor (you get more output per credit), but it means your credit estimate does not change just because you are using multi-frame templates.

Takeaway: The two numbers to keep straight are: total mockups (equals credits), and total API requests (equals mockups divided by batch size, rounded up). Credits follow the first number, not the second.


Estimating your credit spend before a batch run is not complicated, but skipping it is a risk that is easy to avoid. With a flat $0.01 per mockup rate and a balance that is always visible in your Dashboard or via the GET /billing/wallet endpoint, the math takes about two minutes. Do the calculation, add a buffer, top up if needed (or turn on automatic refills so it handles itself), verify once more, then run. Mockupanda handles the rest.