Images
One request, billed per image.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.rawroute.dev/v1", api_key=os.environ["RAWROUTE_API_KEY"])
image = client.images.generate(
model="gpt-image-2.6",
prompt="A lighthouse at dusk, shot on 35mm film",
n=1,
)
print(image.data[0].url or image.data[0].b64_json[:64])curl https://api.rawroute.dev/v1/images/generations \
-H "Authorization: Bearer $RAWROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-image-2.6", "prompt": "A lighthouse at dusk, shot on 35mm film", "n": 1}'Models
- gpt-image-2.6
- 1K · per image
- gpt-image-2.6-flare
- 1K · per image
- gpt-image-2.6-sunburst
- 1K · per image
- gemini-3.1-flash-image
- Flash · 1K · per image
- gemini-nano-banana-2.1
- 2K · per image
- grok-imagine-image-quality
- 1K · per image
- grok-imagine-image-2.0
- per image
Sizes and edits
Send size from image_inputs.sizes. Nano Banana takes the nearest listed aspect ratio, or auto to let the model choose; GPT Image 2.6 renders 1024x1024; Grok Imagine Image renders up to 10 images per request.
Edit with POST /v1/images/edits: Nano Banana and GPT Image take image files (multipart), Grok Imagine Image takes data URLs in image or images (JSON). No masks. Every image costs the model price, whatever its size or references. models.json