curl -X POST https://api.iterationlayer.com/image-generation/v1/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dimensions": { "width": 1200, "height": 800 },
"layers": [
{
"index": 0,
"type": "solid-color",
"hex_color": "#FFFDF5"
},
{
"index": 1,
"type": "solid-color",
"hex_color": "#C9A84C",
"position": { "x": 30.0, "y": 30.0 },
"dimensions": { "width": 1140, "height": 740 }
},
{
"index": 2,
"type": "solid-color",
"hex_color": "#FFFDF5",
"position": { "x": 40.0, "y": 40.0 },
"dimensions": { "width": 1120, "height": 720 }
},
{
"index": 3,
"type": "text",
"text": "Certificate of Completion",
"font_name": "Playfair Display",
"font_size_in_px": 42,
"text_color": "#333333",
"text_align": "center",
"position": { "x": 100.0, "y": 100.0 },
"dimensions": { "width": 1000, "height": 60 }
},
{
"index": 4,
"type": "text",
"text": "Jane Smith",
"font_name": "Playfair Display",
"font_size_in_px": 56,
"text_color": "#1a1a1a",
"text_align": "center",
"font_weight": "Bold",
"position": { "x": 100.0, "y": 280.0 },
"dimensions": { "width": 1000, "height": 80 }
},
{
"index": 5,
"type": "text",
"text": "Advanced API Design",
"font_name": "Inter",
"font_size_in_px": 28,
"text_color": "#555555",
"text_align": "center",
"position": { "x": 100.0, "y": 420.0 },
"dimensions": { "width": 1000, "height": 50 }
},
{
"index": 6,
"type": "text",
"text": "March 5, 2026",
"font_name": "Inter",
"font_size_in_px": 20,
"text_color": "#888888",
"text_align": "center",
"position": { "x": 100.0, "y": 600.0 },
"dimensions": { "width": 1000, "height": 40 }
}
],
"output_format": "png"
}'{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });
const result = await client.generateImage({
dimensions: { width_in_px: 1200, height_in_px: 800 },
layers: [
{
index: 0,
type: "solid-color",
hex_color: "#FFFDF5",
},
{
index: 1,
type: "solid-color",
hex_color: "#C9A84C",
position: { x_in_px: 30, y_in_px: 30 },
dimensions: { width_in_px: 1140, height_in_px: 740 },
},
{
index: 2,
type: "solid-color",
hex_color: "#FFFDF5",
position: { x_in_px: 40, y_in_px: 40 },
dimensions: { width_in_px: 1120, height_in_px: 720 },
},
{
index: 3,
type: "text",
text: "Certificate of Completion",
font_name: "Playfair Display",
font_size_in_px: 42,
text_color: "#333333",
text_align: "center",
position: { x_in_px: 100, y_in_px: 100 },
dimensions: { width_in_px: 1000, height_in_px: 60 },
},
{
index: 4,
type: "text",
text: "Jane Smith",
font_name: "Playfair Display",
font_size_in_px: 56,
text_color: "#1a1a1a",
text_align: "center",
font_weight: "Bold",
position: { x_in_px: 100, y_in_px: 280 },
dimensions: { width_in_px: 1000, height_in_px: 80 },
},
{
index: 5,
type: "text",
text: "Advanced API Design",
font_name: "Inter",
font_size_in_px: 28,
text_color: "#555555",
text_align: "center",
position: { x_in_px: 100, y_in_px: 420 },
dimensions: { width_in_px: 1000, height_in_px: 50 },
},
{
index: 6,
type: "text",
text: "March 5, 2026",
font_name: "Inter",
font_size_in_px: 20,
text_color: "#888888",
text_align: "center",
position: { x_in_px: 100, y_in_px: 600 },
dimensions: { width_in_px: 1000, height_in_px: 40 },
},
],
output_format: "png",
});
const imageBuffer = Buffer.from(result.data.buffer, "base64");{
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}import base64
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")
result = client.generate_image(
dimensions={"width_in_px": 1200, "height_in_px": 800},
layers=[
{
"index": 0,
"type": "solid-color",
"hex_color": "#FFFDF5",
},
{
"index": 1,
"type": "solid-color",
"hex_color": "#C9A84C",
"position": {"x_in_px": 30, "y_in_px": 30},
"dimensions": {"width_in_px": 1140, "height_in_px": 740},
},
{
"index": 2,
"type": "solid-color",
"hex_color": "#FFFDF5",
"position": {"x_in_px": 40, "y_in_px": 40},
"dimensions": {"width_in_px": 1120, "height_in_px": 720},
},
{
"index": 3,
"type": "text",
"text": "Certificate of Completion",
"font_name": "Playfair Display",
"font_size_in_px": 42,
"text_color": "#333333",
"text_align": "center",
"position": {"x_in_px": 100, "y_in_px": 100},
"dimensions": {"width_in_px": 1000, "height_in_px": 60},
},
{
"index": 4,
"type": "text",
"text": "Jane Smith",
"font_name": "Playfair Display",
"font_size_in_px": 56,
"text_color": "#1a1a1a",
"text_align": "center",
"font_weight": "Bold",
"position": {"x_in_px": 100, "y_in_px": 280},
"dimensions": {"width_in_px": 1000, "height_in_px": 80},
},
{
"index": 5,
"type": "text",
"text": "Advanced API Design",
"font_name": "Inter",
"font_size_in_px": 28,
"text_color": "#555555",
"text_align": "center",
"position": {"x_in_px": 100, "y_in_px": 420},
"dimensions": {"width_in_px": 1000, "height_in_px": 50},
},
{
"index": 6,
"type": "text",
"text": "March 5, 2026",
"font_name": "Inter",
"font_size_in_px": 20,
"text_color": "#888888",
"text_align": "center",
"position": {"x_in_px": 100, "y_in_px": 600},
"dimensions": {"width_in_px": 1000, "height_in_px": 40},
},
],
output_format="png",
)
with open("result.png", "wb") as f:
f.write(base64.b64decode(result["data"]["buffer"])){
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}package main
import il "github.com/iterationlayer/sdk-go"
client := il.NewClient("YOUR_API_KEY")
result, err := client.GenerateImage(il.GenerateImageRequest{
Dimensions: il.Dimensions{WidthInPx: 1200, HeightInPx: 800},
OutputFormat: "png",
Layers: []il.Layer{
il.NewSolidColorBackgroundLayer(0, "#FFFDF5"),
il.NewRectangleLayer(1, "#C9A84C",
il.Position{XInPx: 30, YInPx: 30},
il.Dimensions{WidthInPx: 1140, HeightInPx: 740}),
il.NewRectangleLayer(2, "#FFFDF5",
il.Position{XInPx: 40, YInPx: 40},
il.Dimensions{WidthInPx: 1120, HeightInPx: 720}),
il.NewTextLayer(3, "Certificate of Completion", "Playfair Display", 42, "#333333",
il.Position{XInPx: 100, YInPx: 100},
il.Dimensions{WidthInPx: 1000, HeightInPx: 60}),
il.NewTextLayer(4, "Jane Smith", "Playfair Display", 56, "#1a1a1a",
il.Position{XInPx: 100, YInPx: 280},
il.Dimensions{WidthInPx: 1000, HeightInPx: 80}),
il.NewTextLayer(5, "Advanced API Design", "Inter", 28, "#555555",
il.Position{XInPx: 100, YInPx: 420},
il.Dimensions{WidthInPx: 1000, HeightInPx: 50}),
il.NewTextLayer(6, "March 5, 2026", "Inter", 20, "#888888",
il.Position{XInPx: 100, YInPx: 600},
il.Dimensions{WidthInPx: 1000, HeightInPx: 40}),
},
}){
"success": true,
"data": {
"buffer": "iVBORw0KGgoAAAANSUhEUgAA...",
"mime_type": "image/png"
}
}