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

Introduction

GPT-Image-2.5 includes Flare for fast everyday generation and Sunburst for detailed visual work. Use POST /v1/images/generations to turn text descriptions into posters, product visuals, illustrations, icons, and infographics. Both models support auto, low, medium, high, xhigh, and max quality, with PNG, JPEG, and WebP output. Adjust quality, size, and background for your task. Use PNG or WebP for transparent backgrounds.

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

Transparent background

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

The default size is auto. Explicit WxH dimensions must be multiples of 16, with aspect ratios between 1:3 and 3:1. The image-2 guide specifies a maximum edge of 3840px and 655,360–8,294,400 pixels; the 2.5 reference also requires model-specific edge and pixel limits. Confirm the actual 2.6 budget, especially for GIF, rather than assuming older limits. This page includes explicitly documented GPT-Image-2.5 workflows. It does not assume the 2.6-specific complexity, GIF, or SVG guidance applies to 2.5. A field in a shared API schema does not guarantee support on every model or channel.

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. Returns data[].b64_json and usage. Decode Base64 before saving images. The following are OpenAI standard rates, not a GravitexAI quote. Cached rates are official reference rates. For GPT Image 2 / 2.5, the guide limits cached input discounts to the Responses image tool; they do not apply to direct Images API calls, including edits. Platform billing follows the console.

Official references