Check a template before you render it
A template that looks right with the sample title can break on the longest real one. The check lays it out with your values, in the same browser that renders, and tells you what would go wrong and how to fix it.
One call
curl -X POST https://api.imageapis.com/v1/templates/check \
-H 'X-API-Key: YOUR_KEY' -H 'Content-Type: application/json' \
-d '{
"template": "tpl_4nq8vzk2hdyw7bxme3rc",
"variables": { "title": "The longest headline anyone on the team has ever written for a launch post" }
}'
{
"ok": false, "errors": 1, "warnings": 1,
"issues": [
{ "level": "error", "code": "text_overflow", "layer": "title",
"message": "title does not fit its box even at 8 px; the end is cut off",
"fix": "shorten the text, make the box bigger, or lower min_size" },
{ "level": "warning", "code": "low_contrast", "layer": "site",
"message": "site has a contrast of 2.1:1 against what is behind it; 4.5:1 is the usual minimum for body text",
"fix": "darken or lighten the text or its background" }
],
"layers": [
{ "name": "title", "type": "text", "font_size": 8, "start_size": 72, "lines": 41, "fits": false, "contrast": 17.4 }
]
}
template is a saved template's id or an inline template, and variables and modifications work as they do for a render. ok is true when nothing is an error. The check is free. Add "render": true and it renders the image too, for one unit, and returns it under image, so you can look at what was checked.
What it looks for
From the layout in the browser, after fonts load and text has shrunk to fit:
text_overflow(error): the text still does not fit at its smallest size, so the end is cut off.text_clamped: it was cut tomax_lineswith an ellipsis.text_shrunk: it fits, but only after shrinking below 60% of its size.text_small: under about 16 px on a 1200 px card, which is hard to read where cards are shown.low_contrastandtext_invisible: the text against what is behind it, measured at five points inside its box: the canvas, a rectangle, a shape, or the layer's own background. Under 4.5:1 for body text or 3:1 for large text is a warning; under 1.5:1 is an error. Text over a photo or a gradient is not measured.image_failed,background_image_failed,icon_failed: something did not load.image_low_resolution: the image is drawn more than 1.5 times its own size and will look soft.font_not_loaded: a font name that Google Fonts does not have, so a fallback was used.
From the template and the values alone:
missing_variable: a{{placeholder}}with no value renders empty.unused_variable(info): a value nothing uses, often a typo.off_canvas(error) andpartly_off_canvas: a layer outside the canvas, or text partly outside it.text_overlap: two text boxes on top of each other.qr_small: a QR code under 96 px, too small for a phone to read reliably.empty_text,image_missing,zero_size,icon_not_found.
A problem that would stop the render (an icon name that does not exist, say) comes back as an issue, not as a failed request.
Check with your longest and shortest values
Text that fits itself hides problems until a real value arrives. Check a design with the longest title you expect and with the shortest, and with the longest name in your user table. If the longest one shrinks too far, the usual fixes are a bigger box, a lower size to start from, or fit: "clamp" with max_lines so long values end in an ellipsis instead.
For agents
Over the MCP server the check is the check_template tool. An agent that writes templates can design, check, read the issues, fix them and check again before it saves or renders anything. Every issue names its layer and comes with a fix, so a model can act on it without looking at pixels. When it does want to look, render: true returns the image in the same call.
In the editor
The editor has a Check button. It runs the same check with the values in the Variables tab (without a key it uses the site's demo), lists the issues under the canvas and outlines the layers they are about. Click an issue to select its layer.