Call it
curl https://api.peume.com/v1/call/openai-gpt-image-2-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"model": "gpt-image-2",
"prompt": "A clean editorial illustration of a paper airplane.",
"size": "1:1",
"resolution": "1k"
}
}'const res = await fetch("https://api.peume.com/v1/call/openai-gpt-image-2-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"model": "gpt-image-2",
"prompt": "A clean editorial illustration of a paper airplane.",
"size": "1:1",
"resolution": "1k"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/openai-gpt-image-2-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"model": "gpt-image-2",
"prompt": "A clean editorial illustration of a paper airplane.",
"size": "1:1",
"resolution": "1k"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: openai-gpt-image-2-2.
Parameters
modelRequiredstringgpt-image-2
Example: gpt-image-2
promptRequiredstringExample: A clean editorial illustration of a paper airplane.
sizestringAspect ratio.
1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 21:9
Example: 1:1
resolutionstring1k · 2k · 4k
Example: 1k
image_urlsarrayUp to 16 public image URLs for image-to-image. Each URL must answer a plain GET with the raw image bytes and an image/* content-type (signed cloud-storage or CDN links work; file-page hosts such as tmpfiles.org return HTML, and the task then fails unbilled with the vendor's generic upstream error). ` host <file>` prints a URL that satisfies this.
Other ways to do it
Same job, other sources, cheapest first.
