Skip to content
English

GPT Image 2 Pro

POST /v1/tasks

All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name gpt-image-2-pro
Type Image generation (text-to-image Pro)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

GPT Image 2 Pro is a higher-fidelity text-to-image model for English prompts, brand visuals, poster layouts, and 2K delivery.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.

Best suited for

High-quality English prompts

Use detailed English prompts to describe subject, lighting, material, composition, and text hierarchy.

prompt
Brand posters and hero images

For ad posters, product hero images, cover assets, and higher-polish commercial visuals.

promptresolution
Multi-ratio delivery

Deliver the same creative direction into square, portrait, landscape, and ultrawide placements.

aspect_ratio
2K output

Use when you need more detail than 1K for final image delivery.

resolution

Request parameters

model string required

Fixed value gpt-image-2-pro.

example gpt-image-2-pro
input object required

Business parameters for GPT Image 2 Pro text-to-image generation.

prompt string required

Image generation prompt, up to 20000 characters. English prompts are more stable.

aspect_ratio enum optional

Output image aspect ratio.

default 1:1 enum: 1:12:33:23:44:34:55:49:1616:921:9
resolution enum optional

Output resolution tier.

default 1K enum: 1K2K
callback object optional

Optional callback configuration. In production, pass callback.url so HiAPI can notify your service when the task reaches a terminal state.

url string required

HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final for terminal-state notifications.

default final enum: final

Example requests

Brand poster

Use an English prompt for a stable commercial poster.

Request body
{
  "model": "gpt-image-2-pro",
  "input": {
    "prompt": "A premium editorial product poster for a matte black wireless speaker, precise typography, studio lighting, clean composition",
    "aspect_ratio": "4:5",
    "resolution": "2K"
  }
}
Production request with callback

Create the task, then wait for callback.url to receive the terminal notification.

Request body
{
  "model": "gpt-image-2-pro",
  "input": {
    "prompt": "A cinematic product campaign image for a silver smart watch, minimal set design, soft reflections",
    "aspect_ratio": "16:9",
    "resolution": "2K"
  },
  "callback": {
    "url": "https://your-domain.com/hiapi/callback",
    "when": "final"
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated image from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

Next steps