GPT Image 2.5 Discount Group API

Generate and edit images with Flare or Sunburst at 1K, 2K, or 4K.

Use a Discount Group key with gpt-image-2.5. Set version to flare (default) or sunburst. Each task accepts 1–4 outputs and up to 16 reference images.

Open the playground to try the capybara comic or boxed collectible example. Filling an example is free. The Generate button submits a billable task.

Integrate with a coding assistant

Read https://app.apipool.dev/docs/discount/gpt-image-2-5.
Integrate this API into my project for image generation, editing, asynchronous task queries, and downloads.
Use the existing stack and read the API key from an environment variable. Explain where to set it and how to use the integration.
Do not put the API key in source code or logs.

Group differences

Both groups use the same submission, polling, and download endpoints. The Discount Group uses gpt-image-2.5 with version=flare or sunburst and bills delivered images by resolution. The Official Group uses gpt-image-2.5-flare or gpt-image-2.5-sunburst and bills tokens. Use a key from the group you select.

Quality, output-format selection, GIF, SVG, masks, and frame options are unavailable on this Discount Group model. See GPT Image 2.6 for GIF and SVG.

Set up your key

Create a Discount Group key in API Keys and check your wallet balance.

export APIPOOL_API_KEY="YOUR_DISCOUNT_GROUP_KEY"

Submit a generation

curl https://app.apipool.dev/v1/images/generations \
  -H "Authorization: Bearer $APIPOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.5",
    "version": "flare",
    "prompt": "A capybara calmly sips tea in front of a computer full of error dialogs. Warm comic art with NO BIG DEAL at the top.",
    "size": "1:1",
    "resolution": "1k",
    "n": 1
  }'

Save the task id returned with HTTP 202.

{ "id": "imgtask_01EXAMPLE", "status": "submitted", "model": "gpt-image-2.5" }

Use 2k or 4k for higher resolution. Set n from 1 to 4. Use the same model ID and change version for Sunburst.

Poll and download

Use the same key that submitted the task.

export TASK_ID="imgtask_01EXAMPLE"
curl "https://app.apipool.dev/v1/tasks/$TASK_ID" \
  -H "Authorization: Bearer $APIPOOL_API_KEY"

Query again every few seconds while the task is submitted, processing, or meter_pending. A completed task returns its images in data[].url. Read the error if the status is failed. Save links before expiry. While a task is pending, continue checking the original ID.

{
  "id": "imgtask_01EXAMPLE",
  "status": "completed",
  "data": [{ "url": "https://example.com/result.png" }]
}
curl -L "RETURNED_IMAGE_URL" -o result.png

Edit from a reference

Replace source.png with your file. Repeat -F "image=@..." to send up to 16 PNG, JPEG, or WebP references. Each file can be up to 10 MB, with a 48 MB combined limit.

curl https://app.apipool.dev/v1/images/edits \
  -H "Authorization: Bearer $APIPOOL_API_KEY" \
  -F "model=gpt-image-2.5" \
  -F "version=sunburst" \
  -F "prompt=Turn the subject into a boxed collectible figure and preserve recognizable features. Include a computer, coffee, and a miniature lounge chair." \
  -F "size=1:1" \
  -F "resolution=2k" \
  -F "n=1" \
  -F "[email protected]"

You can also pass reference URLs in image_urls to the JSON generation endpoint. Edit tasks use the same polling and download steps.

Parameters

ParameterAccepted values
modelRequired. gpt-image-2.5.
promptRequired nonempty string, up to 4,000 characters.
versionflare (default) or sunburst.
resolution1k (default), 2k, or 4k.
sizeauto (default), 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, or 21:9. Use ratios.
nInteger 1–4. Default 1.
image_urlsUp to 16 accessible image URLs or data URLs. Omit for text-to-image.

Pricing

Both versions have the same Discount Group rate per successfully delivered image.

ResolutionPrice per image
1KUS$0.009031
2KUS$0.031875
4KUS$0.0425

References are free. Two delivered 2K images cost US$0.06375. Failed tasks are free. A submission may reserve funds. Any unused reservation is released at settlement. See the model page for current rates.

Troubleshooting

  • HTTP 401. Check the key and Authorization header.
  • Model unavailable. Confirm the Discount Group and the exact ID gpt-image-2.5.
  • HTTP 400. Check the resolution, ratio, output count, and reference count. Remove fields exclusive to Official Group models.
  • Incomplete task. Continue polling the same ID. See asynchronous image tasks for statuses and errors.