Skip to main content
Image generation works through the standard OpenAI Images API. Point it at Orbitrage and we route it to our image model (gpt-image-2), bill per image at the real token rates, and trace it alongside your chat calls.

Generate

import os, orbitrage
orbitrage.init(os.environ["ORBITRAGE_API_KEY"], user_id="customer_42")

from openai import OpenAI
client = OpenAI()

img = client.images.generate(
    model="gpt-image-2",
    prompt="A minimalist orbit diagram, warm off-white background, single orange accent.",
    size="1024x1024",
)
print(img.data[0].url or img.data[0].b64_json[:40])

Edit

Pass an input image (and optional mask) to images.edit:
edited = client.images.edit(
    model="gpt-image-2",
    image=open("input.png", "rb"),
    prompt="Add a thin orange ring around the planet.",
)
Image calls are billed at gpt-image-2’s multi-rate token pricing (text-in, image-in, image-out) — the exact cost is recorded on every call. Vision input (passing images to a chat model) is just a normal chat.completions call with an image_url content block; it routes to a vision-capable model automatically.