GuidesBatch-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/pricingWhat 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 clip | Total |
|---|---|---|---|
| 10 clips × 10 seconds | seedance-2.0-fast | $1.03 | $10.27 |
| 100 clips × 10 seconds | seedance-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 →

Which errors should the agent wait out, and which should stop it?
| Response | Meaning | The agent should |
|---|---|---|
429 rate_limited | Too many requests this minute | Wait Retry-After seconds, retry |
429 concurrency_limit_reached | 2 generations already in progress | Wait Retry-After seconds, retry |
402 key_spend_limit_reached | The key's spend limit is used up | Stop and report |
402 insufficient_balance | The balance can't cover the quote | Stop and report |
402 daily_spend_limit_reached | Daily limit reached; resets at 00:00 UTC | Stop and report |
400 invalid_request | A field the model doesn't take, such as resolution | Stop; fix the input, not the model |
410 quote_expired | The quote is older than 12 minutes | Quote 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.
