Skip to content

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

GPT Image 2.6 API — Python wrapper

Call GPT Image 2.6 Flare and GPT Image 2.6 Sunburst from Python with one function per endpoint: text-to-image, image editing. Built on the official wavespeed SDK and the WaveSpeedAI hosted API — no GPU, pay per generation.

GPT Image 2.6 API Try in browser

Quick start

pip install git+https://github.com/WaveSpeedAI/gpt-image-2.6-api.git
export WAVESPEED_API_KEY="your-api-key"   # https://wavespeed.ai/accesskey
import gpt_image_api

urls = gpt_image_api.flare_text_to_image(
    prompt="A lighthouse on a rocky coast at dawn, soft golden light, long exposure",
)
print(urls[0])

Every function waits for the generation to finish and returns a list of output URLs. Optional arguments you leave out are not sent, so the API defaults apply. Inputs such as images, videos and audio are passed as URLs; use gpt_image_api.upload("local-file") to get a URL for a local file.

Endpoints

Function Model Type
flare_text_to_image() openai/gpt-image-2.6-flare/text-to-image text-to-image
flare_edit() openai/gpt-image-2.6-flare/edit image-to-image
sunburst_text_to_image() openai/gpt-image-2.6-sunburst/text-to-image text-to-image
sunburst_edit() openai/gpt-image-2.6-sunburst/edit image-to-image

Each model page has a playground, live pricing and copy-paste API snippets. Prices are per generation and depend on the settings you choose; check a request before running it with wavespeed price <model> from the CLI.

Parameters

flare_text_to_image

openai/gpt-image-2.6-flare/text-to-image — OpenAI's GPT Image 2.6 Flare Text-to-Image generates high-quality images from natural-language prompts, with five quality tiers up to 4K and a complexity control. Flare is the fast GPT Image 2.6 tier, returning images in seconds for everyday generation and quick iteration.

Parameter Type Required Default Allowed Description
prompt str yes The positive prompt for the generation.
aspect_ratio str "1:1" 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 The aspect ratio of the generated image. Defaults to 1:1.
resolution str "1k" 1k, 2k, 4k The resolution of the output image.
quality str "medium" low, medium, high, xhigh, max Rendering quality. Higher tiers add detail and cost more: low is the fastest draft tier, medium is the balanced default, high, xhigh and max add fidelity.
complexity str "high" low, medium, high How much planning the model does before drawing. Higher complexity improves layout and scene understanding on detailed prompts and takes a little longer; it does not change the price.
output_format str "png" png, jpeg, webp, gif, svg The format of the output image. gif returns an animation, svg a vector image.
frame_count int 9 2–16 GIF only: number of animation frames (2-16).
frame_duration_ms int 200 20–2000 GIF only: milliseconds per frame (20-2000).

flare_edit

openai/gpt-image-2.6-flare/edit — OpenAI's GPT Image 2.6 Flare Edit edits one or more reference images from natural-language instructions, with five quality tiers up to 4K and a complexity control. Flare is the fast GPT Image 2.6 tier, returning images in seconds for everyday generation and quick iteration.

Parameter Type Required Default Allowed Description
prompt str yes The positive prompt for the generation.
images List[str] yes up to 16 items List of URLs of input images for editing.
mask_image str Optional mask for the first input image: white marks the area to edit, black the area to keep (a PNG where transparent marks the area to edit is also accepted). It is resized to the first image.
markup_image str Optional transparent PNG of annotations (circles, arrows, notes) drawn over the first input image to show where and how to edit it. Use either mask_image or markup_image.
aspect_ratio str 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 The aspect ratio of the generated image. If not specified, it is determined automatically from the input image.
resolution str "1k" 1k, 2k, 4k The resolution of the output image.
quality str "medium" low, medium, high, xhigh, max Rendering quality. Higher tiers add detail and cost more: low is the fastest draft tier, medium is the balanced default, high, xhigh and max add fidelity.
complexity str "high" low, medium, high How much planning the model does before drawing. Higher complexity improves layout and scene understanding on detailed prompts and takes a little longer; it does not change the price.
output_format str "png" png, jpeg, webp, gif The format of the output image. gif returns an animation.
frame_count int 9 2–16 GIF only: number of animation frames (2-16).
frame_duration_ms int 200 20–2000 GIF only: milliseconds per frame (20-2000).

sunburst_text_to_image

openai/gpt-image-2.6-sunburst/text-to-image — OpenAI's GPT Image 2.6 Sunburst Text-to-Image generates high-quality images from natural-language prompts, with five quality tiers up to 4K and a complexity control. Sunburst is the precision-focused GPT Image 2.6 tier: it takes longer per image for higher fidelity and steadier details across repeated edits.

Parameter Type Required Default Allowed Description
prompt str yes The positive prompt for the generation.
aspect_ratio str "1:1" 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 The aspect ratio of the generated image. Defaults to 1:1.
resolution str "1k" 1k, 2k, 4k The resolution of the output image.
quality str "medium" low, medium, high, xhigh, max Rendering quality. Higher tiers add detail and cost more: low is the fastest draft tier, medium is the balanced default, high, xhigh and max add fidelity.
complexity str "high" low, medium, high How much planning the model does before drawing. Higher complexity improves layout and scene understanding on detailed prompts and takes a little longer; it does not change the price.
output_format str "png" png, jpeg, webp, gif, svg The format of the output image. gif returns an animation, svg a vector image.
frame_count int 9 2–16 GIF only: number of animation frames (2-16).
frame_duration_ms int 200 20–2000 GIF only: milliseconds per frame (20-2000).

sunburst_edit

openai/gpt-image-2.6-sunburst/edit — OpenAI's GPT Image 2.6 Sunburst Edit edits one or more reference images from natural-language instructions, with five quality tiers up to 4K and a complexity control. Sunburst is the precision-focused GPT Image 2.6 tier: it takes longer per image for higher fidelity and steadier details across repeated edits.

Parameter Type Required Default Allowed Description
prompt str yes The positive prompt for the generation.
images List[str] yes up to 16 items List of URLs of input images for editing.
mask_image str Optional mask for the first input image: white marks the area to edit, black the area to keep (a PNG where transparent marks the area to edit is also accepted). It is resized to the first image.
markup_image str Optional transparent PNG of annotations (circles, arrows, notes) drawn over the first input image to show where and how to edit it. Use either mask_image or markup_image.
aspect_ratio str 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 9:21, 21:9 The aspect ratio of the generated image. If not specified, it is determined automatically from the input image.
resolution str "1k" 1k, 2k, 4k The resolution of the output image.
quality str "medium" low, medium, high, xhigh, max Rendering quality. Higher tiers add detail and cost more: low is the fastest draft tier, medium is the balanced default, high, xhigh and max add fidelity.
complexity str "high" low, medium, high How much planning the model does before drawing. Higher complexity improves layout and scene understanding on detailed prompts and takes a little longer; it does not change the price.
output_format str "png" png, jpeg, webp, gif The format of the output image. gif returns an animation.
frame_count int 9 2–16 GIF only: number of animation frames (2-16).
frame_duration_ms int 200 20–2000 GIF only: milliseconds per frame (20-2000).

REST and CLI

The wrapper is a thin layer over the REST API: submit, then poll for the result.

curl -s -X POST "https://api.wavespeed.ai/api/v3/openai/gpt-image-2.6-flare/text-to-image" \
  -H "Authorization: Bearer $WAVESPEED_API_KEY" -H "Content-Type: application/json" \
  -d '{"prompt": "A lighthouse on a rocky coast at dawn, soft golden light, long exposure"}'
# -> {"data": {"id": "<prediction_id>"}}

curl -s "https://api.wavespeed.ai/api/v3/predictions/<prediction_id>/result" \
  -H "Authorization: Bearer $WAVESPEED_API_KEY"
# -> status: completed, outputs: ["<url>"]
npm i -g @wavespeed/cli && wavespeed login
wavespeed run openai/gpt-image-2.6-flare/text-to-image -p "your prompt"

Related

Notes

  • GPT Image 2.6 is a model by OpenAI. This repository is maintained by WaveSpeedAI and wraps the WaveSpeedAI hosted API for it.
  • Function signatures and the tables above are generated from the live model schemas (last generated 2026-11-22). The model pages are the source of truth if an endpoint changes.
  • Issues and pull requests are welcome. License: MIT.

Releases

Packages

Used by

Contributors

Languages