Quick Answer

  • Use POST /v1/images/generations with model=gpt-image-2.
  • Supports prompt generation and reference_images URL inputs for guided generation.
  • Reference images must be URLs, so local files must be uploaded first instead of passing base64 directly.
  • The endpoint returns an async task id for later status polling.
  • Official public pricing is roughly $0.22 / $0.50 / $1.30 per image for 1K / 2K / 4K; ToAPIs currently shows $0.015 / $0.020 / $0.025 per image on the landing comparison, with final billing based on account pricing.
  • At the ToAPIs 1K listed rate of $0.015 per image, a $10 top-up is roughly 600+ additional 1K images; at the 4K listed rate of $0.025 per image, it is roughly 400 4K images.

Key Parameters

  • model | string | required | gpt-image-2 | - | Use gpt-image-2 as the exact model id.
  • prompt | string | required | - | - | Primary prompt for image generation or editing.
  • size | string | optional | 1:1 | 1K: 1:1 | 3:2 | 2:3; 2K: 1:1 | 3:2 | 2:3 | 4:3 | 3:4 | 5:4 | 4:5 | 16:9 | 9:16 | 2:1 | 1:2 | 21:9 | 9:21; 4K: 16:9 | 9:16 | 2:1 | 1:2 | 21:9 | 9:21 | Output aspect ratio; supported values depend on the selected resolution tier.
  • resolution | string | optional | 1K | 1K | 2K | 4K | Output resolution tier; must match a supported size combination.
  • reference_images | string[] | optional | - | URL array | Reference image URL array. Local files must be uploaded first; no direct base64 references.
  • image_urls | string[] | optional | - | URL array (compat field) | Compatibility field; prefer reference_images for new integrations.
  • response_format | string | optional | url | url | b64_json | Response format; current ToAPIs docs recommend url.

Common Errors

  • 400 invalid_request_error: trigger=Missing required fields or invalid size-resolution combinations.; fix=Validate model, prompt, size, resolution, and response_format against docs.; retry=Retry only after correcting the payload.
  • 400 invalid_reference_images: trigger=Passing base64, local paths, or non-URL reference_images values.; fix=Upload the image first and pass the resulting URL in reference_images.; retry=Retry after fixing the reference image input.
  • 401 authentication_error: trigger=Missing Authorization header or invalid API key.; fix=Verify bearer token format and key scope.; retry=Retry after fixing authentication.
  • 429 rate_limit_exceeded: trigger=Request rate, concurrency, or current quota hits upstream rate limiting.; fix=Apply exponential backoff first, then review request rate, concurrency, and quota usage.; retry=Use 1s/2s/4s backoff with jitter; if it persists, reduce submission pressure.
Back to ToAPIs

GPT-Image-2

Generate stunning, high-quality images with OpenAI's latest image model.

Text-to-image generation
Sharp text rendering
Photorealistic & artistic
Fast generation
View API Docs

New users get 10 free credits. No credit card required.

GPT-Image-2 generated example
Generated in 8.2s with GPT-Image-2

2M+

Images generated

8s

Avg. response time

99.9%

Uptime

Creators

Trusted by developers

New here? Sign up and get 10 free credits to try GPT-Image-2 now!

Explore the power of AI image generation with zero risk.

Sign up to get free credits
1

Describe your image

Describe the image you want to generate.127 / 1200

Quick Prompts

Advanced Options

Final price is confirmed at submission

Reference images

Request preview

{
  "model": "gpt-image-2",
  "prompt": "A premium product poster with soft studio lighting, a clean background, sharp subject detail, and commercial advertising style.",
  "size": "1:1",
  "n": 1,
  "response_format": "b64_json",
  "metadata": {
    "resolution": "1K",
    "orientation": "square"
  }
}
2

Your generated image

Example output
Example output

Happy with the result? Keep producing

Top up $10 to generate about 666 more 1K GPT-Image-2 images. Pay as you go, no subscription.

Top up $10

ToAPIs vs Official GPT-Image-2 Pricing

Same image model capability, lower generation cost, free credits on signup.

Save vs official

1K

93%

ToAPIs Price

$0.015

3 credits / image

Official Price

$0.22

/ image

2K

96%

ToAPIs Price

$0.02

4 credits / image

Official Price

$0.5

/ image

4K

98%

ToAPIs Price

$0.025

5 credits / image

Official Price

$1.3

/ image

Prices are shown for model-page comparison and may change. Final billing follows the current account pricing.

Why use ToAPIs for GPT-Image-2?

Keep GPT-Image-2 quality while lowering image generation costs and using one API key across more models.

Lower per-image pricing

Generate 1K, 2K, and 4K images at a lower listed cost than official pricing.

Free credits first

New users get 10 credits to test prompts before topping up.

Unified API access

Use one ToAPIs account and API key across image, video, and language models.

Start generating in three steps

Test in the page, then move the same model into your production workflow.

  1. 1

    Try a prompt

    Use the Playground above to validate quality, text rendering, and style fit.

  2. 2

    Create an API key

    Sign up, open Dashboard, and create a token for GPT-Image-2 requests.

  3. 3

    Ship your workflow

    Call the image endpoint, poll async task status, and top up credits as usage grows.

Built for image generation teams

Ads and social creatives

Produce campaign concepts, thumbnails, posters, and localized image variants.

Product visuals

Generate product-style shots, merchandising scenes, and reference-guided variations.

Developer pipelines

Add async image generation to agents, CMS tools, and batch creative systems.

GPT-Image-2 pricing FAQ

Can I try GPT-Image-2 for free?

Yes. New ToAPIs users receive 10 credits and can test GPT-Image-2 before topping up.

Is the official comparison fixed?

This model page uses a fixed comparison table for clarity. Final ToAPIs billing follows current account pricing.

Can I use the API after testing?

Yes. Create an API key in the dashboard and integrate GPT-Image-2 into your image generation workflow.

GPT-Image-2 API

Generate your first GPT-Image-2 image on ToAPIs

Start with free credits, compare the output, then get an API key when you are ready to scale.