OpenAI: GPT Image 2.6 Flare (Text to Image) API Reference

About

OpenAI's speed-focused image model for most applications: fast, high-quality generation, 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-flare/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": "20260910052841251213071TXzgVYnX",
    "object": "image",
    "model": "openai/gpt-image-2.6-flare/text-to-image",
    "status": "created",
    "urls": {
      "query": "https://media.onerouter.pro/v1/images/tasks/20260910052841251213071TXzgVYnX"
    },
    "created_at": "2026-09-10 05:28:41.27"
  }
}

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/20260910052841251213071TXzgVYnX \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response with queue task status query

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "20260910052841251213071TXzgVYnX",
    "object": "image",
    "model": "openai/gpt-image-2.6-flare/text-to-image",
    "status": "in_progress",
    "fail_reason": "",
    "submit_time": 1789018121,
    "start_time": 1789018121,
    "finish_time": 0,
    "outputs": [],
    "created_at": "2026-09-10 05:28:41"
  }
}

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": "20260910052841251213071TXzgVYnX",
    "object": "image",
    "model": "openai/gpt-image-2.6-flare/text-to-image",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 1789018121,
    "start_time": 1789018121,
    "finish_time": 1789018141,
    "outputs": [
      "https://infron.ai/cdn/media/image/generated/official_openai_image_903cbd3c9dc24e938686a407eb524e1f.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:28:41"
  }
}

2. Schema

Input

ParameterTypeRequiredDefaultRangeDescription
modelstringYes--Explore all modelsModel name.
promptstringYes----Text prompt for generation; Positive text prompt.
nintegerNo1>=1Number of images to generate.
sizestringNoautoauto, WIDTHxHEIGHTauto or WIDTHxHEIGHT; width and height are multiples of 16, each side ≤3840, total pixels 655,360–8,294,400, long side/short side ≤3.
qualitystringNoautoauto, low, medium, high, xhigh, maxQuality for the generated image. Use 'auto' to let the model pick the best quality for the prompt.
complexitystringNo--low, medium, highHow 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_formatstringNopngpng, jpeg, webp, gif, svgOutput format for the images. gif (animated) and svg are generation-only and are not available on image-to-image models.
output_compressionintegerNo100[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_countintegerNo9[2,16]Number of frames for output_format = gif. Rejected with any other format.
framedurationmsintegerNo200[20,2000]Milliseconds per frame for output_format = gif, rounded to 10 ms upstream. Rejected with any other format.
backgroundstringNoautoauto, opaque, transparentTransparent backgrounds are only supported with PNG or WebP; transparent + JPEG is not allowed.
moderationstringNoautoauto, lowYou can control moderation strictness with the moderation parameter.

Animated GIF

  • output_format = gif returns an animated GIF; frame_count and frame_duration_ms are only accepted with gif.
  • GIF is not supported by image edits (image-to-image) or together with output_compression.
  • For GIF, size is 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 = svg returns 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 with output_compression or the GIF frame parameters.
  • The model that writes the SVG is chosen by the platform and is not a request parameter. A svg object 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-flare/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

ParameterTypeRangeDescription
codeinteger--Status code of the request.
messagestring--Status message of the request.
dataobject--Data of the task.
data.task_idstring--ID of the task.
data.objectstring--Object type of the task.
data.modelstring--Model name of the task.
data.statusstringcreated, in_progress, processing, completed, failedStatus of the task.
data.fail_reasonstring--Fail reason of the task.
data.submit_timeinteger--Timestamp of the task submission.
data.start_timeinteger--Timestamp of the task start.
data.finish_timeinteger--Timestamp of the task finish.
data.outputsarray--Outputs of the task.
data.created_atstring--Timestamp of the task creation.

Example output

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "20260910052841251213071TXzgVYnX",
    "object": "image",
    "model": "openai/gpt-image-2.6-flare/text-to-image",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 1789018121,
    "start_time": 1789018121,
    "finish_time": 1789018141,
    "outputs": [
      "https://infron.ai/cdn/media/image/generated/official_openai_image_903cbd3c9dc24e938686a407eb524e1f.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:28:41"
  }
}

3. Detailed Pricing

Billing itemUSD 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.

Official model · Official pricing