A webhook delivery costs nothing. What it triggers can cost a lot. If your handler receives a "job succeeded" event and responds by sending the finished ad into a five-language lip-synced translation, that next step is 1,400 credits, $14, on a 30-second ad. Process the same event twice because a retry arrived, and you've paid $28 for one pack. Every design choice below is about making sure a retried webhook can never trigger a paid step twice.
The facts are from Mantinea's public developer docs as of November 2026, and prices from its list of 24 November 2026 (1 credit = $0.01). Check the API and MCP help page for exact payload field names before you write a parser.
What can be doubled
The webhook itself is free, and failed or canceled jobs refund their credits automatically, so the failure path doesn't need any money handling. The risk sits entirely in what your handler does on success. Typical follow-up steps and their list price for a 30-second ad:
| Follow-up on "succeeded" | Credits | Cost if run twice |
|---|---|---|
| Burn captions | 2 | $0.04 |
| Brand finish (captions, logo, end card) | 2 per started minute | $0.04 |
| Resize to two more ratios | 2 | $0.04 |
| Audio-only dub, five languages | 225 | $4.50 |
| Lip-synced translation, five languages | 1,400 | $28.00 |
| Three new 3 s openings in Hook lab | 108 | $2.16 |
The cheap steps don't matter much. Translation and anything that renders a talking actor do. A pipeline that processes a few hundred ads a month can lose real money to a handler that isn't safe to run twice.
The events and the signature
Mantinea sends signed events for two objects, a job (one generation, edit or translation) and a workflow run (a whole pipeline), each with three outcomes: succeeded, failed and canceled. A feed pipeline that submits individual jobs wants job events. A team that starts workflows from an inbound trigger URL usually only needs the workflow-run event, which fires once at the end instead of once per step.
Every delivery carries an X-Autonomous-Signature header. Autonomous is an older product name that still appears in developer surfaces. Check the signature against your webhook secret before reading the body, and follow three rules that apply to any signed webhook:
- Verify against the raw request bytes. Parsing the JSON and re-serializing it can change the bytes and break the check.
- Compare with a constant-time function, such as
crypto.timingSafeEqualin Node orhmac.compare_digestin Python. - On a bad signature, return an error status, log it and stop. Don't echo details.
Compute the expected value exactly as the docs specify rather than from any blog post, this one included.
When retries arrive
If your endpoint doesn't acknowledge a delivery, Mantinea retries on this schedule:
| Attempt | Delay after the first try |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 6 hours |
| 6th retry | 12 hours |
A three-minute deploy loses nothing; the first or second retry catches it. An overnight outage still has later retries, hours apart, but if your endpoint has been down longer than the schedule covers, don't wait. List job states through the API and reconcile.
The case that causes double billing is quieter. Your handler does the work, then takes too long to respond. The platform sees no acknowledgment and retries. The work was done, but you'll get the event again.
A handler that is safe to run twice
The order is: verify, record, acknowledge, then work. The record step is what stops a retry from reaching the paid follow-up.
app.post("/hooks/mantinea", express.raw({ type: "*/*" }), async (req, res) => {
const sig = req.get("X-Autonomous-Signature");
if (!verifySignature(req.body, sig, process.env.MANTINEA_WEBHOOK_SECRET)) {
return res.sendStatus(401);
}
const event = JSON.parse(req.body.toString("utf8"));
const key = dedupeKey(event); // event id plus job or run id
const inserted = await db.insertIfAbsent("webhook_events", key, event);
if (!inserted) return res.sendStatus(200); // seen before: acknowledge, do nothing
await queue.add("process-mantinea-event", { key });
return res.sendStatus(200); // respond in milliseconds
});
The insert has to be atomic, a unique constraint on the key rather than a read followed by a write. Two retries arriving close together will otherwise both pass a "have I seen this" check.
In the worker, each outcome gets its own path:
- Succeeded: fetch the asset. Results come as assets with signed URLs, so refresh them if they've expired. Then run the next step, open a review item or post to Slack. Give that next paid job its own idempotency key derived from the event key, so even a worker-level retry can't start it twice.
- Failed: alert someone, and resubmit only if the cause is on your side. Reuse the original idempotency key only if you want the original job back; a retry with changes needs a new key.
- Canceled: mark it and move on. A person canceled it deliberately.
A test plan and its budget
Run these against a staging endpoint before production. A narrated 10-second clip at 3 credits a second makes a good test job.
| Test | Jobs | Credits |
|---|---|---|
| Normal success event | 1 narrated 10 s clip | 30 |
| Kill the endpoint mid-run, watch retries arrive | 1 clip | 30 |
| Replay the same event twice, confirm one follow-up | 1 clip + captions | 32 |
| Broken signature, confirm rejection | None needed | 0 |
| Workflow-run event end to end | 1 clip + captions + resize | 33 |
| Total | 125 ($1.25) |
The 14-day trial's 1,000 credits, with no card, covers this several times over.
Webhooks or long-polling
Use webhooks when a system starts the job and a system consumes the result: feed workers, launch automations, overnight batches. Use long-polling, up to 50 seconds per request, when a person is waiting, such as a CLI or an internal tool with a spinner. Many teams run both, with long-poll on the interactive path and webhooks as the record of what finished. The interactive option is covered in waiting on job status with long-polling.
The other half of an automated loop is the way in: an inbound trigger URL that starts a workflow, or a batch call through the API. The webhook-triggered ecommerce ads guide shows both halves joined up.
Webhooks, the API and inbound triggers are on every Mantinea plan from $29 a month, so there is no developer tier to price in.