TokenRa
中文Get API Key

Image model · OpenAI

GPT Image 2.5 Flare API

GPT Image 2.5 Flare generates and edits images through the OpenAI-compatible image endpoints. A request returns finished images in about 30 seconds, base64-encoded by default.

Model ID
gpt-image-2.5-flare
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.

POSThttps://tokenra.io/v1/images/generationsTested
Text to image. JSON body. Returns finished images in the response.
POSThttps://tokenra.io/v1/images/editsTested
Image to image and editing. multipart/form-data with the source image in image.

Request

Request parameters

Generate: POST /v1/images/generations

ParameterTypeRequiredDescription
modelstringYesModel ID: gpt-image-2.5-flare.
promptstringYesWhat to draw.
sizestringNoauto (default) or a size such as 1024x1536. With auto the test returned a 1254x1254 image.
qualitystringNoauto (default), low, medium or high.
nintegerNoNumber of images, default 1. n: 2 was tested.
response_formatstringNob64_json (default) returns base64 data; url returns a temporary link.

Edit: POST /v1/images/edits

ParameterTypeRequiredDescription
modelstringYesModel ID: gpt-image-2.5-flare.
promptstringYesHow to change the image.
imagefileYesSource image (PNG tested).
response_formatstringNob64_json (default) or url, as for generation.

Response

Response format

Example response (base64 shortened)
{
  "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
  }
}
FieldTypeDescription
createdintegerUnix timestamp.
data[].b64_jsonstringBase64 PNG (default). Decode and save it.
data[].urlstringTemporary link when response_format is url. Download it promptly.
size / quality / output_formatstringSettings that were applied.
usageobjectToken usage reported by the model.

Errors

Errors & limits

Common errors

HTTPerror.codeMeaningWhat 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.