Documentation · Images

API

Images

Image generation with GPT Image, Grok Imagine and Nano Banana models.

POST/v1/images/generations

Generating#

These models work through the Images endpoint:

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])
ParameterTypeDescription
model*stringThe image model.
prompt*stringWhat to draw.
sizestringSize, e.g. 1024x1024.
nintegerHow 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.py
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.