Image generation
OpenAI-compatible image generation with per-image pricing.
Image models use the OpenAI Images API surface — the same one
client.images.generate speaks in every OpenAI SDK:
curl -s https://api.gopuram.net/v1/images/generations \
-H "Authorization: Bearer $GOPURAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bytedance/seedream-4.0",
"prompt": "a majestic gopuram temple tower at golden hour",
"size": "1024x1024"
}' | jq -r '.data[0].b64_json' | base64 -d > out.png
Or with the SDK:
const image = await client.images.generate({
model: 'bytedance/seedream-4.0',
prompt: 'a majestic gopuram temple tower at golden hour',
size: '1024x1024',
});
// image.data[0].b64_json
Request
| Field | Meaning |
|---|---|
model | an image model id from the catalog (output_modalities: ["image"]) |
prompt | up to 10,000 characters |
n | 1–4 images |
size | WIDTHxHEIGHT, e.g. 1024x1024 (model-dependent) |
response_format | b64_json (default). Hosted URLs are coming with artifact storage. |
Response
{
"created": 1787443200,
"data": [{ "b64_json": "…" }],
"usage": { "images": 1, "cost": 0.0315 }
}
As everywhere on Gopuram, the actual cost is in-band — image models are
priced per generated image (see the pricing.image field on /v1/models),
so the charge is exact and known even before generation starts.
Remixing with reference images
Models whose catalog entry lists image in input_modalities accept
reference images through /v1/images/edits — the same multipart surface as
OpenAI's client.images.edit:
curl -s https://api.gopuram.net/v1/images/edits \
-H "Authorization: Bearer $GOPURAM_API_KEY" \
-F "model=bfl/flux-kontext-pro" \
-F "prompt=the same scene during a monsoon thunderstorm" \
-F "image=@reference.png" \
| jq -r '.data[0].b64_json' | base64 -d > remixed.png
const remixed = await client.images.edit({
model: 'bfl/flux-kontext-pro',
prompt: 'the same scene during a monsoon thunderstorm',
image: fs.createReadStream('reference.png'),
});
Pass several references by repeating the image field (up to 8 MB per
file). Pricing is identical to generation: per output image, exact, in-band.
Sending a reference to a model that doesn't accept one returns a 400 that
says so.
Current image models
| Model | Per image | References | Best at |
|---|---|---|---|
google/gemini-3.1-flash-image | $0.07035 | yes | Nano Banana 2 — instruction-following edits |
google/gemini-3.1-flash-lite-image | $0.0357 | yes | Nano Banana Lite — fast, cheap remixing |
google/gemini-3-pro-image | $0.14112 | yes | Nano Banana Pro — highest fidelity |
google/gemini-2.5-flash-image | $0.04095 | yes | the original Nano Banana |
bytedance/seedream-5.0-pro | $0.03675 | yes | current ByteDance flagship |
bytedance/seedream-4.5 | $0.042 | yes | strong all-rounder |
bytedance/seedream-4.0 | $0.0315 | yes | the price floor |
spacexai/grok-imagine-image-2.0 | $0.063 | yes | xAI's latest |
recraft/recraft-v4.1 | $0.03675 | no | design, brand and vector-style output |
bfl/flux-kontext-pro | $0.042 | yes | faithful remixing — preserves source structure |
bfl/flux-pro-1.1 | $0.042 | no | classic high-quality text-to-image |
The openai/gpt-image-1.5 family is also available — it bills by token
rather than per image, so its exact cost appears in usage.cost per request.
Reference support is probe-verified per model, not assumed. Prices include
margin and match the in-band usage.cost exactly. The authoritative list is
always the live catalog:
Which endpoint for which model
Chat models belong to /v1/chat/completions, image models to
/v1/images/generations — using the wrong endpoint returns a 400 that
points you to the right one. Filter the catalog programmatically:
curl -s https://api.gopuram.net/v1/models \
| jq '.data[] | select(.architecture.output_modalities == ["image"]) | {id, pricing}'