Skip to main content
POST
GPT-Image-2.6 · Text-to-image

Introduction

GPT-Image-2.6 is OpenAI’s image model family, with Flare for fast iteration and Sunburst for detailed visual work. Use POST /v1/images/generations to turn text descriptions into images for posters, product visuals, illustrations, icons, and infographics. Both models support PNG, JPEG, and WebP images, as well as animated GIF and SVG vector output, subject to project access and channel availability. GIF suits looping motion; SVG suits icons and illustrations that need scalable, editable paths and colors. Use quality for rendering quality and the independent complexity setting for planning before rendering. Set dimensions and background for your use case, then inspect text, layout, and details. Choose Flare when response time matters most, or Sunburst for demanding compositions and visual detail.

Choose a model

Both models use the endpoints, parameters, and response structure documented here. Examples use Flare; switch to Sunburst by replacing model. Set other fields for your workload.

Authentication

string
required
Bearer $GRAVITEX_API_KEY
string
required
application/json

Request parameters

Request examples

Examples read the platform token from GRAVITEX_API_KEY in your terminal environment. For uploads, curl -F generates Content-Type and boundary automatically; do not manually set a bare multipart/form-data header.

Basic generation

Animated GIF

SVG output

This channel requires svg.model for SVG output; omitting it returns missing_required_parameter. gpt-6.1-sol with reasoning.effort=low was tested successfully on 2026-11-09. Confirm channel availability before choosing a different author.

Specify the SVG author

This example uses gpt-6.1-sol, successfully tested as the SVG author on this channel on 2026-11-09. Use an available author model for other channels or projects.

Field guide

Do not substitute either 2.6 image model for the SVG author. Available authors and supported effort values depend on the project and chosen model.
Decode data[0].b64_json and save as .svg. Reference-image usage and author-model svg_usage are billed at their respective rates. user is deprecated and retained for compatibility. Use safety_identifier; a non-empty value takes precedence, otherwise the API falls back to user.

Streaming

Limits and notes

GIF size describes each frame. Frame count, n, and model pixel budgets jointly constrain it. Prefer auto; reduce frames or dimensions if limits are exceeded. GIF requires preview access. Omit mask, stream, partial_images, and custom output_compression. Frame count, frame dimensions, and n share the request pixel budget; reduce them or use size=auto if limits are exceeded. SVG is supported here on generation only, subject to project access. Set n=1; omit stream, partial_images, output_compression, and prompt_rewriter. This channel requires svg.model. Complexity has no separate fee, but can affect latency and results. Lower complexity does not guarantee a fixed response time or per-image cost.

Response example

This is a schematic non-streaming response. Image data and token counts are illustrative, not an actual generation. Decode b64_json to the selected file format; do not save the Base64 text directly as an image.
With stream=true, read SSE events for previews and the final image. Do not parse the entire response as one JSON object.

Response and billing

Non-streaming examples return image bytes as b64_json. Do not request response_format=url expecting a hosted image URL. Equal token rates do not imply equal cost per image; use actual usage. Decode data[].b64_json into the selected file format. usage reports token consumption. SVG can also return svg_usage for separately billed author-model tokens. Prices below are OpenAI standard rates, not a GravitexAI quote; platform billing follows the console.

Official references