Developer docs
Generate images
Text-to-image and image-to-image requests with full parameter reference.
text
POST /v1/generationsRequest
json
{
"model": "gpt-image",
"prompt": "Editorial photo of a glass perfume bottle on wet black stone, rim light",
"aspectRatio": "3:4",
"quality": "high",
"count": 2,
"idempotencyKey": "order-8812-hero"
}| Field | Type | Notes |
|---|---|---|
model | string | Required. A model id from /v1/models. |
prompt | string | Required. Up to 4 000 characters. |
negativePrompt | string | Only for models with capabilities.negativePrompt. |
inputImages | string[] | Public https URLs (or URLs returned by uploads). Enables edit / reference mode. |
aspectRatio | string | One of the model's aspectRatios. |
resolution | "1k" | "2k" | "4k" | Only for models that list resolutions. |
quality | "low" | "medium" | "high" | Only for models that list qualities. |
seed | integer | Only for models with capabilities.seed. |
count | 1–4 | Number of images. Each is billed. |
idempotencyKey | string | Same key within your account returns the same generation instead of creating a new one. Recommended for retries. |
webhookUrl | string | https URL called once the job finishes. See Webhooks. |
Response 201
json
{
"id": "6f1d6a2e-7f2d-4bd9-9e2e-0f3a1b2c3d4e",
"status": "QUEUED",
"model": "gpt-image",
"modality": "image",
"prompt": "Editorial photo of …",
"params": { "aspectRatio": "3:4", "quality": "high", "count": 2 },
"inputImages": [],
"outputs": [],
"credits": 120,
"source": "API",
"createdAt": "2026-03-02T04:10:11.000Z"
}credits is the amount reserved. When the job succeeds, outputs[] is filled:
json
"outputs": [
{
"id": "a1…",
"kind": "IMAGE",
"url": "https://cdn.poremu.ai/u/…/0.png",
"thumbnailUrl": "https://cdn.poremu.ai/u/…/0.thumb.webp",
"width": 1024,
"height": 1536,
"mimeType": "image/png"
}
]Image-to-image
Pass one or more inputImages. The model decides how to use them: gpt-image and qwen-image-3 treat them as the image to edit, nano-banana uses them as references/characters.
bash
curl https://api.poremu.ai/v1/generations \
-H "Authorization: Bearer $POREMU_API_KEY" -H "Content-Type: application/json" \
-d '{
"model": "nano-banana",
"prompt": "Same person, now wearing a navy wool coat, walking in Seoul at dusk",
"inputImages": ["https://cdn.poremu.ai/uploads/…/ref.jpg"],
"aspectRatio": "9:16"
}'JavaScript
js
const res = await fetch('https://api.poremu.ai/v1/generations', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.POREMU_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ model: 'nano-banana', prompt: 'A cosy reading nook, watercolor', aspectRatio: '4:3' }),
});
const gen = await res.json();
const done = await fetch(`https://api.poremu.ai/v1/generations/${gen.id}/wait?timeout=60000`, {
headers: { Authorization: `Bearer ${process.env.POREMU_API_KEY}` },
}).then((r) => r.json());
console.log(done.outputs.map((o) => o.url));Python
python
import os, requests
H = {"Authorization": f"Bearer {os.environ['POREMU_API_KEY']}"}
gen = requests.post("https://api.poremu.ai/v1/generations", headers=H,
json={"model": "gpt-image", "prompt": "Isometric icon of a rocket, pastel", "quality": "medium"}).json()
done = requests.get(f"https://api.poremu.ai/v1/generations/{gen['id']}/wait", headers=H, params={"timeout": 60000}).json()
print([o["url"] for o in done["outputs"]])