Makernice
← All posts
A laptop on a desk showing a terminal, with a small film reel and a padlock beside itGuides

Batch-Generate AI Videos with Claude Code, Codex, Gemini or Grok

Makernice Team · ·

Prices as of November 2, 2026 (price list v12).

To let a coding agent such as Claude Code, Codex, Gemini or Grok batch-generate videos, give it a Makernice API key with its own spend limit and expiry date, and tell it to quote, create with an Idempotency-Key, then poll each clip. A test batch of 10 ten-second clips with seedance-2.0-fast costs $10.27 at price list v12 (November 2, 2026), and the key can't spend past its limit.

Why give the agent its own API key?

  • Set a spend limit and an expiry date on the key in the console. The key's spend is the charged plus the held amount of the generations it created; failed and canceled ones don't count.
  • Keep the key in an environment variable such as MAKERNICE_API_KEY and call the API from the agent's shell or your server. The API doesn't accept browser requests (no CORS).
  • The Usage page breaks API spend down by key and model, so the agent's batch is easy to find afterwards.
  • Disabling or deleting the key takes effect on the next request, which stops a runaway loop at once.

What can the agent check before it spends anything?

GET /v1/models lists each model's modes, durations, resolutions and optional fields, and GET /v1/pricing lists unit prices; neither needs a key. Quoting is free too, because a quote only prices the input. Have the agent read these first so it doesn't guess a field the model rejects.

# Public, no API key needed
curl https://api.makernice.com/v1/models
curl https://api.makernice.com/v1/pricing

What instructions should you give the agent?

Generate one 10-second video for each line of prompts.txt with the Makernice API.

API base: https://api.makernice.com/v1
Key: the MAKERNICE_API_KEY environment variable. Never print it or write it to a file.
Model: seedance-2.0-fast, mode t2v, duration 10. Do not send a resolution field.

1. Quote line 1 (POST /generations/quote). Show me the amount
   (micro-USD, millionths of a US dollar) and wait for my OK.
2. For each line N: quote it, then POST /generations with
   {"quote_id": ..., "input": ...} and the header Idempotency-Key: prompts-line-N.
3. Poll GET /generations/{id} every 5 seconds until succeeded, failed or canceled.
4. Download outputs[0].url (a path on the API host) with the key into out/line-N.mp4.

On 429: wait the Retry-After seconds, then retry the same request.
On any 402: stop the whole batch and report the error code.
On 400 or 422: stop and show me the error body. Do not switch models.
At the end, print a table: line, generation id, status, billing, amount.

One quote and an OK before the first create gives you a price check without slowing the batch. Because each line has its own Idempotency-Key, a re-run that reuses a key gets the original generation or 422 idempotency_conflict, never a second charge for the same line.

How much does an agent test batch cost?

Batch`model`Per clipTotal
10 clips × 10 secondsseedance-2.0-fast$1.03$10.27
100 clips × 10 secondsseedance-2.0-fast$1.03$102.72

Prices are from price list v12 (November 2, 2026); seedance-2.0-fast has one fixed tier, priced as 720p, so the agent can't pick a more expensive resolution by mistake. If a batch adds up to more than the default daily limit of 100 US dollars, the agent gets 402 daily_spend_limit_reached partway through unless support raises the limit. Price other models in the calculator →

A robot arm pressing a button labelled with a film frame, connected by a cable to a key that has a small gauge capping its spend
The agent does the clicking; the key's spend limit decides how far it can go.

Which errors should the agent wait out, and which should stop it?

ResponseMeaningThe agent should
429 rate_limitedToo many requests this minuteWait Retry-After seconds, retry
429 concurrency_limit_reached2 generations already in progressWait Retry-After seconds, retry
402 key_spend_limit_reachedThe key's spend limit is used upStop and report
402 insufficient_balanceThe balance can't cover the quoteStop and report
402 daily_spend_limit_reachedDaily limit reached; resets at 00:00 UTCStop and report
400 invalid_requestA field the model doesn't take, such as resolutionStop; fix the input, not the model
410 quote_expiredThe quote is older than 12 minutesQuote again

Failed and timed-out clips release their hold in full, so the agent can retry them with a new quote and a new Idempotency-Key. Note: if a finished output is blocked by output moderation for a policy violation, the run is still charged. You can contact support for a manual review. For the full request flow, see the API docs and API best practices.

Frequently asked questions

Can a coding agent spend more than I allow on Makernice?
Not past the key's spend limit: a create request that would exceed it gets 402 key_spend_limit_reached before any money is held. The account's daily limit, 100 US dollars per UTC day by default, applies on top.
Should an agent call the Makernice API from browser code?
No. The API doesn't accept cross-origin browser requests, and a key in front-end code can be copied. Keep the key in an environment variable and call the API from a shell, script or server.
What happens if the agent sends the same create request twice?
With the same Idempotency-Key, quote and input, the second request returns the original generation with 200 and isn't charged. With the same key but a different quote or input, it gets 422 idempotency_conflict.

Models in this post