How do I generate a transparent AI image with GPT Image?

Create a real transparent PNG or WebP with GPT Image 2.5 Flare or Sunburst through TokenRex, then verify the alpha channel before using it.

The direct answer

Use gpt-image-2.5-flare or gpt-image-2.5-sunburst, set background to transparent and request PNG or WebP. A prompt that only says "transparent background" can produce a white field or a painted checkerboard instead of real transparency.

Through TokenRex, the background control is available only for those two GPT Image 2.5 models. GPT Image 2, GPT Image 1 Mini and the Gemini image models are not listed with transparent output here.

Request settings that matter

Check the downloaded file

Cost and quality

GPT Image 2.5 requests are priced from provider-reported text, image-input and image-output token usage. Quality and size change output tokens, so begin with a small low or medium-quality test.

Model pages and the cost calculator use live TokenRex prices. Billing is in INR from your prepaid wallet.

Sources

Example

import base64
from openai import OpenAI

client = OpenAI(api_key="YOUR_TOKENREX_KEY", base_url="https://tokenrex.ai/api/public")
result = client.images.generate(
    model="gpt-image-2.5-flare",
    prompt="A clean ceramic coffee mug product cutout, soft natural edges, no surface or backdrop",
    background="transparent",
    output_format="png",
    quality="medium",
)

with open("transparent-mug.png", "wb") as image_file:
    image_file.write(base64.b64decode(result.data[0].b64_json))
Get API keyCost calculatorDocs

Questions

Can I write transparent background in the prompt instead?
Use the background control. Prompt wording alone may create a visible white or checkerboard background.
Does Gemini image generation support transparent backgrounds on TokenRex?
No transparent background control is exposed for Gemini image models through TokenRex.
Which format should I choose?
Use PNG for broad editing and design-tool compatibility. Use WebP when your destination supports it and a smaller web file matters.

Related