Image API

AI Image Generation API

Generate, edit, upscale, and remove backgrounds with Flux, Midjourney, Ideogram, GPT Image, and Imagen through one API.

57 image models · pay per image
57
Image models
Below official
14s
Median latency

Sign in to generate

Create an API key or sign in to generate with the selected image model.

Everything the image endpoint can do

Text to Image

One prompt, one call. Size, style, and batch count are plain parameters on the same endpoint.

Image Editing

Instruction-based edits on an existing image - change a material, a color, or a whole background.

Inpainting

Mask a region and regenerate only that area, keeping the rest of the frame pixel-identical.

Image models on one key

Flux/flux-2-klein

Black Forest Labs

$0.03 / image

Flux/flux-dev

Black Forest Labs

$0.06 / image

Flux/flux-pro

Black Forest Labs

$0.07 / image

Flux 2/flux-2-flex-remix-image

Black Forest Labs

$0.14-$0.24 / image

Flux 2/flux-2-flex-text-to-image

Black Forest Labs

$0.14-$0.24 / image

Flux 2/flux-2-max-remix-image

Black Forest Labs

$0.15 / image

Flux 2/flux-2-max-text-to-image

Black Forest Labs

$0.15 / image

Flux 2/flux-2-pro-remix-image

Black Forest Labs

$0.06-$0.07 / image

View all 57 image models
Quickstart

Generate an image

curl https://runapi.ai/api/v1/flux/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"flux-2-klein","prompt":"A cobalt vase on white marble."}'
How it works

Four Steps to Your First Generation

  1. Get Your API Key

    One key for all 57 image models.

  2. Choose a Model

    Flux, Midjourney, GPT Image, Ideogram, Recraft — pick by style or speed.

  3. Send a Request

    POST to /api/v1/flux/text_to_image. We route to the best provider at the lowest price.

  4. Download Result

    Response includes a CDN URL. Images typically ready in 3-15 seconds.

Why Developers Choose RunAPI

One Key, All Models

Stop juggling API keys. One integration gives you access to 57 image models across all providers.

15-25% Cost Savings

Our volume agreements with providers mean lower prices than going direct. No markup on top.

Automatic Failover

If a provider goes down, we route to the next best option. Your app stays up.

OpenAI-Compatible

Drop-in replacement for OpenAI SDK. Change one line of code to access any model.

Real-Time Billing

Pay only for what you use. Per-request pricing with no minimums. Track costs per model, per project.

Data Privacy

Our Privacy Policy explains how request data and generated content are processed and retained.

What teams build with it

Product Catalogs

Generate on-brand shots for thousands of SKUs, then cut backgrounds in the same pipeline.

Ad Creative

Batch variants per channel and aspect ratio. Swap models without touching request code.

App Features

Ship avatar, sticker, or thumbnail generation as a product feature with per-key spend caps.

Design Systems

Keep a series consistent with image-to-prompt, then iterate with masked inpainting.

RunAPI vs alternatives

Feature RunAPI Direct API Replicate
Image models 57 1 provider ~20
Pricing 15-25% below official Official rate Market rate + GPU markup
Response time 3-15s typical Varies Cold start delays
Unified billing
MCP server
Provider failover

Image API questions

How is image generation billed?

Per image or per megapixel, depending on the model. The catalog lists the exact unit next to each price.

Can I edit an image I already have?

Yes. Pass your image with task_type image_edit or inpaint, plus an instruction or a mask.

Is Midjourney really available over API?

Yes, through RunAPI's managed integration. It uses the same request shape as every other image model.

What is the maximum resolution?

Native resolution depends on the selected model; dedicated upscalers can produce 4K output where supported.

Do you keep my images?

Output retention follows the active endpoint contract. RunAPI does not use prompts or outputs for training.

Can I set a per-project spend limit?

Yes. Create a separate API key per project and set its available credit and reset cycle.

Add image generation to your product

57 models behind one OpenAI-shaped request. Start free, no credit card required.