GPT Image 2.5 Flare Text to Image API
https://api.hiapi.ai /v1/tasks Submit a text-to-image or image-to-image task, then query it with GET /v1/tasks/:id.
gpt-image-2.5-flare Text to image mode.
Request parameters
model string required Use exactly gpt-image-2.5-flare/text-to-image.
input object required Mode parameters.
prompt string required Prompt length: 1-20,000 characters.
aspect_ratio enum optional Output aspect ratio.
resolution enum optional Output resolution. Price per output image: 1K $0.025, 2K $0.04, 4K $0.06 (default 1K).
background enum optional Optional background treatment: transparent, opaque, or auto; no default. transparent returns an image with an alpha channel at 1K, 2K, and 4K, and only supports png or webp; combining transparent with jpeg returns a 400. 1K transparent output may have slightly different dimensions from opaque output. For transparent output, describe an isolated subject with no backdrop, scenery, or shadow.
output_format enum optional Output image format: png, jpeg, or webp; defaults to PNG. Transparent backgrounds only support png or webp, and combining transparent with jpeg returns a 400. The fallback channel may return PNG.
callback object optional Optional terminal-state callback.
url string required http(s) URL that receives success or failure terminal notifications.
when enum optional Notify when the task succeeds or fails.
Request example
Replace the prompt with your description; no reference image is needed for this mode.
{
"model": "gpt-image-2.5-flare/text-to-image",
"input": {
"prompt": "A red apple isolated on a transparent background.",
"aspect_ratio": "auto",
"background": "transparent",
"resolution": "1K"
}
}{
"code": 200,
"message": "success",
"data": {
"taskId": "tk-hiapi-..."
}
}Getting the result
- Receive a taskId after submission.
- Poll GET /v1/tasks/:id or wait for the terminal callback.
- When status=success, download the image from data.output[].url before expireAt.
- When status=fail, inspect data.error, correct the request, and resubmit.