Docs / Model List / GPT Image 2.5 Sunburst Image model · OpenAI
GPT Image 2.5 Sunburst API GPT Image 2.5 Sunburst is a second GPT Image 2.5 model on TokenRa. It uses the same OpenAI-compatible endpoints and parameters as GPT Image 2.5 Flare and returned finished images in about 30 seconds in testing.
Model ID gpt-image-2.5-sunburst
Input Text, image (edits)
Output PNG image
Billing Per request Capabilities
Capabilities & endpoints Both endpoints are OpenAI-compatible, so the OpenAI SDKs work with base_url=https://tokenra.io/v1. Both were called successfully on 2026-10-23.
Generate Edit
POST https://tokenra.io/v1/images/generations Tested
Text to image. JSON body. Returns finished images in the response.
POST https://tokenra.io/v1/images/edits Tested
Image to image and editing. multipart/form-data with the source image in image.
Request
Request parameters Generate: POST /v1/images/generations Parameter Type Required Description modelstring Yes Model ID: gpt-image-2.5-sunburst. promptstring Yes What to draw. sizestring No auto (default) or a size such as 1024x1536. With auto the test returned a 1254x1254 image.qualitystring No auto (default), low, medium or high.ninteger No Number of images, default 1. n: 2 was tested. response_formatstring No b64_json (default) returns base64 data; url returns a temporary link.
Edit: POST /v1/images/edits Parameter Type Required Description modelstring Yes Model ID: gpt-image-2.5-sunburst. promptstring Yes How to change the image. imagefile Yes Source image (PNG tested). response_formatstring No b64_json (default) or url, as for generation.
Response
Response format {
"created": 1792766203,
"data": [
{"b64_json": "iVBORw0KGgoAAAANSUhEUgAABOYAAATm..."}
],
"background": "auto",
"output_format": "png",
"quality": "auto",
"size": "auto",
"usage": {
"input_tokens": 180,
"input_tokens_details": {"image_tokens": 0, "text_tokens": 180},
"output_tokens": 1056,
"total_tokens": 1236
}
}Field Type Description createdinteger Unix timestamp. data[].b64_jsonstring Base64 PNG (default). Decode and save it. data[].urlstring Temporary link when response_format is url. Download it promptly. size / quality / output_formatstring Settings that were applied. usageobject Token usage reported by the model.
Errors
Errors & limits Common errors HTTP error.code Meaning What to do 401— Missing, wrong or deleted API key. The message is Invalid token. Check the Authorization: Bearer header and the key in the console. 400— The body is not valid JSON. Fix the JSON and send Content-Type: application/json. 500invalid_requestA required field is missing, for example messages. Add the field named in the message. Retrying will not help. 403insufficient_user_quotaYour balance or plan quota is used up. Top up in the console, then retry. 503model_not_foundUnknown model ID, or no channel serves it for your group. Check the ID in the model list or with GET /v1/models. 429— Too many requests. Back off exponentially and retry. 5xx— The upstream provider failed or timed out. Retry a few times; keep the request id if it persists.
Limits and notes Each request took about 30 seconds in testing. Set the client timeout to at least 120 seconds. A base64 PNG is roughly 1–3 MB of JSON. Use response_format: "url" if you only need a link. Billing is per request, not per token. See the live rate in the Model Square. Generate Edit
cURL Python JavaScript Java
curl https://tokenra.io/v1/images/generations \
-H "Authorization: Bearer $TOKENRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5-sunburst",
"prompt": "A watercolor fox reading a book under a desk lamp",
"size": "1024x1536",
"quality": "low",
"response_format": "url"
}'import base64
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["TOKENRA_API_KEY"], base_url="https://tokenra.io/v1")
result = client.images.generate(
model="gpt-image-2.5-sunburst",
prompt="A watercolor fox reading a book under a desk lamp",
size="1024x1536",
quality="low",
)
with open("image.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))import { writeFile } from "node:fs/promises";
const resp = await fetch("https://tokenra.io/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TOKENRA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-image-2.5-sunburst",
prompt: "A watercolor fox reading a book under a desk lamp",
size: "1024x1536",
quality: "low",
}),
});
const data = await resp.json();
await writeFile("image.png", Buffer.from(data.data[0].b64_json, "base64"));
console.log("saved image.png");import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Image {
public static void main(String[] args) throws Exception {
String body = """
{"model": "gpt-image-2.5-sunburst", "prompt": "A watercolor fox reading a book under a desk lamp", "size": "1024x1536", "quality": "low"}
""";
HttpRequest request = HttpRequest.newBuilder(URI.create("https://tokenra.io/v1/images/generations"))
.header("Authorization", "Bearer " + System.getenv("TOKENRA_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
String json = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()).body();
Matcher m = Pattern.compile("\"b64_json\"\\s*:\\s*\"([^\"]+)\"").matcher(json);
if (!m.find()) throw new RuntimeException(json);
Files.write(Path.of("image.png"), Base64.getDecoder().decode(m.group(1)));
System.out.println("saved image.png");
}
}curl https://tokenra.io/v1/images/edits \
-H "Authorization: Bearer $TOKENRA_API_KEY" \
-F model="gpt-image-2.5-sunburst" \
-F prompt="Make the lamp light warmer" \
-F image=@image.png \
-F response_format=urlimport base64
import os
from openai import OpenAI
client = OpenAI(api_key=os.environ["TOKENRA_API_KEY"], base_url="https://tokenra.io/v1")
with open("image.png", "rb") as image:
result = client.images.edit(model="gpt-image-2.5-sunburst", image=image, prompt="Make the lamp light warmer")
with open("edited.png", "wb") as f:
f.write(base64.b64decode(result.data[0].b64_json))import { readFile, writeFile } from "node:fs/promises";
const form = new FormData();
form.append("model", "gpt-image-2.5-sunburst");
form.append("prompt", "Make the lamp light warmer");
form.append("image", new Blob([await readFile("image.png")], { type: "image/png" }), "image.png");
const resp = await fetch("https://tokenra.io/v1/images/edits", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.TOKENRA_API_KEY}` },
body: form,
});
const data = await resp.json();
await writeFile("edited.png", Buffer.from(data.data[0].b64_json, "base64"));
console.log("saved edited.png");import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Base64;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
public class ImageEdit {
public static void main(String[] args) throws Exception {
String boundary = "----tokenra" + System.currentTimeMillis();
String head = "--" + boundary + "\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\ngpt-image-2.5-sunburst\r\n"
+ "--" + boundary + "\r\nContent-Disposition: form-data; name=\"prompt\"\r\n\r\nMake the lamp light warmer\r\n"
+ "--" + boundary + "\r\nContent-Disposition: form-data; name=\"image\"; filename=\"image.png\"\r\n"
+ "Content-Type: image/png\r\n\r\n";
ByteArrayOutputStream form = new ByteArrayOutputStream();
form.write(head.getBytes(StandardCharsets.UTF_8));
form.write(Files.readAllBytes(Path.of("image.png")));
form.write(("\r\n--" + boundary + "--\r\n").getBytes(StandardCharsets.UTF_8));
HttpRequest request = HttpRequest.newBuilder(URI.create("https://tokenra.io/v1/images/edits"))
.header("Authorization", "Bearer " + System.getenv("TOKENRA_API_KEY"))
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.POST(HttpRequest.BodyPublishers.ofByteArray(form.toByteArray()))
.build();
String json = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()).body();
Matcher m = Pattern.compile("\"b64_json\"\\s*:\\s*\"([^\"]+)\"").matcher(json);
if (!m.find()) throw new RuntimeException(json);
Files.write(Path.of("edited.png"), Base64.getDecoder().decode(m.group(1)));
System.out.println("saved edited.png");
}
}Set TOKENRA_API_KEY first. Python: pip install openai. JavaScript: save as .mjs and run with Node.js 18+. Java: JDK 17+, run java ClassName.java.