gpt-image-2.6-sunburst
Text to Image
POST
/
v1
/
images
/
generations
Authorization
- Auth Type:
Bearer Auth(In:header) - Format:
Authorization: Bearer <YOUR_API_KEY> - Description: Use
Bearer <YOUR_API_KEY>. Format:Authorization: Bearer sk-xxxxxx. - API Key: where API Key is your AGCloud API KEY
gpt-image-2.6-sunburst. Send a JSON request to https://aiandgpu.com/v1/images/generations.
Request Examples
curl --location 'https://aiandgpu.com/v1/images/generations' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2.6-sunburst",
"prompt": "Draw a watercolor illustration of a red panda reading under a maple tree.",
"n": 1,
"size": "1024x1024",
"quality": "medium",
"output_format": "png"
}'
import base64
import requests
response = requests.post(
"https://aiandgpu.com/v1/images/generations",
headers={"Authorization": "Bearer <YOUR_API_KEY>"},
json={
"model": "gpt-image-2.6-sunburst",
"prompt": "Draw a watercolor illustration of a red panda reading under a maple tree.",
"n": 1,
"size": "1024x1024",
"quality": "medium",
"output_format": "png",
},
timeout=600,
)
response.raise_for_status()
data = response.json()
with open("generated.png", "wb") as image_file:
image_file.write(base64.b64decode(data["data"][0]["b64_json"]))
// Node.js 18+; save as an .mjs file.
import { writeFile } from "node:fs/promises";
const response = await fetch("https://aiandgpu.com/v1/images/generations", {
method: "POST",
headers: {
Authorization: "Bearer <YOUR_API_KEY>",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-image-2.6-sunburst",
prompt: "Draw a watercolor illustration of a red panda reading under a maple tree.",
n: 1,
size: "1024x1024",
quality: "medium",
output_format: "png",
}),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
await writeFile("generated.png", Buffer.from(data.data[0].b64_json, "base64"));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"time"
)
func main() {
body, err := json.Marshal(map[string]any{
"model": "gpt-image-2.6-sunburst",
"prompt": "Draw a watercolor illustration of a red panda reading under a maple tree.",
"n": 1,
"size": "1024x1024",
"quality": "medium",
"output_format": "png",
})
if err != nil { panic(err) }
req, err := http.NewRequest("POST", "https://aiandgpu.com/v1/images/generations", bytes.NewReader(body))
if err != nil { panic(err) }
req.Header.Set("Authorization", "Bearer <YOUR_API_KEY>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 10 * time.Minute}
res, err := client.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
result, err := io.ReadAll(res.Body)
if err != nil { panic(err) }
if res.StatusCode >= 400 { panic(string(result)) }
fmt.Println(string(result))
}
// Java 11+; save as GenerateImage.java.
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class GenerateImage {
public static void main(String[] args) throws Exception {
String body = "{\"model\":\"gpt-image-2.6-sunburst\","
+ "\"prompt\":\"Draw a watercolor illustration of a red panda reading under a maple tree.\","
+ "\"n\":1,\"size\":\"1024x1024\",\"quality\":\"medium\",\"output_format\":\"png\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://aiandgpu.com/v1/images/generations"))
.timeout(Duration.ofMinutes(10))
.header("Authorization", "Bearer <YOUR_API_KEY>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 400) throw new RuntimeException(response.body());
System.out.println(response.body());
}
}
<?php
$curl = curl_init("https://aiandgpu.com/v1/images/generations");
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_TIMEOUT => 600,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <YOUR_API_KEY>",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"model" => "gpt-image-2.6-sunburst",
"prompt" => "Draw a watercolor illustration of a red panda reading under a maple tree.",
"n" => 1,
"size" => "1024x1024",
"quality" => "medium",
"output_format" => "png",
]),
]);
$response = curl_exec($curl);
if ($response === false) throw new RuntimeException(curl_error($curl));
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($status >= 400) throw new RuntimeException($response);
echo $response;
// .NET 6+
using System;
using System.Net.Http;
using System.Net.Http.Json;
using var client = new HttpClient { Timeout = TimeSpan.FromMinutes(10) };
client.DefaultRequestHeaders.Add("Authorization", "Bearer <YOUR_API_KEY>");
using var response = await client.PostAsJsonAsync(
"https://aiandgpu.com/v1/images/generations",
new {
model = "gpt-image-2.6-sunburst",
prompt = "Draw a watercolor illustration of a red panda reading under a maple tree.",
n = 1,
size = "1024x1024",
quality = "medium",
output_format = "png"
}
);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
data[].b64_json, not image URLs. Do not send response_format or style; describe the desired style in prompt.
Request Parameters
Checked against the OpenAI generation reference and image guide on November 12, 2026. These are upstream parameters; gateway availability depends on the enabled route.| Field | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | ✅ | - | gpt-image-2.6-sunburst. |
prompt | string | ✅ | - | up to 32,000 characters. |
n | integer | - | 1 | 1–10; default 1. |
size | string | - | auto | default auto; standard sizes include 1024x1024, 1536x1024, 1024x1536. |
quality | string | - | auto | auto (default), low, medium, high. |
background | string | - | auto | auto (default), opaque, transparent; transparency requires PNG/WebP. |
output_format | string | - | png | png (default), jpeg, webp, gif, svg; see format restrictions below. |
output_compression | integer | - | 100 | 0–100, JPEG/WebP only; generation default 100. |
moderation | string | - | auto | auto (default) or low. |
stream | boolean | - | false | default false; consume SSE rather than a single JSON document when enabled. |
partial_images | integer | - | 0 | 0–3, default 0; streaming previews may be fewer than requested. |
safety_identifier | string | - | - | privacy-preserving end-user identifier, at most 128 characters. |
user | string | - | - | deprecated fallback; prefer safety_identifier. |
GPT Image 2.6 controls
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
complexity | string | - | high | low, medium, high; default high. Planning effort is separate from rendering quality. |
frame_count | integer | - | 9 | GIF only, integer 2–16, default 9. |
frame_duration_ms | integer | - | 200 | GIF only, integer, default 200. The guide specifies 20–2000 ms and 10 ms rounding; the reference specifies a minimum of 20 and an encoded delay cap, which is not a confirmed request maximum. Use the guide range. |
svg | object | - | - | optional author-selection object. Send only when SVG model selection is enabled; then supply svg.model. Optional svg.reasoning.effort uses the author’s supported subset of none, minimal, low, medium, high, xhigh, max. Otherwise omit svg. |
size: "auto" unless the model’s GIF pixel limits are known. SVG generation requires n: 1 and cannot use streaming, partial images, custom compression, or prompt_rewriter.
Official documentation boundaries
The reference explicitly associatesxhigh/max quality and custom static-image dimensions with earlier named models, without clearly listing 2.6. Do not infer 2.6 support from a cross-model enum. Examples use standard sizes and medium quality.
The edit reference lists SVG fields, but the guide says SVG output is not supported by the edit endpoint. Use the generation endpoint for SVG until this discrepancy is resolved. Do not send response_format, style, or unconfirmed input_fidelity settings for this model.