GPT Image 2.6

Use gpt-image-2.6 for text-to-image generation, reference-image editing, and text-to-GIF. Choose flare for fast iteration or sunburst for detailed composition and editing. Each request generates one output; n must be 1 or omitted. SVG output is currently unavailable.

Try the Playground or view the model.

Pricing

Both versions use the same prices as GPT Image 2.5:

ResolutionCredits per outputPrice per output
1k (default)3.4$0.017
2k12$0.06
4k16$0.08

These are standard prices before your account's configured multiplier. Quality, output format, complexity, aspect ratio, and reference images do not change the price. The applicable charge is rounded to two decimal places and reserved when the task is submitted. A successful task keeps its charge; a confirmed generation failure refunds the charge once. Uncertain submission or delivery outcomes retain the reservation until reconciled, so a failed status alone does not prove a refund. Querying a task or retrying a callback never charges or refunds it again.

Create a task

curl -X POST https://api.aivideoapi.ai/v1/images/generations \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.6",
    "callback_url": "https://your-server.com/webhook",
    "input": {
      "prompt": "A warm reading corner beside a rainy window, soft lamp light",
      "version": "flare",
      "resolution": "1k",
      "aspect_ratio": "16:9",
      "quality": "high",
      "n": 1
    }
  }'

The request contains model, an input object, and an optional top-level callback_url.

Input parameters

FieldTypeDescription
promptstring, requiredGeneration or editing instructions; must not be blank, including when reference images are supplied.
versionstringflare (default) or sunburst.
resolutionstring1k (default), 2k, or 4k; uppercase is also accepted.
aspect_ratiostringauto (default), 1:1, 3:2, 2:3, 4:3, 3:4, 5:4, 4:5, 16:9, 9:16, or 21:9.
sizestringAlias for aspect_ratio. If both are supplied, they must agree. Pixel dimensions such as 1024x1024 are not accepted.
nintegerMust be 1; defaults to 1.
qualitystringOptional: auto, low, medium, high, xhigh, or max. When omitted, the parameter is not sent upstream and the model chooses automatically; auto is not fixed to low. Quality does not affect the price per image. Higher settings typically take longer.
output_formatstringpng (default), jpeg, webp, or gif; jpg is an alias for jpeg. SVG is not supported.
complexitystringOptional: low, medium, or high. When omitted, the parameter is not sent upstream and the model decides. Controls image complexity: low suits simple icons and flat illustrations, while high suits rich detail. Does not affect the price per image.
image_urlsstring[]Up to 16 public HTTP(S) image URLs or image Base64 Data URLs, each up to 20 MB. PNG/JPEG/WebP/GIF/BMP are supported at 1K; 2K and 4K references cannot be GIF or BMP.

Enum values are case-insensitive and trimmed. For text-to-image, auto uses a square composition. For image editing it selects the closest supported ratio to the first readable reference image; it does not preserve exact source dimensions. The 4K square output is 2880×2880, while 4K 16:9 is 3840×2160.

Playground uploads currently accept JPG/PNG/WebP up to 10 MB each. Use the API for the additional documented reference formats and sizes.

Reference-image editing

{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "Place the product from the first image into the second scene. Preserve the label and match the lighting.",
    "version": "sunburst",
    "resolution": "2k",
    "aspect_ratio": "auto",
    "output_format": "webp",
    "n": 1,
    "image_urls": ["https://example.com/product.png", "https://example.com/scene.jpg"]
  }
}

Replace these example URLs with publicly accessible images.

GIF animation

GIF accepts text prompts only, with no reference images. Omit size and aspect_ratio or set them to auto. Describe the motion and loop in the prompt.

{
  "model": "gpt-image-2.6",
  "input": {
    "prompt": "A cartoon puppy waves one paw and returns to its starting pose. White background, fixed camera, seamless loop.",
    "version": "flare",
    "resolution": "1k",
    "output_format": "gif",
    "quality": "medium",
    "n": 1
  }
}

SVG and its svg configuration are unavailable. width, height, markup, and markup_url are unsupported. background, moderation, output_compression, seed, negative_prompt, and style have no effect. response_format does not change delivery: the task returns file URLs, not Base64 output.

Task response and polling

Submission returns the platform task ID:

{
  "code": 200,
  "msg": "success",
  "data": { "taskId": "397ce9f2-c04e-4244-ac33-3af19a7cc297" }
}

Query GET https://api.aivideoapi.ai/v1/tasks/{taskId} with the same Bearer authentication every 3–5 seconds. Continue polling the existing task after a client timeout instead of submitting another generation. Submitted GPT Image 2.6 tasks cannot be cancelled.

{
  "id": "397ce9f2-c04e-4244-ac33-3af19a7cc297",
  "status": "completed",
  "model": "gpt-image-2.6",
  "credits_consumed": 3.4,
  "output": { "urls": ["https://file.aivideoapi.ai/images/example.gif"] }
}

Tasks progress through pending and processing, then completed or failed. Read images or animations from output.urls, and download results you want to retain. A failed task exposes an actionable, sanitized error.message when available.

Callbacks

Supply callback_url at the top level to receive a POST when the task completes or fails. The JSON body uses the same task structure as the query response. Headers include Content-Type: application/json, X-Event (task.completed or task.failed), X-Task-Id, and X-Timestamp (Unix seconds).

Return HTTP 2xx within 10 seconds. Delivery retries up to three times including the initial attempt, so process notifications idempotently by task ID. Callback delivery failures do not turn a successful generation into a refundable failure.


Error Codes

When a request fails, the API returns a JSON error response:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

Error Reference

HTTP StatusCodeTypeDescription
400invalid_requestinvalid_request_errorMissing or invalid parameters
401invalid_api_keyauthentication_errorAPI key is invalid, disabled, or deleted
402insufficient_creditsbilling_errorCredit balance too low, please top up
403ip_not_allowedpermission_errorRequest IP not in the key's allowlist
404model_not_foundinvalid_request_errorModel does not exist or is inactive
404task_not_foundinvalid_request_errorTask ID does not exist
429rate_limit_exceededrate_limit_errorToo many requests, please slow down
429spend_limit_exceededbilling_errorKey spend limit reached (hourly/daily/total)
500internal_errorapi_errorUnexpected server error
503upstream_errorupstream_errorUpstream AI provider returned an error

Common Scenarios

invalid_request (400)

Returned when required fields are missing or invalid.

{
  "error": {
    "code": "invalid_request",
    "message": "'model' is required.",
    "type": "invalid_request_error"
  }
}

insufficient_credits (402)

Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.

invalid_api_key (401)

Possible causes:

  • The key does not start with sk-
  • The key has been disabled or deleted
  • The user account has been banned

upstream_error (503)

The upstream AI provider returned an error. This may happen when:

  • The input contains sensitive or prohibited content
  • The provider is temporarily unavailable
  • The request parameters are not supported by the provider

Credits are automatically refunded when a task fails due to upstream errors.