BeLive Token Hub
API ReferenceImageGPT Image

Generate Image

Generate images with GPT Image 2.5 and other models, with complete request parameters, response fields, and streaming examples.

Creates an image from a text prompt. The endpoint definition follows the OpenAI Create image API.

Endpoint

ItemValue
MethodPOST
URLhttps://api.tokenhub.belivestudios.com/v1/images/generations
AuthenticationAuthorization: Bearer sk-your-belive-studios-key
Content-Typeapplication/json

Model Selection

Model categories

The platform provides per-use models and official models, with different values for the model parameter.

Per-use modelOfficial model
gpt-image-2gpt-image-2-2026-04-21
gpt-image-2.5-sunburstgpt-image-2.5-sunburst-2026-09-08
gpt-image-2.5-flaregpt-image-2.5-flare-2026-09-08

The examples below use per-use models. To use an official model, replace the request's model value.

Examples

Standard Generation

GPT Image models always return base64-encoded images, so do not include response_format in the request.

curl https://api.tokenhub.belivestudios.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-your-belive-studios-key" \
  -d '{
    "model": "gpt-image-2.5-sunburst",
    "prompt": "A cute baby sea otter",
    "n": 1,
    "size": "1024x1024"
  }'

Response

{
  "created": 1713833628,
  "data": [
    {
      "b64_json": "..."
    }
  ],
  "usage": {
    "total_tokens": 100,
    "input_tokens": 50,
    "output_tokens": 50,
    "input_tokens_details": {
      "text_tokens": 10,
      "image_tokens": 40
    }
  }
}

Request Parameters

Core Parameters

prompt

Type: string, required

A text description of the desired image. The maximum length is 32,000 characters for GPT Image models, 1,000 for dall-e-2, and 4,000 for dall-e-3.

background

Type: "transparent" | "opaque" | "auto" | null, optional

Sets the background of the generated image. Supported only by GPT Image models. auto is the default and lets the model choose the best background.

gpt-image-2.5-sunburst, gpt-image-2.5-flare, and their 2026-09-08 snapshots support opaque and transparent backgrounds. Transparent backgrounds are also available for other supported GPT Image models. Support for gpt-image-2 and gpt-image-2-2026-04-21 is in preview. When using transparent, set output_format to png or webp.

model

Type: string | ImageModel | null, optional

The image-generation model. Platform model names are grouped as follows:

  • Per-use models: gpt-image-2, gpt-image-2.5-sunburst, and gpt-image-2.5-flare
  • Official models: gpt-image-2-2026-04-21, gpt-image-2.5-sunburst-2026-09-08, and gpt-image-2.5-flare-2026-09-08

moderation

Type: "low" | "auto" | null, optional

Controls content moderation for GPT Image models. low applies less restrictive filtering; auto is the default.

n

Type: number | null, optional

The number of images to generate, from 1 to 10. dall-e-3 supports only n=1.

Output Controls

output_compression

Type: number | null, optional

Compression level from 0 to 100 percent, defaulting to 100. Supported only by GPT Image models when output_format is webp or jpeg.

output_format

Type: "png" | "jpeg" | "webp" | null, optional

The generated image format. Supported only by GPT Image models.

partial_images

Type: number | null, optional

The number of partial images to generate in a streaming response, from 0 to 3. When set to 0, the response sends only the final image in a single streaming event. The final image may arrive before all requested partial images if it is generated sooner.

quality

Type: "standard" | "hd" | "low" | "medium" | "high" | "xhigh" | "max" | "auto" | null, optional

  • auto: automatically selects the best quality and is the default
  • high, medium, and low: supported by GPT Image models
  • xhigh and max: supported by gpt-image-2.5-sunburst, gpt-image-2.5-flare, and their 2026-09-08 snapshots
  • hd and standard: supported by dall-e-3
  • standard: the only option supported by dall-e-2

Streaming and Compatibility

response_format

Type: "url" | "b64_json" | null, optional

Sets the response format for dall-e-2 and dall-e-3. URLs are valid for 60 minutes. GPT Image models do not support this parameter and always return base64-encoded images.

size

Type: string | "auto" | null, optional

  • GPT Image models support 1024x1024, 1536x1024, and 1024x1536; models with automatic sizing also support auto
  • gpt-image-2, gpt-image-2-2026-04-21, both GPT Image 2.5 models, and their 2026-09-08 snapshots support arbitrary WIDTHxHEIGHT resolutions, such as 1536x864
  • dall-e-2 supports 256x256, 512x512, and 1024x1024
  • dall-e-3 supports 1024x1024, 1792x1024, and 1024x1792

For the models listed above that support arbitrary resolutions, both dimensions must be divisible by 16, the aspect ratio must be between 1:3 and 3:1, and the request must meet the model's current pixel and edge limits. Resolutions above 2560x1440 are experimental; the maximum is 3840x2160.

stream

Type: boolean | null, optional

Generates the image in streaming mode. Defaults to false and is supported only by GPT Image models.

style

Type: "vivid" | "natural" | null, optional

Sets the generated image style. Supported only by dall-e-3. vivid favors hyper-real, dramatic images; natural produces a more natural appearance.

user

Type: string, optional

A unique identifier for the end user that can help monitor and detect abuse.

Response

The endpoint returns an ImagesResponse object.

FieldTypeDescription
creatednumberUnix timestamp, in seconds, when the image was created
backgroundtransparent | opaqueBackground used for generation, if present
dataImage[]Generated images, if present
output_formatpng | webp | jpegOutput image format, if present
qualitylow | medium | high | xhigh | maxGenerated image quality, if present
sizestringImage dimensions in WIDTHxHEIGHT format, for example 1536x864, if present
usageobjectToken usage; the official reference identifies this field for gpt-image-1, if present

data Fields

FieldTypeDescription
b64_jsonstringBase64-encoded image; returned by default for GPT Image models and for DALL·E when response_format=b64_json
revised_promptstringRevised prompt used for generation; returned only by dall-e-3
urlstringImage URL returned by DALL·E when response_format=url; unsupported by GPT Image models

usage Fields

FieldTypeDescription
input_tokensnumberImage and text tokens in the input
input_tokens_details.image_tokensnumberImage tokens in the input
input_tokens_details.text_tokensnumberText tokens in the input
output_tokensnumberOutput tokens generated by the model
total_tokensnumberTotal image and text tokens used
output_tokens_details.image_tokensnumberImage tokens in the output, if present
output_tokens_details.text_tokensnumberText tokens in the output, if present

On this page