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: 4:3 | 3:4 | 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.
OpenAI logo

GPT-Image-2

Commercial use

Generate stunning, high-quality images with OpenAI's latest image model through one ToAPIs account.

Model Type:
料金: 1K 3 クレジット($0.015)/ 枚; 2K 4 クレジット($0.02)/ 枚; 4K 5 クレジット($0.025)/ 枚

Input

FormJSON
Describe the image you want to generate.49 / 1200

Quick Prompts

Advanced Options

Final price is confirmed at submission

Reference images

Request preview

{
  "model": "gpt-image-2",
  "prompt": "柔らかなスタジオ照明、クリーンな背景、鮮明なディテール、広告品質を備えた高級感のある商品ポスター。",
  "size": "1:1",
  "n": 1,
  "response_format": "b64_json",
  "metadata": {
    "resolution": "1K",
    "orientation": "square"
  }
}

Output

PreviewJSON
Example output
Example output

2M+

Images generated

8s

Avg. response time

99.9%

Uptime

API

Ready for production

Generated examples

Explore what GPT-Image-2 can create

Create with this model
GPT-Image-2 generated fashion campaign visual

Generated in 8.2s with GPT-Image-2

GPT-Image-2 generated product scene

GPT-Image-2 #2

GPT-Image-2 generated social creative

GPT-Image-2 #3

透明な料金体系

GPT-Image-2 の料金

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

クレジットを追加

1K

ToAPIs

$0.015

3 クレジット /

93% 割引VS

公式価格

$0.22

2K

ToAPIs

$0.02

4 クレジット /

96% 割引VS

公式価格

$0.5

4K

ToAPIs

$0.025

5 クレジット /

98% 割引VS

公式価格

$1.3

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

Why ToAPIs

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 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.

FAQ

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.

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