OpenAI Images

Generate and edit images with OpenAI's GPT image models

Generate and edit images with OpenAI’s GPT image models — gpt-image-2.5-flare (the default) and gpt-image-2.5-sunburst. gpt-image-2.6-flare and gpt-image-2.6-sunburst are launching but may not be available on every project yet (403 model_not_found).

Generate

python
from praisonaiagents import ImageAgent

agent = ImageAgent()  # defaults to gpt-image-2.5-flare
result = agent.generate("A sunset over mountains")
print(result.data[0].b64_json[:40], "...")

GPT image models always return the image as base64.

With Options

python
from praisonaiagents import ImageAgent

agent = ImageAgent(llm="openai/gpt-image-2.5-flare")
result = agent.generate(
    "A futuristic city",
    size="1536x1024",
    quality="high",
)
print(result.data[0].b64_json[:40], "...")

quality is sent whenever you set it, for any model. GPT image accepts "low", "medium", "high", "xhigh", "max", "auto". Images 2.5/2.6 params such as frame_count, frame_duration_ms, complexity, and output_format pass through unchanged.

Reference: PR #6262, fixes #6259. Earlier: PR #6077, PR #6097.

Edit

python
from praisonaiagents import ImageAgent

agent = ImageAgent()
result = agent.edit("photo.png", "Make the cup blue", mask="mask.png")

Response Format

GPT image models always return base64 and reject response_format. Leave it unset — ImageAgent does not send its default "url", so no extra configuration is needed.

python
from praisonaiagents import ImageAgent

agent = ImageAgent()
agent.generate("A red circle icon").save("circle.png")

Models

Diagram

Yes

No

📝 Image task

Need
variations?

openai/dall-e-2

Generate or edit

openai/gpt-image-2.5-flare
or -sunburst

ModelGenerateEditVariation
openai/gpt-image-2.5-flare (default)✅✅ (mask=, not markup=)❌
openai/gpt-image-2.5-sunburst✅✅ (mask=, not markup=)❌
openai/gpt-image-2.6-flare / -sunburst✅ (rolling out)✅ (rolling out)❌
openai/dall-e-2——✅ (only variations endpoint)

OpenAI retired dall-e-2/dall-e-3 on 2026-05-12 and gpt-image-1 on 2026-10-23. dall-e-2 is kept only for variation().