> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mynth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Generation

> Create many independent generation tasks in parallel across prompts or models.

Mynth is already task-based, so batch generation does not require a special bulk API for many common workflows.

If you want several independent generations, you can call `image.generate()` or `POST /image/generate` in parallel.

<Info>
  Mynth does not impose API concurrency limits. If the generations are independent, you can
  parallelize them and handle task coordination in your own application.
</Info>

## Generate across multiple models

```ts theme={"theme":"kanagawa-dragon"}
import Mynth from "@mynthio/sdk";

const mynth = new Mynth();

const models = [
  "google/gemini-3.1-flash-image",
  "black-forest-labs/flux.2-dev",
  "black-forest-labs/flux.2-pro",
  "recraft/recraft-v4",
];

const tasks = await Promise.all(
  models.map((model) =>
    mynth.image.generateAsync({
      prompt: "Hero illustration for a fintech landing page",
      model,
      size: "landscape",
    }),
  ),
);

console.log(tasks.map((task) => task.id));
```

## Generate many prompts in parallel

```ts theme={"theme":"kanagawa-dragon"}
const prompts = [
  "Packaging photo for a botanical tea brand",
  "Packaging photo for a specialty coffee brand",
  "Packaging photo for a skincare brand",
];

const tasks = await Promise.all(
  prompts.map((prompt) =>
    mynth.image.generateAsync({
      prompt,
      model: "google/gemini-3.1-flash-image",
    }),
  ),
);
```

## Why this works well

Each request creates its own task, and Mynth processes those tasks asynchronously.

That means you can:

* fan out across models
* fan out across prompts
* store task IDs immediately
* poll or handle results with webhooks later

## Concurrency limits

Mynth does not impose API concurrency limits. However, you should size your parallelism based on:

* **Budget**: each request incurs cost. Multiply your per-request cost by the number of concurrent tasks.
* **Downstream capacity**: if your system processes results (e.g. saving to a database, triggering a pipeline), make sure it can keep up.
* **User experience**: too many simultaneous requests from a single client can cause long wait times for all of them.
