Image generation
Image models are billed per image (the gpt-image-* models are billed per
token, so a larger or higher-quality image costs more). Current prices are in the
model catalogue.
Models
Section titled “Models”| Model | Endpoint |
|---|---|
gpt-image-2, gpt-image-1.5 |
POST /v1/images/generations |
doubao-seedream-5-0-260128, doubao-seedream-4-5-251128 |
POST /v1/images/generations |
grok-imagine-image-2.0 |
POST /v1/images/generations |
wan2.7-image-pro, z-image-turbo |
POST /v1/images/generations |
gemini-3-pro-image, gemini-3.1-flash-image, gemini-2.5-flash-image |
POST /v1/chat/completions |
Images endpoint
Section titled “Images endpoint”import base64from openai import OpenAI
client = OpenAI(base_url="https://api.wraitherix.com/v1", api_key="YOUR_KEY")
img = client.images.generate( model="gpt-image-2", prompt="A watercolor fox in a misty forest at dawn", size="1024x1024", quality="medium",)
with open("fox.png", "wb") as f: f.write(base64.b64decode(img.data[0].b64_json))curl https://api.wraitherix.com/v1/images/generations \ -H "Authorization: Bearer $WRAITHERIX_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"doubao-seedream-5-0-260128","prompt":"A watercolor fox in a misty forest","size":"2048x2048","response_format":"url"}'| Parameter | Values |
|---|---|
model |
one of the models above |
prompt |
Text description (required). |
size |
gpt-image-*: 1024x1024, 1536x1024, 1024x1536, auto. Seedream: 2048x2048 and other sizes up to 4K. |
quality |
gpt-image-* only: low, medium, high, auto |
n |
Number of images (default 1). Each image is billed. z-image-turbo accepts only 1. |
response_format |
b64_json or url (model-dependent) |
The result is in data[].b64_json or data[].url. URLs are temporary — download
the file right away.
Chat models that draw
Section titled “Chat models that draw”The gemini-*-image models answer on the chat endpoint. The image comes back
inside the message content as a Markdown image with a data: URL.
resp = client.chat.completions.create( model="gemini-3.1-flash-image", messages=[{"role": "user", "content": "Generate an image: a red ceramic cube on a white table"}],)content = resp.choices[0].message.content # ""import base64, reb64 = re.search(r"base64,([A-Za-z0-9+/=]+)", content).group(1)open("cube.jpg", "wb").write(base64.b64decode(b64))Generation usually takes 10–60 seconds — set your HTTP client timeout to at least 120 seconds.
Content policy
Section titled “Content policy”Adult and sexual (NSFW) content is not allowed. Every generation request is
screened before it reaches the model; prompts asking for nudity, sexual acts,
erotic or fetish material, or “undress”-style edits are refused with
400 content_policy_violation and are not charged. Sexual content involving
minors, and intimate imagery of real people without consent, are banned outright.
Repeated violations can lead to key revocation and account suspension. Full text:
Terms of service, section 6A.