POST/v1/images/sizes
Render one template at several sizes in one call: Open Graph, square, story, banner
Magic resize for templates. Each size is laid out from the template: everything scales by the factor that fits the original inside the new canvas, layers touching an edge stay on it, layers spanning the canvas (backgrounds, bands) stretch across it, and the rest keep their centre at the same fraction of the canvas, so the extra room of a taller or wider canvas goes between layers. Text that shrinks to fit keeps fitting. Give modifications inside a size to move or restyle a layer for that size only. One image per size, reserved before rendering; a size that fails twice comes back with status failed.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"sizes": [
"og",
"instagram-post",
{
"preset": "instagram-story",
"modifications": [
{
"name": "title",
"size": 96
}
]
}
],
"variables": {
"title": "Launch week starts Monday"
}
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/images/sizes" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"sizes": [
"og",
"instagram-post",
{
"preset": "instagram-story",
"modifications": [
{
"name": "title",
"size": 96
}
]
}
],
"variables": {
"title": "Launch week starts Monday"
}
}'
import requests
r = requests.post("https://api.imageapis.com/v1/images/sizes", headers={"X-API-Key": "YOUR_KEY"}, json={
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"sizes": [
"og",
"instagram-post",
{
"preset": "instagram-story",
"modifications": [
{
"name": "title",
"size": 96
}
]
}
],
"variables": {
"title": "Launch week starts Monday"
}
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/images/sizes", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"sizes": [
"og",
"instagram-post",
{
"preset": "instagram-story",
"modifications": [
{
"name": "title",
"size": 96
}
]
}
],
"variables": {
"title": "Launch week starts Monday"
}
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
201Created
{
"object": "list",
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"units": 3,
"images": [
{
"id": "img_3kd8wq2mzx7hbn4tcv9r",
"object": "image",
"status": "completed",
"url": "https://img.imageapis.com/i/img_3kd8wq2mzx7hbn4tcv9r.png",
"format": "png",
"width": 1200,
"height": 630,
"scale": 1,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"bytes": 48213,
"units": 1,
"created": "2026-10-10T18:04:11Z",
"completed": "2026-10-10T18:04:12Z",
"expires": "2026-11-09T18:04:11Z",
"size": "og"
},
{
"id": "img_8vtr2kx9mwq4zhdn7bc3",
"object": "image",
"status": "completed",
"url": "https://img.imageapis.com/i/img_8vtr2kx9mwq4zhdn7bc3.png",
"format": "png",
"width": 1080,
"height": 1080,
"scale": 1,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"bytes": 48213,
"units": 1,
"created": "2026-10-10T18:04:11Z",
"completed": "2026-10-10T18:04:12Z",
"expires": "2026-11-09T18:04:11Z",
"size": "instagram-post"
},
{
"id": "img_q7nd2wz4hkx8vmtb3cr9",
"object": "image",
"status": "completed",
"url": "https://img.imageapis.com/i/img_q7nd2wz4hkx8vmtb3cr9.png",
"format": "png",
"width": 1080,
"height": 1920,
"scale": 1,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"bytes": 48213,
"units": 1,
"created": "2026-10-10T18:04:11Z",
"completed": "2026-10-10T18:04:12Z",
"expires": "2026-11-09T18:04:11Z",
"size": "instagram-story"
}
]
}
401Missing or invalid API key (from the gateway)
404No such template or record on this account
{
"error": "string",
"message": "string",
"param": "string"
}