> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT-Image-2.6 · Text-to-image

> GPT-Image-2.6 Flare / Sunburst · POST /v1/images/generations

## 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

| Model ID | Best suited for |
| - | - |
| `gpt-image-2.6-flare` | Fast iteration and interactive generation |
| `gpt-image-2.6-sunburst` | Detailed visual work and complex layouts |

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

**Authorization** `string` *required*

Bearer \$GRAVITEX\_API\_KEY

**Content-Type** `string` *required*

application/json

## Request parameters

| Parameter | Type | Description |
| - | - | - |
| `model` | string | Required: gpt-image-2.6-flare or gpt-image-2.6-sunburst |
| `prompt` | string | Required description of the image to generate; up to 32,000 characters |
| `quality` | string | auto / low / medium / high / xhigh / max; default auto |
| `complexity` | string | low / medium / high; default high. Planning effort independent of quality |
| `size` | string | auto or WxH with dimensions divisible by 16; model size and pixel budgets apply |
| `n` | integer | 1–10; SVG requires 1 |
| `background` | string | auto / opaque / transparent; use png or webp for transparent raster output |
| `output_format` | string | png / jpeg / webp / gif; generation also supports svg |
| `output_compression` | integer | 0–100 for jpeg/webp only; unavailable for GIF/SVG |
| `moderation` | string | auto / low; default auto |
| `safety_identifier` | string | Stable hashed end-user identifier, up to 128 characters; replaces user |
| `stream` | boolean | Default false. When true, read SSE events instead of parsing a single JSON response. Unsupported for GIF; SVG unsupported |
| `partial_images` | integer | Raster streaming only: 0–3, default 0. Requested preview count; fewer previews may arrive. Unsupported for GIF; SVG unsupported |
| `frame_count` | integer | GIF only: 2–16; default 9 |
| `frame_duration_ms` | integer | GIF only: default 200; guide recommends 20–2000ms rounded to 10ms |
| `svg` | object | Required for SVG: author model and optional reasoning settings |

## 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

```bash theme={null}
curl https://api.gravitex.ai/v1/images/generations \
  -H "Authorization: Bearer $GRAVITEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2.6-flare",
  "prompt": "A clean botanical poster with precise typography",
  "quality": "medium",
  "complexity": "high",
  "size": "1024x1024"
}'
```

### Animated GIF

```bash theme={null}
curl https://api.gravitex.ai/v1/images/generations \
  -H "Authorization: Bearer $GRAVITEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2.6-flare",
  "prompt": "A fox mascot waving, seamless looping animation",
  "output_format": "gif",
  "frame_count": 9,
  "frame_duration_ms": 200,
  "size": "auto"
}'
```

### SVG output

> [!NOTE]
>
> 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.

```bash theme={null}
curl https://api.gravitex.ai/v1/images/generations \
  -H "Authorization: Bearer $GRAVITEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2.6-flare",
  "prompt": "A simple botanical logo with editable paths",
  "output_format": "svg",
  "n": 1,
  "quality": "medium",
  "complexity": "high",
  "svg": {
    "model": "gpt-6.1-sol",
    "reasoning": {
      "effort": "low"
    }
  }
}'
```

#### Field guide

| Field | Purpose |
| - | - |
| `model` | Image model that renders the reference image; use this page’s 2.6 model ID |
| `prompt` | Desired SVG content, text, layout, and style |
| `output_format` | Set to svg |
| `n` | Must be 1 for SVG |
| `quality` | Rendering quality of the reference image; medium in this example |
| `complexity` | Image-model planning effort for the reference; high in this example |
| `svg.model` | SVG author model; required for SVG output |
| `svg.reasoning.effort` | Author-model reasoning effort, independent of complexity. Use low only if the chosen author supports it; omit reasoning to use its default |

> [!NOTE]
>
> 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

```bash theme={null}
curl --no-buffer https://api.gravitex.ai/v1/images/generations \
  -H "Authorization: Bearer $GRAVITEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-image-2.6-flare",
  "prompt": "A simple green botanical illustration",
  "quality": "medium",
  "size": "1024x1024",
  "stream": true,
  "partial_images": 1
}'
```

## 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.

```json theme={null}
{
  "created": 1794268800,
  "data": [
    {
      "b64_json": "<BASE64_IMAGE_DATA>"
    }
  ],
  "usage": {
    "input_tokens": 100,
    "output_tokens": 824,
    "total_tokens": 924
  }
}
```

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.

| Type | USD / 1M tokens |
| - | - |
| Text input | \$5.00 |
| Cached text input | \$1.25 |
| Image input | \$8.00 |
| Cached image input | \$2.00 |
| Image output | \$30.00 |

## Official references

* [Image generation guide](https://developers.openai.com/api/docs/guides/image-generation)
* [API Reference](https://developers.openai.com/api/reference/resources/images/methods/generate)
* [Flare](https://developers.openai.com/api/docs/models/gpt-image-2.6-flare)
* [Sunburst](https://developers.openai.com/api/docs/models/gpt-image-2.6-sunburst)
* [Pricing](https://developers.openai.com/api/docs/pricing)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.