AI Ad Reviews
Automation and teams

Batching Ad Renders Through the API: Quoting a 50-Job Pack Before It Runs

A batch ad rendering API walkthrough for agencies: a 48-job, four-client pack quoted at $108, why Auto can reserve 2.7x that, and safe chunking and retries.

Four clients, four hooks each, three actors per hook, 15-second ads: that's 48 jobs, and it fits in a single Mantinea batch call, which takes up to 50. At 15 credits per second the pack costs 10,800 credits, $108. If the route is left on "Auto", though, the quote reserves 28,800 credits, because Auto holds 40 credits per second until it knows which route ran. Your balance check needs to know which of those two numbers it's looking at. This walkthrough builds the pack, quotes it properly, submits it and tracks it.

API facts come from Mantinea's public docs; prices from the 24 November 2026 price list. Paths and field names in the code are placeholders. Generate a client from the OpenAPI 3.1 spec and use its names.

The pack, priced three ways

VersionWhat rendersCreditsDollars
Explicit standard route, 9:16 only48 × 15 s × 15 per second10,800$108
Same, with "Auto" left onReserve at 48 × 15 s × 40 per second; charged at the route that ran28,800 reservedCharged as it ran
Rendering 9:16, 1:1 and 16:9 natively3 × 10,80032,400$324
Rendering 9:16, then resizing to two more ratios10,800 + 96 resizes at 1 credit10,896$108.96
Captions on all 4848 × 296$0.96

Two rules come out of that table. Pick the route explicitly when a budget check depends on the quote. And keep ratios out of the matrix: render one, resize the rest, ideally only for winners.

On plans, 10,800 credits is more than Growth's 8,200 but fits Pro's 21,000 at $199, with room for the following week's hook tests.

When batching fits

Batch jobs that are known up front and independent: every cell of a matrix, every SKU in a drop, every language of an approved master. Don't batch chains where step two needs step one's output, such as rendering and then hook-testing the winner. That's a workflow, and the Workflows canvas or an agent turn handles dependencies better than custom code. A strategist without a developer can get the same matrix from the in-app Variations matrix, which shows "N x M x K = T creatives, ~C credits" before it runs.

Step 1: build the jobs with stable keys

import { createHash } from "node:crypto";

const clients = ["acme", "brightco", "nordic", "zest"];
const actors = ["actor_kitchen_a", "actor_gym_b", "actor_desk_c"];

const jobs = clients.flatMap(client =>
  HOOKS[client].flatMap(hook =>          // 4 hooks per client
    actors.map(actor => {
      const script = `${hook} ${BODY[client]}`;
      const digest = createHash("sha256").update(script).digest("hex").slice(0, 12);
      return {
        client, actor, script,
        seconds: 15,
        route: "<explicit standard route from the spec>",
        idempotency_key: `${client}:${WEEK}:${digest}:${actor}`,
      };
    })
  )
); // 4 x 4 x 3 = 48

The idempotency key is built from the job's content, so a resend after a timeout gets back the original job instead of starting and charging a second render. A random key made at retry time defeats the purpose. The full retry pattern is in idempotency keys in the Mantinea API.

Step 2: quote, then compare to budget in code

const quote = await api.batch(jobs, { estimate_only: true });
const byClient = groupCredits(quote, jobs);   // sum per client

for (const [client, credits] of Object.entries(byClient)) {
  if (credits > WEEKLY_BUDGET[client]) {
    throw new Error(`${client} over budget: ${credits} credits`);
  }
}

Each client's share here is 2,700 credits, $27. If a client's quote comes back near 7,200 instead, someone left Auto on.

Step 3: chunk, pace, submit

const chunk = (xs, n = 50) =>
  Array.from({ length: Math.ceil(xs.length / n) }, (_, i) => xs.slice(i * n, i * n + n));

for (const part of chunk(jobs)) {
  const res = await api.batch(part);   // generate-scoped key
  saveJobIds(res, part);               // map job ids to idempotency keys
  await paceForPaidStarts(part.length);
}

Limits are 600 requests and 60 paid starts per minute per key. Assume each job in a batch counts toward paid starts, so 48 jobs sit under one minute's allowance, while a 180-job week needs pacing across several minutes. Confirm in the docs how batches count. Pacing is covered in API rate limits decoded.

For agencies, one generate-scoped key per client is cleaner: limits apply per key, so one client's runaway loop can't starve the others.

Step 4: track each job

A batch is a way to submit, not a unit of success. Each job finishes, fails or is canceled on its own.

MethodBest forBehavior
Signed webhooksPipelinesJob events, retried at 1 min, 5 min, 30 min, 2 h, 6 h and 12 h until acknowledged
Long-pollScripts you're watchingWaits up to 50 seconds per request

Store state per job id, and mark a client's pack done when all twelve of its jobs reach a final state. Failed or canceled jobs refund automatically, so a partial failure costs only the jobs that ran. Fix the cause and resubmit the failed jobs with their original keys.

Step 5: finish and hand off

  1. Captions at 2 credits each, or Brand finish at 2 credits per started minute.
  2. Resize only the candidates that win, at 1 credit per ratio.
  3. Open a client review through the API; reviews and approvals are on the public API as well as in the app.

Pre-flight checklist

  • Matrix from creative dimensions; one ratio rendered, the rest resized
  • Route set explicitly where budgets are checked
  • Content-based idempotency key on every job
  • estimate_only quote per batch, compared to each client's budget
  • Chunks of 50 or fewer, paced under per-key limits
  • Per-job tracking by webhook or long-poll
  • A review request at the end

The API, batching and webhooks are on every plan from $29 a month. The 14-day trial (1,000 credits, no card) runs a four-job test batch of 15-second ads, 900 credits, end to end before you point it at client work.

The AI Ad Reviews editors

We turn AI ad tool pricing into dollars per ad, so you can compare plans without a spreadsheet of your own. We work from vendors' own pricing pages, docs and help centers, and date every price we quote. About us.