Happy Horse API is now available! 🐴
GPT Image 2Image API

GPT Image 2 APIfor developers.

Generate high-fidelity images, product shots, UI mockups, and typography-heavy assets through ImaRouter.One model family for text-to-image, edit flows, mask support, and production-ready async handling.

see more

Modes

Generate, edit, masked edit

Text-to-image plus image-to-image editing through the companion edit endpoint

Resolution

Preset sizes up to 4K

Custom dimensions supported, with both edges in multiples of 16

Quality

Low, medium, high

Use low for iteration and high for final photoreal or text-heavy assets

Output

JPEG, PNG, WebP

Choose the format that fits your delivery, preview, or asset pipeline

Reference inputs

URL-based image editing

Edit mode accepts source image URLs and optional masks for targeted changes

Pricing

From roughly $0.01 / image

Usage-based billing through ImaRouter, with larger and higher-quality renders priced above lightweight iteration runs

Available Endpoints

Start building with the GPT Image 2 API

Multiple endpoints for text-to-video, image-to-video, fast preview flows, and async job retrieval. This section is laid out more like a product catalog than raw docs so users can scan what to use first.

NewGenerate

Endpoint

Text-to-Image

/v1/image/gpt-image-2/generate

Core endpointText-to-imageTypographyPhotoreal

Generate a new image from a prompt with explicit size, quality, format, and image count settings.

Best for: Best for net-new visuals, infographics, product shots, UI mockups, posters, and marketing creative.

NewEdit

Endpoint

Image Edit

/v1/image/gpt-image-2/edit

Image-to-imageMask supportEdit modeReference images

Edit one or more source images with change-preserve instructions, optional masks, and auto or custom output sizing.

Best for: Use this for relighting, object replacement, cleanup, packaging revisions, background changes, or virtual try-on style workflows.

New

Endpoint

Queue Status

/v1/jobs/{jobId}

Queue APIStatus pollingAsync workflow

Check whether a generation or edit request is queued, running, completed, or failed in ImaRouter's async workflow.

Best for: Needed when you submit requests asynchronously and want to reflect progress in your backend or product UI.

New

Endpoint

Fetch Result

/v1/jobs/{jobId}

Result retrievalRequest lifecycleProduction flow

Retrieve the finished output payload once the generation or edit request has completed.

Best for: Use this after status polling or webhook confirmation to read the final image URLs and usage metadata.

Get started today

Ready to integrate GPT Image 2?

Try the API directly in the console, or reach out to the team for onboarding, pricing, and enterprise setup.

API Documentation

How to get access to GPT Image 2 API

ImaRouter keeps the image workflow close to the existing Seedance and Kling patterns: submit the request, keep the returned job id, and fetch the result once the job completes.

Selected endpoint

/v1/image/gpt-image-2/generate

Use the text-to-image endpoint for first-pass generation, then switch to the edit endpoint when your workflow needs preserve/change instructions or mask-based updates.

Best for net-new visuals, infographics, product shots, UI mockups, posters, and marketing creative.

const apiKey = process.env.IMAROUTER_API_KEY;

async function createGptImage2Visual() {
  const createResponse = await fetch("https://api.imarouter.com/v1/image/gpt-image-2/generate", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${apiKey}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      prompt: "A premium bottled matcha drink ad with clean typography, mint green palette, condensation on the bottle, soft studio reflections, and a headline that reads 'ENERGY THAT FEELS CLEAN'",
      imageSize: "landscape_4_3",
      quality: "high",
      numImages: 1,
      outputFormat: "png"
    })
  });

  const job = await createResponse.json();

  let status = "queued";
  while (status !== "completed") {
    await new Promise((resolve) => setTimeout(resolve, 3000));

    const statusResponse = await fetch(`https://api.imarouter.com/v1/jobs/${job.id}`, {
      headers: {
        "Authorization": `Bearer ${apiKey}`
      }
    });

    const jobState = await statusResponse.json();
    status = jobState.status;

    if (status === "failed") {
      throw new Error(jobState.error ?? "GPT Image 2 generation failed");
    }

    if (status === "completed") {
      return jobState.output[0].url;
    }
  }
}

Async flow

  1. 1

    Choose the generation or edit endpoint based on whether you are creating from scratch or modifying an existing image.

  2. 2

    Submit the request with prompt, size, quality, and output format settings, then store the returned request id if you are using the queue API.

  3. 3

    Poll the status endpoint or rely on the client subscribe helper until the request reaches COMPLETED.

  4. 4

    Read the final output URLs and usage metadata, then pass the finished assets into your own review, storage, or publishing workflow.

What Makes It Different

What makes the GPT Image 2 API different

This section is laid out to read more like a product narrative than a feature list. Each row shows a capability, why it matters, and what that looks like in a real workflow.

Preview

Pixel-perfect typography

That makes it more useful for infographics, packaging mockups, landing page banners, UI screenshots, posters, and ad creative where readable text matters.

Capability

Pixel-perfect typography

GPT Image 2 is unusually strong at dense text, small labels, and text-forward layouts compared with typical image generation models.

That makes it more useful for infographics, packaging mockups, landing page banners, UI screenshots, posters, and ad creative where readable text matters.

Example scenario

A product marketing team generates launch visuals with exact headline copy, pricing callouts, and feature bullets that remain legible in the first pass.

Capability

Photoreal image quality

The model is positioned as a quality-first image model with strong realism, material rendering, and lighting fidelity.

Developers can use it for customer-facing product imagery, campaign stills, editorial scenes, or polished concept visuals without defaulting to stylized output.

Example scenario

An ecommerce workflow produces higher-fidelity product hero shots for PDP experiments without scheduling a fresh studio shoot.

Preview

Photoreal image quality

Developers can use it for customer-facing product imagery, campaign stills, editorial scenes, or polished concept visuals without defaulting to stylized output.

Preview

Editing and mask support

This is especially useful for background swaps, cleanup, product variation tests, ad localization, and iterative asset refinement.

Capability

Editing and mask support

The edit endpoint supports image URLs, optional masks, and preserve/change instructions for finer-grained revisions.

This is especially useful for background swaps, cleanup, product variation tests, ad localization, and iterative asset refinement.

Example scenario

A design ops tool lets a team preserve a bottle label while changing only the background, lighting mood, and prop styling.

Capability

Flexible production sizing

The model supports preset image sizes plus higher-resolution output tiers up to 4K-class workflows, with production-safe sizing behavior.

Teams can use one model family across square catalog assets, portrait ads, landscape landing pages, and larger campaign exports.

Example scenario

A growth team generates portrait social ads, square app store artwork, and landscape hero banners from one shared prompt system.

Preview

Flexible production sizing

Teams can use one model family across square catalog assets, portrait ads, landscape landing pages, and larger campaign exports.

Unified API Platform

Two API tiers for different use cases

Pick the right balance of quality, speed, and cost for your workflow. The section stays data-driven, but the presentation is closer to a clean product comparison table.

Feature
Low
MediumRecommended
High
Best forFast prompt iteration and idea findingBalanced quality and costBest photorealism and typography
SpeedFastestModerateSlowest
QualityBest for rough creative loopsGood for many product-facing assetsHighest fidelity
CostLowestMid-tierHighest
Recommended usePrompt tuning, early mockups, and workflows where you plan to rerender the winnersEditorial images, marketing drafts, and regular production use when you want better fidelity without the highest costFinal campaign exports, text-heavy layouts, premium product stills, and assets where details must hold up under review
API endpoints/v1/image/gpt-image-2/generate, /v1/image/gpt-image-2/edit/v1/image/gpt-image-2/generate, /v1/image/gpt-image-2/edit/v1/image/gpt-image-2/generate, /v1/image/gpt-image-2/edit

Use Cases

Industries using the GPT Image 2 API

This section keeps the same reusable data model, but the presentation is closer to a grid of industry cards instead of long narrative boxes.

Content teams, publishers, and marketing designers

Infographics and educational visuals

Generate diagrams, explainers, posters, and information-dense layouts with readable text and deliberate hierarchy.

GPT Image 2 is a better fit than many image models when text is part of the artifact instead of an afterthought.

Merchandising teams and product marketers

Ecommerce product photography

Produce clean packshots, styled product scenes, and label-accurate launch visuals for catalog and campaign workflows.

The model is positioned for photoreal quality and brand-consistent product imagery, which matters for commercial assets.

Design systems teams and product designers

UI mockups and design comps

Create interface mockups, dashboard concepts, and marketing screenshots with clearer layout and text behavior.

Readable buttons, chips, headings, and interface labels make the model much more usable for product-oriented design ideation.

Creative ops teams and asset production pipelines

Image editing and cleanup workflows

Update backgrounds, remove clutter, localize copy, preserve products, or change only selected regions with masks.

The edit endpoint gives you preserve/change control instead of forcing every asset through a full regeneration pass.

Paid media teams and performance marketers

Ad creative and localization

Generate variant campaigns with exact headlines, offer text, and different aspect ratios for channels and regions.

Text rendering plus flexible sizing reduces the number of manual resize and redesign steps after generation.

Brand teams, agencies, and packaging designers

Brand packaging and label visualization

Prototype product labels, bottle art, box fronts, and shelf-ready concepts with readable brand and ingredient text.

This is one of the clearest cases where typography quality and photoreal rendering need to work together in one output.

Examples

GPT Image 2 API examples

This section supports future video or image previews, but it also renders cleanly from prompt-only data. That keeps the template reusable even when a page launches before media assets are ready.

Demo

Scientific infographic

Text-heavy generation

Use a structured prompt when you need diagrams, labels, and compact copy to survive the first render without broken typography.

A scientific infographic explaining battery chemistry with labeled cell layers, molecular callouts, clean arrows, white background, precise hierarchy, readable small text, and a polished editorial style.

infographictext renderingeditorial
Demo

UI homepage mockup

UI generation

A strong fit for interface mockups when buttons, navigation labels, and repeated text elements need to look coherent.

A pixel-perfect video platform homepage mockup with left sidebar, top navigation, category chips, thumbnail grid, realistic labels, and clean spacing throughout the interface.

uimockuplayout
Demo

Brand product shot

Product photography

Good for premium ecommerce or launch creative where the packaging text and material finish both matter.

A premium product photo of a black perfume bottle on wet stone with silver label text, subtle mist, realistic reflections, controlled studio lighting, and a luxury campaign aesthetic.

productphotorealpackaging
Demo

Storefront cleanup edit

Preserve-and-change edit

This is the kind of scoped edit where the preserve list keeps the model from drifting outside the requested change.

Remove every advertising sign and poster from the storefront windows. Preserve the awning, brick facade, mullions, reflections, sidewalk, and all people exactly. Reconstruct the glass naturally with no ghosting or adhesive marks.

editcleanupmask-ready

How To Use This API

How to use GPT Image 2 API

This quick-start walkthrough is written to rank for integration-style searches while staying concise enough for busy developers and operators.

  1. 1

    Create your ImaRouter account

    Set up your ImaRouter account so you can access the playground, dashboard, and API credentials from one place.

  2. 2

    Store your API key securely

    Set `IMAROUTER_API_KEY` in your server environment and avoid exposing it from client-side code or public browser sessions.

  3. 3

    Choose generate or edit mode

    Use the core GPT Image 2 endpoint for new images and the edit endpoint when your workflow starts from one or more reference images.

  4. 4

    Set size, quality, and format

    Pick a preset or custom size, choose low/medium/high quality based on budget and fidelity needs, and return the asset as JPEG, PNG, or WebP.

  5. 5

    Use the queue for production flows

    Submit requests to the queue, keep the returned request id, and poll status or results when you need durable asynchronous handling.

FAQ

Frequently asked questions about GPT Image 2 API

FAQs stay compact and skimmable here. The content is still data-driven for SEO, but the layout is cleaner and less visually heavy.

What is GPT Image 2 API?

It is ImaRouter's programmable interface for OpenAI's GPT Image 2 model family, covering text-to-image generation and image editing workflows.

What is GPT Image 2 especially good at?

GPT Image 2 is especially strong at text rendering, photoreal image generation, and commercial product visuals where labels, packaging, and copy need to stay readable.

Does GPT Image 2 support image editing?

Yes. The ImaRouter page supports image editing workflows with reference images, preserve-and-change instructions, and async result retrieval.

What sizes are supported?

The page is designed around preset sizes and higher-resolution output tiers up to 4K-class results, with larger outputs priced above lightweight iteration runs.

What output formats can I request?

The documented output formats are JPEG, PNG, and WebP, so you can choose based on asset quality, transparency, or delivery constraints.

How do queue-based requests work?

You submit a request, receive a request id, then use the queue status and result endpoints to track progress and fetch the final image payload once the request is completed.

Can I use GPT Image 2 for commercial work?

Yes. The goal of this page is to help teams productionize GPT Image 2 through ImaRouter, but you should still verify your own legal, brand, and platform requirements before publishing assets at scale.

Where can I find prompting guidance?

Start with the examples on this page, then adapt the same preserve-and-change prompt pattern to your own app, campaign, or product workflow.

Model Directory

Browse the full model market before you choose your route.

Use the `/models` catalog to scan providers, modalities, reasoning support, context windows, and pricing metadata from a local OpenRouter snapshot. It is the fastest way to compare what exists before you decide which models should be prioritized on ImaRouter.

Get Started

Start with GPT Image 2 on ImaRouter, then productionize the workflow you validate

Use the playground to test prompts, move into the text-to-image or edit API when the workflow is stable, and use the same async pattern as the other ImaRouter model pages. Use one API surface for 200+ models across five modalities, with transparent routing, automatic failover, and fast new-model onboarding.