APIMart
GPT Image 2 model icon
Image

GPT Image 2 API

OpenAI GPT Image 2 delivers next-gen AI image generation from text prompts with near-perfect text rendering, native 4K output, and deep world knowledge. As the latest in the GPT Image series, this GPT Image API supports model, prompt, and other parameters — ideal for production workflows.

Image GenerationCommercial Use

Service Highlights

  • Official Discounts
  • Pay-as-you-go
  • Fast & Low Latency

GPT Image 2 API Pricing

Transparent pricing with no hidden fees. Pay only for what you use.

gpt-image-2-official
Token Pricing
Text input40Credits / 1M tokens
Cached text input10Credits / 1M tokens
Image input64Credits / 1M tokens
Cached image input16Credits / 1M tokens
Image output240Credits / 1M tokens

Estimated Price

Save 20%

Showing: Gold member price

0.0488Credits(~$0.0049)
0.061Credits(~$0.0061)Original Price

Price is calculated from token usage — this configuration uses about 196 tokens.

gpt-image-2-ext(gpt-image-2)
TierGoldCurrent pricePlatinumDiamondOfficialYour savings
1K0.085Credits/ image~$0.0085/ image0.0808Credits/ image~$0.0081/ image0.0765Credits/ image~$0.0077/ image2.109Credits/ image~$0.2109/ image95.9%
2K0.15Credits/ image~$0.015/ image0.1425Credits/ image~$0.0143/ image0.135Credits/ image~$0.0135/ image4.283Credits/ image~$0.4283/ image96.4%
4K0.22Credits/ image~$0.022/ image0.209Credits/ image~$0.0209/ image0.198Credits/ image~$0.0198/ image7.117Credits/ image~$0.7117/ image96.9%

* Actual costs are subject to final output.

GPT Image 2 API - Next-Gen OpenAI Image Generation

APIMart provides the most affordable and reliable access to OpenAI GPT Image 2. Generate high-quality images with the GPT Image API using model, prompt, and other parameters. Save 20% or more with membership.

50K+

Active Users

99.9%

Uptime

2x

Faster

70%

Cost Savings

GPT Image 2 API Example: Text to Image and Image to Image

Call the gpt-image-2 model on APIMart with one POST request. Generation is asynchronous: submit a task, then poll the task endpoint to get the GPT Image 2 image URL.

  1. 1

    Authenticate GPT Image 2 API requests

    Save the key you created above in the APIMART_API_KEY environment variable and send it as Authorization: Bearer <key> on every request.

  2. 2

    Submit a GPT Image 2 task

    POST /v1/images/generations with model gpt-image-2, your prompt, size and resolution. The response returns a task_id.

  3. 3

    Get the GPT Image 2 result

    Send GET /v1/tasks/{task_id} until status is completed, then read the image URL from data.result.images[0].url[0]. Image URLs expire at expires_at, so download the files if you need to keep them. A failed task returns the reason in error.message.

    See the GPT Image 2 API reference for every parameter and response field.

POST /v1/images/generations
curl -X POST https://api.apimart.ai/v1/images/generations \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A neon sign that reads OPEN 24/7 above a rainy Tokyo street at night",
    "n": 1,
    "size": "16:9",
    "resolution": "2k"
  }'

GPT Image 2 API Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredDefault: gpt-image-2Model ID. Use gpt-image-2.
promptstringRequiredDefault: —Text description of the image, in English or Chinese. Prompts are moderated before submission.
nintegerOptionalDefault: 1Number of images per request. Only 1 is supported; send it as a number, not a string.
sizestringOptionalDefault: 1:1Aspect ratio: auto, 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, 2:1, 1:2, 3:1, 1:3, 21:9, 9:21, or a pixel size such as 1881x836. auto falls back to 1:1.
resolutionstringOptionalDefault: 1kOutput resolution tier: 1k, 2k or 4k.
image_urlsarrayOptionalDefault: —Up to 15 reference images as public URLs or base64 data URIs. Adding them switches GPT Image 2 to image-to-image editing. Max 20 MB per image and 256 MB in total.
nsfw_checkbooleanOptionalDefault: falseModerate the prompt and input images before the task is submitted.
official_fallbackbooleanOptionalDefault: falseSet to true to use the official channel; false or omitted does not.

GPT Image API Model Family

Compare every GPT Image model on APIMart. One API key calls all of them; GPT Image 2.5 Flare and Sunburst share the same parameters and pricing.

ModelBest forResolution / size
GPT Image 2.5 APIFlare and Sunburst on one page, with up to 16 reference images, masks and transparent backgrounds1K / 2K / 4K
GPT Image 2.5 Flare APIFast everyday images, batch generation and rapid prototyping1K / 2K / 4K
GPT Image 2.5 Sunburst APIPrecise edits for production assets, ad creatives and multi-turn editing1K / 2K / 4K
GPT Image 2 APIThis pageText-to-image and editing with up to 16 reference images and 15 aspect ratios1K / 2K / 4K
GPT Image 1.5 APIText-to-image and editing with up to 5 reference images and masks1:1 / 3:2 / 2:3
GPT Image 1 APIPrevious generation: text-to-image and editing with up to 5 reference images and masks1:1 / 3:2 / 2:3

Guides, comparisons and pricing analysis from the APIMart blog.