AI Ad Reviews
Automation and teams

Your First AI Video Ad API Call for 3 Cents: A curl Walkthrough

An AI video ad API tutorial that climbs a cost ladder: a free estimate, a 3-credit script, then short renders, with idempotency keys, long-polls and webhooks.

The first call to Mantinea's video ad API should cost nothing, and the second should cost three cents. A price check with estimate_only is free. A script call is 3 credits, and it exercises the same key, auth header and idempotency handling as a render. Only once those work does it make sense to spend 150 credits on a 10-second talking-actor clip, then 450 on a 30-second ad. This walkthrough climbs that ladder in order.

API details come from Mantinea's public docs; prices from its list read on 24 November 2026, at one cent a credit.

A note on paths: this post doesn't hard-code operation paths, header names or body fields. Copy those from the OpenAPI 3.1 document and the API and MCP help page, not from a blog. Anything in <...> below is a value to take from the spec.

The cost ladder

RungCallCreditsDollarsWhat it proves
1Any paid call with estimate_only0$0Auth works; the price comes back
2Script3$0.03Real job start, idempotency, job polling
310-second narrated clip (3 per second)30$0.30A video asset comes back
410-second talking actor (15 per second)150$1.50Actor rendering end to end
530-second talking actor or Pro actor450$4.50A full ad
Ladder total633$6.33

The 14-day trial gives 1,000 credits with no card, and the API is on every plan, so the whole ladder fits with room for a retry. For reference, the lip-sync route is 40 credits per second (1,200 for 30 seconds, $12), and hooks are 2 credits.

Setup

You need a Mantinea account, curl, jq and about ten minutes.

Create a key with the generate scope. Keys come as read, generate or admin; an admin key in a script can do far more damage if it leaks.

export MANTINEA_KEY="paste-your-key-here"
export MANTINEA_API="https://app.mantinea.com/api/v1"

Keep the key in a secret manager, not the repo.

Load the OpenAPI 3.1 document into Postman, Insomnia or an SDK generator, and note three things: how the key is sent (<AUTH_HEADER>), the operation that starts a job (<START_JOB_PATH>) and the one that gets or waits on a job (<GET_JOB_PATH>).

Rung 1: the free estimate

curl -sS -X POST "$MANTINEA_API/<START_JOB_PATH>" \
  -H "<AUTH_HEADER>: $MANTINEA_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "estimate_only": true, "<job fields from the spec>": "..." }' | jq

Check the number against the ladder. One trap: the "Auto" talking-actor route reserves at 40 credits per second and charges whichever route actually ran, so a 30-second Auto estimate shows a 1,200-credit reserve even if it ends up at 450.

Rung 2: a script, with an idempotency key

Drop estimate_only, switch the job fields to a script, and add an idempotency key: one unique value per logical job. Retry with the same key after a network drop and the API won't start a second job.

JOB_KEY="first-script-$(date +%s)"

curl -sS -X POST "$MANTINEA_API/<START_JOB_PATH>" \
  -H "<AUTH_HEADER>: $MANTINEA_KEY" \
  -H "<IDEMPOTENCY_HEADER_OR_FIELD>: $JOB_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "<script job fields from the spec>": "..." }' | tee job.json | jq

Save the job id. A started job reserves its quote; you pay for what ran, never more. Failed or canceled jobs refund automatically.

What a missing idempotency key costs: nothing much on a script, 450 credits on every accidental duplicate of a 30-second render. More on retries in idempotency keys in the Mantinea API.

Waiting for the result

Long-poll: the API holds a request for up to 50 seconds, and renders usually take a few minutes, so loop.

JOB_ID=$(jq -r '<path to the id in job.json>' job.json)

until curl -sS "$MANTINEA_API/<GET_JOB_PATH with $JOB_ID>" \
      -H "<AUTH_HEADER>: $MANTINEA_KEY" | tee status.json \
      | jq -e '<expression true when done>' >/dev/null; do
  echo "still running..."
done
jq '<path to the result>' status.json

Webhooks: beyond testing, register one. Events are signed and cover a job or workflow run succeeding, failing or being canceled. Failed deliveries retry at 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours. Verify the X-Autonomous-Signature header before trusting the payload ("Autonomous" is an older product name that still shows up in developer surfaces).

Rungs 3 to 5

Same calls, different job fields: a 10-second narrated clip, then a 10-second talking actor, then the 30-second ad. Run an estimate before each new job type. It catches a wrong duration before it costs anything.

Limits, and what they mean for a catalog

LimitValueFor a 300-product catalog
Requests per minute per key600Plenty, if you long-poll instead of hammering
Paid starts per minute per key60At least 5 minutes of starts
Jobs per batch call506 batch calls
Long-poll waitUp to 50 secondsFewer status requests

Three hundred 15-second talking-actor ads at 225 credits each is 67,500 credits, $675. Price the batch with estimate_only before you send it; estimate_only explained covers batch pricing.

Mistakes that cost credits

  • An admin key in scripts. Use generate.
  • Skipping the estimate on a new job type.
  • A new idempotency key per retry. The key names the job, not the attempt.
  • Polling with no wait, which wastes your 600 requests a minute.

After the first ad

  • Captions (2 credits) or Brand finish (captions, logo and end card, 2 credits per started minute) in a follow-up call.
  • The automatic video quality check is on the API, as are reviews and approvals, so a finished asset can go to client review without leaving your pipeline.
  • Prefer an assistant to curl? Point Claude or Cursor at the hosted MCP server at https://app.mantinea.com/mcp, which supports ?mode=estimate.
  • The AI video ad API page has the overview.

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.