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
- Choose model gpt-image-2.5-flare for speed or gpt-image-2.5-sunburst when you want the same transparent controls on the other enabled GPT Image 2.5 option.
- Set background to transparent.
- Set output_format to png or webp. TokenRex rejects JPEG with a transparent background because JPEG has no alpha channel.
- Describe the subject, edge style and whether shadows should be included. Isolated objects with clear outlines are easier to reuse.
Check the downloaded file
- Open the file over both light and dark backgrounds. A real transparent image shows the page colour behind it; a fake one keeps its white or checkerboard pixels.
- In an image editor, confirm that the file has an alpha channel. For product cutouts, inspect edges at full size because soft hair, glass and shadows can leave halos.
- If the subject must sit on several brand colours, generate a test with simple edges before producing a full set.
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))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.