Suno API batch generation without duplicate charges
A batch is a queue with a budget, not a loop that fires hundreds of requests. The difference shows up in your bill.
There is no batch endpoint
Each generation is its own request and returns two tracks. A batch is your own job table around those requests: one row per track, a stable request id, the provider task id, and a status. Do not treat a loop over 100 prompts as one operation you can retry.
A queue that survives restarts
| Worker | Job | Guard |
|---|---|---|
| Submit | Send one generation and store the task id | Cap in-flight requests |
| Poll | Query every 3–5 seconds until terminal | One poller per task |
| Download | Fetch a fresh media URL and store the file | Idempotent by task id |
| Reconcile | Find rows with no terminal state | Run after restarts |
Dedupe and storage
Make your request id unique in the database. On a timeout, query the existing task instead of inserting a new row. When the task completes, download immediately and store the file in your own bucket; keep the task id, not the temporary media URL, as the permanent reference.
常见问题 / FAQ
Can I send 100 generations at once?
Start with a small number in flight and watch 429s. Queue the rest; more parallel requests do not make renders finish sooner.
How do I know which item failed?
Track one row per track with its task id and terminal status. Failed tasks are refunded and should not be retried blindly.
Do I need separate workers?
Not necessarily, but separating submit, poll and download makes rate limits and retries much easier to reason about.
注册只需要邮箱,一次生成 0.6 元出 2 首,MP3 与 WAV 下载不限次。