count on POST /image/generate (or mynth.image.generate() / generateAsync()) when you want several images from the same prompt and model in one task. Default is 1. Maximum is 20.
For different prompts or models, create separate tasks in parallel. There is no multi-prompt bulk endpoint.
For a single image, see Generate Images. For waiting on results, see Async and polling.
Pricing
Mynth reserves the full cost up front: per-image price ×count (plus magic prompt once, if enabled). You are charged only for images that succeed. Reserved balance for failed images is released.
If your balance cannot cover the full reservation, task creation fails with 422 INSUFFICIENT_BALANCE.
Generate several images in one task
Setcount to request multiple variants of one prompt:
| Field | Default | Limits |
|---|---|---|
count | 1 | Integer from 1 to 20 |
count greater than 20 is rejected with HTTP 400 and code: "VALIDATION_ERROR".
Handle partial success
Each requested image is generated independently. The task can complete with a mix of successful and failed images. The task status is stillcompleted when any images settle; inspect per-image status.
Success item:
INVALID_INPUT, INVALID_PROMPT, RESTRICTED_CONTENT, UNKNOWN_ERROR.
task.urls and task.getImages() return only successful images. Use getImages({ includeFailed: true }) when you need failures.
Fan out across prompts or models
One request has a singleprompt and model. For independent combinations, create one task per combination. Mynth does not enforce API concurrency limits.
generateAsync when you want task IDs immediately and will poll or use webhooks later. Use generate when you can wait for each task in place. See Async and polling.
Size your own parallelism for budget, downstream capacity, and client UX. Each task reserves cost at creation.
REST example
Choose count vs parallel tasks
| Goal | Approach |
|---|---|
| Several variants of one prompt and model | One request with count (max 20) |
| Different prompts, same or different models | One task per combination (Promise.all, etc.) |
| Different models for the same prompt | One task per model |
| Track each job with your own IDs | metadata per task — see Use Metadata |
How batch generation works
- Mynth validates the request (
count1–20) and reserves cost for all requested images. - The worker runs the
countgenerations in parallel for that task. - Each image is finalized independently (upload, optional rating, destination).
- The task completes with
result.images— one entry per requested image,successorfailed. - You are charged only for successful images; unused reservation is released.