POST/v1/images/generations
Generating#
These models work through the Images endpoint:
- GPT Image 2.5 Flare —
gpt-image-2.5-flare - GPT Image 2.5 Sunburst —
gpt-image-2.5-sunburst - Grok Imagine Image 2.0 —
grok-imagine-image
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.flua.ink/v1", api_key=os.environ["FLUA_API_KEY"])
image = client.images.generate(
model="gpt-image-2.5-flare",
prompt="A swift over a night city, black and white",
size="1024x1024",
)
print(image.data[0].url or image.data[0].b64_json[:64])| Parameter | Type | Description |
|---|---|---|
model* | string | The image model. |
prompt* | string | What to draw. |
size | string | Size, e.g. 1024x1024. |
n | integer | How many images to return. |
The image comes back in data[0] — as a link (url) or base64 (b64_json), depending on the model.
Gemini and Nano Banana models#
These models draw through Chat Completions: describe the picture in a message and the image comes back in the model's reply.
- Nano Banana 2 —
nano-banana-2 - Nano Banana Pro —
nano-banana-pro
response = client.chat.completions.create(
model="nano-banana-pro",
messages=[{"role": "user", "content": "A swift over a night city, black and white"}],
)
print(response.choices[0].message.content)Image generation is billed per request, not per token. Each model's price is in the catalog.