What is an image generation API?

An image generation API creates images from a text prompt, and on many models edits or combines images you supply. You send the prompt with settings such as aspect ratio and resolution, and the API returns the finished images as URLs or base64 data, billed per image.

Model types

What an image generation API does

An image generation API turns a written description into a picture. You send a prompt, for example a ceramic mug on a marble counter in soft morning light, and the model returns one or more new images. This is called text-to-image.

Many image models also take images as input. With editing, you send a source image and an instruction, such as a new background or a different color, and the model returns the edited image. With reference images, the model combines subjects, products or styles from several pictures into a new one. Depending on the model, you can also request a transparent background, a set of related images in one request, or a split of one image into separate editable layers.

How a request works

You send POST /v1/images/generations with the model ID, the prompt and optional settings such as aspect_ratio, resolution and num_images. To edit, add the source or reference images as URLs in image. The API waits for the generation and returns the finished images as URLs, or as base64 data when you set response_format to b64_json.

If a generation is still running after a long wait, the response carries a job ID instead, and you poll GET /v1/jobs/{job_id} for the images. To receive a job ID at once, for example when you queue many generations, send the header Prefer: respond-async.

What image generation is used for

  • Marketing and social visuals. Campaign images, banners and posts in the aspect ratio each channel needs.
  • Product imagery. Studio-style shots, new backgrounds and lifestyle scenes from a single product photo.
  • Graphics with text. Posters, signs and layouts where the words in the image must be spelled correctly. Several models render text accurately, and some handle text in more than one language.
  • Design assets. Illustrations, icons and cutouts with transparent backgrounds.
  • Starting frames for video. Generate a still, then animate it with image-to-video.

What to compare between image models

  • Prompt fidelity and style. How closely the image follows a detailed prompt, and whether the look suits your brand, from photorealistic to illustrated.
  • Text rendering. Important for posters, ads and packaging.
  • Resolution and size. Models offer tiers such as 1K, 2K and 4K, preset aspect ratios and, on some, custom pixel sizes.
  • Editing and references. Whether the model edits images, and how many reference images it accepts.
  • Controls. Some models take a negative prompt that lists what to avoid, a seed for repeatable results, or a prompt extension option that expands a short prompt into a detailed one.
  • Speed and price. Image models bill per generated image, and higher quality or resolution tiers cost more per image and can take longer. Some models also bill each input image. Every output image is billed, so a request for four images costs four times as much as one at the same settings.

Side-by-side model comparisons show two models' capabilities and rates together.

Try and call an image model on EmpirioLabs AI

Browse the image models and try your prompts in the Playground. When you are ready to build, create an API key in the dashboard and call https://api.empiriolabs.ai/v1/images/generations. Each model page lists the parameters the model accepts, and the image generation reference covers the request and the response in full.

Pay as you go, or choose a plan with weekly allowances. Current per-image rates are on the pricing page.

Image Generation models on EmpirioLabs AI

18 models, cheapest first where they share a billing unit. Each model's page has its full rate card, parameters and code.

Endpoints

POST /v1/images/generations POST /v1/images/edits

Priced per image

ModelLowest rateApplies to
FLUX.2 Klein 4B Black Forest Labs$0.014$0.0085 per imageImage generation
GPT Image 2 OpenAI$0.012 per imageLow
MOSS-Image Turbo OpenMOSS$0.05$0.015 per imageImage generation
Qwen Image 2.1 Alibaba Cloud$0.016 per imageTurbo
Wan2.1 Image Alibaba Cloud$0.025 per imageTurbo
Wan2.2 Image Alibaba Cloud$0.025 per imageFlash
Qwen Image 3.0 Alibaba Cloud$0.030 per imageBase Output (1K or 2K)
Seedream 5.0 Flash ByteDance$0.030 per imageImage generation
Show all 18 models
ModelLowest rateApplies to
Wan2.5 Image Alibaba Cloud$0.030 per imageStandard
Wan2.7 Image Alibaba Cloud$0.030 per imageStandard
Qwen Image 2.0 Alibaba Cloud$0.035$0.0322 per imageStandard
Seedream 5.5 ByteDance$0.0332 per imageOutput up to 2.61MP
Seedream 5.0 Lite ByteDance$0.0350 per imageStandard
Grok Imagine Image 2.0 xAI$0.048 per imageLow quality, 1K
Seedream 4.0 ByteDance$0.060 per imageStandard
Seedream 5.0 Pro ByteDance$0.075 per imageOutput up to 2.61MP
Seedream 4.5 ByteDance$0.080 per imageStandard
Hunyuan Image 3 Tencent$0.13 per imageStandard

Frequently asked questions

What is the difference between text-to-image and image editing?

Text-to-image creates a new picture from a prompt alone. Image editing starts from one or more images you supply and changes them according to your instruction, such as a new background or an added object.

How is an image generation API priced?

Image models are billed per generated image, and the rate often depends on the quality or resolution tier. Some models also bill each input image. On EmpirioLabs AI you can pay as you go or choose a plan with weekly allowances.

Can an image generation API create images with a transparent background?

Yes, on models that support it. They return a PNG with an alpha channel, which you can place over any background.

How do I get the same image twice?

Use a model that accepts a seed, and send the same seed, prompt and settings again. Without a fixed seed, each request produces a different image.

Which Image Generation model costs the least on EmpirioLabs AI?

FLUX.2 Klein 4B lists the lowest rate per image of the 18 Image Generation models priced that way, followed by GPT Image 2, MOSS-Image Turbo. The price table on this page shows each model's lowest rate and what it applies to.

Ready to use better endpoints?

Check out our pricing or reach out if you want your own model deployed on our stack.