Text to image · Image to image · Inpainting

Image generation API
from $0.0047 an image

FLUX, SDXL, Qwen Image and more behind one endpoint. Pay per image, or go flat monthly.

Commercial usage rights on every plan · 100% refund within 24 hours

$0.0047per image, open-source models
~210images per dollar at base rate
15parallel generations, top plan
1024²standard output resolution

What image generation actually costs

Open-source models are billed per image with no minimum. Premium partner models are drawn from wallet balance at their own rate.

ModelTypePrice per imageImages per $1
Open-source models
FLUX.1 schnell, SDXL, SD 1.5
Open source $0.0047 ~212
FLUX 2 Pro Partner $0.054 ~18
Qwen Image 2.0 Pro Partner $0.075 ~13

Flat monthly

Basic at $21/mo covers 3,250 calls; Standard at $47/mo covers 10,000. Works out cheaper than pay-as-you-go once you pass roughly 4,500 images a month.

Predictable volume

Unlimited open source

$149/mo removes the call ceiling entirely on open-source models, with 15 parallel generations and priority GPU clusters.

High volume

Wallet top-up

Premium partner models bill per generation from wallet balance, so you can mix a cheap default with an expensive model for hero output.

Burst

Generating your first image

The same payload shape works across every image model. Change model_id and nothing else.

curl -X POST "$API_BASE/api/v6/images/text2img" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "YOUR_API_KEY",
    "model_id": "sdxl",
    "prompt": "product photo of a ceramic mug on linen, soft daylight",
    "negative_prompt": "text, watermark, distorted",
    "width": 1024,
    "height": 1024,
    "samples": 2,
    "num_inference_steps": 30,
    "guidance_scale": 7.5,
    "seed": 42,
    "safety_checker": "yes"
  }'
import requests, time

def generate(prompt, model_id="sdxl"):
    res = requests.post(
        API_BASE + "/api/v6/images/text2img",
        json={
            "key": "YOUR_API_KEY",
            "model_id": model_id,
            "prompt": prompt,
            "width": 1024,
            "height": 1024,
            "samples": 1,
            "num_inference_steps": 30,
            "safety_checker": "yes",
        },
        timeout=120,
    ).json()

    # queued jobs expose a fetch_result URL and an eta in seconds
    while res.get("status") == "processing":
        time.sleep(res.get("eta", 3))
        res = requests.post(res["fetch_result"],
                            json={"key": "YOUR_API_KEY"}).json()

    return res["output"]

print(generate("product photo of a ceramic mug on linen"))
async function generate(prompt, modelId = "sdxl") {
  const res = await fetch(
    `${API_BASE}/api/v6/images/text2img`,
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        key: process.env.FLUX3_API_KEY,
        model_id: modelId,
        prompt,
        width: 1024,
        height: 1024,
        samples: 1,
        num_inference_steps: 30,
        safety_checker: "yes",
      }),
    }
  );

  let data = await res.json();

  while (data.status === "processing") {
    await new Promise((r) => setTimeout(r, (data.eta ?? 3) * 1000));
    data = await fetch(data.fetch_result, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ key: process.env.FLUX3_API_KEY }),
    }).then((r) => r.json());
  }

  return data.output;
}

API_BASE is issued with your API key.

Image endpoints

Beyond plain text-to-image, the same key covers editing, upscaling, and conditioning endpoints.

EndpointDoes whatKey parameters
/v6/images/text2imgPrompt to imageprompt, width, height, num_inference_steps
/v6/images/img2imgTransform an existing imageinit_image, strength
/v6/images/inpaintRegenerate a masked regioninit_image, mask_image
/v6/realtime/text2imgLow-latency preview generationprompt, width, height

Frequently asked

What is the cheapest way to generate images through an API?

Open-source models on pay-as-you-go at $0.0047 per image, which is roughly 212 images per dollar. If you consistently generate more than about 4,500 images a month, the $21 Basic plan works out lower per image; past that, the $149 unlimited open-source tier removes the ceiling.

How do I keep costs down at high volume?

Generate drafts with a fast open-source model such as FLUX.1 [schnell] at 4 steps, then re-run only approved prompts through a premium model. Set seed explicitly so the final render matches the draft.

Can I generate several images from one request?

Yes. samples controls how many images a single call returns. Each counts toward your per-image cost or plan quota.

Is there a content filter?

Yes. safety_checker is a per-request parameter. Leave it set to "yes" if your output is user-facing or appears anywhere advertising traffic can reach.

What resolutions are supported?

1024×1024 is the standard for SDXL and FLUX. Non-square aspect ratios are supported by setting width and height independently; stay near each model's native training resolution for best results.

Start generating

Pick a plan, grab your API key, and make your first call in under five minutes.

View pricing & get API key