Skip to main content
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 generate() or POST /image/generate in parallel.
Mynth does not impose API concurrency limits. If the generations are independent, you can parallelize them and handle task coordination in your own application.

Generate across multiple models

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.generate(
      {
        prompt: "Hero illustration for a fintech landing page",
        model,
        size: "landscape",
      },
      { mode: "async" },
    ),
  ),
);

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

Generate many prompts in parallel

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.generate(
      {
        prompt,
        model: "google/gemini-3.1-flash-image",
      },
      { mode: "async" },
    ),
  ),
);

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.