POST/v1/collections
Render many images from one template in a single request
One template, up to 50 sets of variables and modifications, one call. The response is 202 with every image's id and final url already assigned; renders run in the background, five at a time. Poll GET /v1/collections/{id}, or pass webhook_url to be told when the whole set is done. Costs one image per item, charged up front.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"items": [
{
"variables": {
"title": "Post one"
},
"metadata": {
"post": 101
}
},
{
"variables": {
"title": "Post two"
},
"metadata": {
"post": 102
}
}
],
"scale": 2
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/collections" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"items": [
{
"variables": {
"title": "Post one"
},
"metadata": {
"post": 101
}
},
{
"variables": {
"title": "Post two"
},
"metadata": {
"post": 102
}
}
],
"scale": 2
}'
import requests
r = requests.post("https://api.imageapis.com/v1/collections", headers={"X-API-Key": "YOUR_KEY"}, json={
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"items": [
{
"variables": {
"title": "Post one"
},
"metadata": {
"post": 101
}
},
{
"variables": {
"title": "Post two"
},
"metadata": {
"post": 102
}
}
],
"scale": 2
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/collections", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"items": [
{
"variables": {
"title": "Post one"
},
"metadata": {
"post": 101
}
},
{
"variables": {
"title": "Post two"
},
"metadata": {
"post": 102
}
}
],
"scale": 2
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200With response=binary: the file itself, with X-Image-Id and X-Image-Url headers
202Accepted: rendering in the background; the record has status pending and the webhook gets the finished one
{
"id": "col_5kq2wz8xmtnb4hdc7vre",
"object": "collection",
"status": "pending",
"total": 2,
"completed": 0,
"failed": 0,
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"format": "png",
"scale": 1,
"units": 2,
"images": [
{
"index": 0,
"id": "img_7hk2mq9ztbw4e6nrcxpd",
"status": "pending",
"url": "https://img.imageapis.com/i/img_7hk2mq9ztbw4e6nrcxpd.png",
"metadata": {
"post": 101
}
},
{
"index": 1,
"id": "img_9xw4nq2kdtbz7hmc3vpe",
"status": "pending",
"url": "https://img.imageapis.com/i/img_9xw4nq2kdtbz7hmc3vpe.png",
"metadata": {
"post": 102
}
}
],
"created": "2026-10-10T19:02:11Z",
"expires": "2026-11-09T19:02:11Z"
}