About
OpenAI's detail-focused image model for premium visual work: higher quality and more consistent results, now with adjustable complexity and animated GIF output.
1. Calling the API
Setup your API Key
To begin using Infron, you first need to create an account and generate your API Key.
Once you have your API key, set it as an environment variable in your runtime environment. This allows your applications to securely access Infron’s API.
export INFRON_KEY="YOUR_API_KEY"
Submit a request
For long-running requests, you can poll for results.
curl https://media.onerouter.pro/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912.",
"n": 1,
"size": "auto",
"quality": "auto",
"background": "auto",
"moderation": "low"
}'
Response with queue task id
The response will look like this:
{
"code": 200,
"message": "success",
"data": {
"task_id": "20260910054254377517742WetVRjdp",
"object": "image",
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"status": "created",
"urls": {
"query": "https://media.onerouter.pro/v1/images/tasks/20260910054254377517742WetVRjdp"
},
"created_at": "2026-09-10 05:42:54.40"
}
}
Fetch request status
You can fetch the status of a request to check if it is completed or still in progress.
curl https://media.onerouter.pro/v1/images/tasks/{task_id} \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
# For example
curl https://media.onerouter.pro/v1/images/tasks/20260910054254377517742WetVRjdp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response with queue task status query
{
"code": 200,
"message": "success",
"data": {
"task_id": "20260910054254377517742WetVRjdp",
"object": "image",
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"status": "in_progress",
"fail_reason": "",
"submit_time": 1789018974,
"start_time": 1789018974,
"finish_time": 0,
"outputs": [],
"created_at": "2026-09-10 05:42:54"
}
}
Possible statuses:
- created
- in_progress
- processing
- completed
- failed
created -> in_progress → processing → completed | failed
Poll every 1-2 seconds until status is "completed" or "failed"
Get the result (when status is "completed")
Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.
{
"code": 200,
"message": "success",
"data": {
"task_id": "20260910054254377517742WetVRjdp",
"object": "image",
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"status": "completed",
"fail_reason": "",
"submit_time": 1789018974,
"start_time": 1789018974,
"finish_time": 1789019012,
"outputs": [
"https://infron.ai/cdn/media/image/generated/official_openai_image_061d8ccf443d4d7fabad7156e76b3efe.png"
],
"usage": {
"completion_tokens": 1544,
"completion_tokens_details": {
"image_tokens": 1544,
"text_tokens": 0
},
"image_count": 1,
"image_quality": "auto",
"prompt_tokens": 39,
"prompt_tokens_details": {
"image_tokens": 0,
"text_tokens": 39
},
"quality": "auto",
"size": "auto",
"total_tokens": 1583,
"web_search": false
},
"cost": {
"total_cost": 0.046515,
"cost_details": {
"prompt_cost": 0,
"completion_cost": 0,
"image_cost": 0.046515,
"video_cost": 0,
"audio_cost": 0,
"native_web_search_cost": 0,
"plugin_web_search_cost": 0,
"tools_cost": 0,
"prompt_cache_read_cost": 0,
"prompt_cache_write_cost": 0,
"prompt_cache_write_5_min": 0,
"prompt_cache_write_1_h": 0,
"reasoning_cost": 0,
"discount_rate": 1,
"is_byok": false,
"byok_cost": 0
}
},
"created_at": "2026-09-10 05:42:54"
}
}
2. Schema
Input
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| model | string | Yes | -- | Explore all models | Model name. |
| prompt | string | Yes | -- | -- | Text prompt for generation; Positive text prompt. |
| n | integer | No | 1 | >=1 | Number of images to generate. |
| size | string | No | auto | auto, WIDTHxHEIGHT | auto or WIDTHxHEIGHT; width and height are multiples of 16, each side ≤3840, total pixels 655,360–8,294,400, long side/short side ≤3. |
| quality | string | No | auto | auto, low, medium, high, xhigh, max | Quality for the generated image. Use 'auto' to let the model pick the best quality for the prompt. |
| complexity | string | No | -- | low, medium, high | How much planning the model does before generating. Omit it to use the upstream default (high). There is no separate fee; higher complexity can increase latency. |
| output_format | string | No | png | png, jpeg, webp, gif, svg | Output format for the images. gif (animated) and svg are generation-only and are not available on image-to-image models. |
| output_compression | integer | No | 100 | [0,100] | Output compression for the images. Only supported for webp/jpeg formats. Out-of-bounds values are clamped to 0 or 100; an explicit 0 is preserved. Transmission alongside PNG is rejected. |
| frame_count | integer | No | 9 | [2,16] | Number of frames for output_format = gif. Rejected with any other format. |
| framedurationms | integer | No | 200 | [20,2000] | Milliseconds per frame for output_format = gif, rounded to 10 ms upstream. Rejected with any other format. |
| background | string | No | auto | auto, opaque, transparent | Transparent backgrounds are only supported with PNG or WebP; transparent + JPEG is not allowed. |
| moderation | string | No | auto | auto, low | You can control moderation strictness with the moderation parameter. |
Animated GIF
output_format=gifreturns an animated GIF;frame_countandframe_duration_msare only accepted withgif.- GIF is not supported by image edits (image-to-image) or together with
output_compression. - For GIF,
sizeis the size of one frame. OpenAI lays all frames out on one sheet, and that sheet must fit the raster limits (at least 655,360 pixels in total, longest edge at most 3840). Combinations that do not fit fail with an upstream error and are not billed. Verified examples: 512x512 with 9 or 16 frames, 832x832 with 4 frames, 1024x576 with 2 frames. 1024x1024 with 4 or more frames and 256x256 with 9 frames do not fit. - Raster formats (
png,jpeg,webp) still need at least 655,360 pixels in total, for example 1024x640.
SVG
output_format=svgreturns a vector image. Scripts, event handlers and external references are removed before the file is stored.- SVG requires
n= 1 and is not supported by image edits (image-to-image) or together withoutput_compressionor the GIF frame parameters. - The model that writes the SVG is chosen by the platform and is not a request parameter. A
svgobject in the request is ignored.
Example request
curl https://media.onerouter.pro/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"prompt": "create a realistic image taken with iphone at these coordinates 41°43′32″N 49°56′49″W 15 April 1912.",
"n": 1,
"size": "auto",
"quality": "auto",
"background": "auto",
"moderation": "low"
}'
Output
| Parameter | Type | Range | Description |
|---|---|---|---|
| code | integer | -- | Status code of the request. |
| message | string | -- | Status message of the request. |
| data | object | -- | Data of the task. |
| data.task_id | string | -- | ID of the task. |
| data.object | string | -- | Object type of the task. |
| data.model | string | -- | Model name of the task. |
| data.status | string | created, in_progress, processing, completed, failed | Status of the task. |
| data.fail_reason | string | -- | Fail reason of the task. |
| data.submit_time | integer | -- | Timestamp of the task submission. |
| data.start_time | integer | -- | Timestamp of the task start. |
| data.finish_time | integer | -- | Timestamp of the task finish. |
| data.outputs | array | -- | Outputs of the task. |
| data.created_at | string | -- | Timestamp of the task creation. |
Example output
{
"code": 200,
"message": "success",
"data": {
"task_id": "20260910054254377517742WetVRjdp",
"object": "image",
"model": "openai/gpt-image-2.6-sunburst/text-to-image",
"status": "completed",
"fail_reason": "",
"submit_time": 1789018974,
"start_time": 1789018974,
"finish_time": 1789019012,
"outputs": [
"https://infron.ai/cdn/media/image/generated/official_openai_image_061d8ccf443d4d7fabad7156e76b3efe.png"
],
"usage": {
"completion_tokens": 1544,
"completion_tokens_details": {
"image_tokens": 1544,
"text_tokens": 0
},
"image_count": 1,
"image_quality": "auto",
"prompt_tokens": 39,
"prompt_tokens_details": {
"image_tokens": 0,
"text_tokens": 39
},
"quality": "auto",
"size": "auto",
"total_tokens": 1583,
"web_search": false
},
"cost": {
"total_cost": 0.046515,
"cost_details": {
"prompt_cost": 0,
"completion_cost": 0,
"image_cost": 0.046515,
"video_cost": 0,
"audio_cost": 0,
"native_web_search_cost": 0,
"plugin_web_search_cost": 0,
"tools_cost": 0,
"prompt_cache_read_cost": 0,
"prompt_cache_write_cost": 0,
"prompt_cache_write_5_min": 0,
"prompt_cache_write_1_h": 0,
"reasoning_cost": 0,
"discount_rate": 1,
"is_byok": false,
"byok_cost": 0
}
},
"created_at": "2026-09-10 05:42:54"
}
}
3. Detailed Pricing
| Billing item | USD per 1 million tokens |
|---|---|
| Text input | $5.00 |
| Cached text input | $1.25 |
| Image input | $8.00 |
| Cached image input | $2.00 |
| Image output | $30.00 |
For uncached requests: (text_input_tokens × 5 + image_input_tokens × 8 + image_output_tokens × 30) / 1,000,000 USD, before any account discount. Images of equal size and quality can use different numbers of tokens; this is not a fixed per-image fee. The illustrated usage is billed at $0.022494.
Failed tasks refund their reserved quota. Cached-token discounts remain unverified because repeated live requests did not return cache-hit token details.
Animated GIF output is billed from the actual upstream token usage at the same rates; there is no separate per-frame or per-format fee.
SVG output is billed in two parts: the image tokens at the rates above, plus the tokens used to write the SVG at gpt-6.1-sol rates. Those tokens are reported separately as usage.svg_usage on the task and are included in total_cost.