Render API
One call.
One on-brand image.
No headless browser. No font-loading race. No screenshot service quietly rendering the wrong weight.
curl -X POST https://api.anjin.design/v1/renders \
-H "Authorization: Bearer $ANJIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"template": "acme_instagram_1080x1350",
"modifications": [
{"name": "headline", "text": "Launch day"},
{"name": "hero_image", "image_url": "https://…/photo.jpg"},
{"name": "brand_color", "color": "#2563EB"}
]
}'Why the output is trustworthy
One engine, two homes.
The renderer in the browser editor and the renderer behind this API are the same engine running the same file. Parity is structural, not a test suite we hope stays green. We measure it at SSIM 1.00000.
If you have ever shipped an image pipeline on headless Chrome, you know the class of bug this deletes: the font that resolved differently on the render box, the line that wrapped one word early in production, the emoji that came out a box.
Structural similarity
1.00000
Editor output vs API output. A perfect match.
The surface
Seven endpoints. That’s the whole thing.
GET /v1/templatesPublished templates, each with its addressing keyGET /v1/templates/:id/schemaThe slot contract — names and typesPOST /v1/rendersRender one. Async by default, or wait for the imagePOST /v1/renders/batchRender many, with per-row success and failureGET /v1/renders/:idPoll a jobPOST /v1/assets/querySearch your asset library by tag or metadataGET /v1/webhook-secretYour HMAC secret for verifying callbacksDiscover before you render
The template tells you what it accepts.
Validate input before you spend a credit — and keep your integration working when a designer adds a slot. An unknown slot name fails with a 422 naming the offender, and charges nothing.
GET /v1/templates/:id/schema
{
"slots": [
{ "name": "headline", "type": "text" },
{ "name": "hero_image", "type": "image" },
{ "name": "brand_color", "type": "color" }
]
}Two URLs, on purpose
One to download. One to keep.
output_urlA signed link, valid about an hour. Fine for an immediate download.
asset_urlPermanent. Use this for anything you store or hand to another system.
We learned this the hard way: a temporary URL saved into someone’s database expires, and the failure surfaces weeks later as a broken image on a client’s site.
Launch day
1080×1350
Launch day
1080×1920
Launch day
1080×1080
Launch day
PRODUCT1280×720
Each one composed for its shape — not the same image cropped four ways.
Errors worth knowing
Structured, and free when they’re our fault.
template_not_publishedPublish the frame first. No credit charged.unknown_slotWith the offending slot name. No credit charged.image_out_of_folderA folder-bound slot was given an outside image.insufficient_creditsWith the amount required.invalid_scalescale must be between 1 and 4.Failed renders are refunded automatically. You’re charged for images you receive.
Cost
One credit. More only when it’s more work.
scale 1–4×, priced scale² — 1, 4, 9, 16 — because that is what the pixels do. The response tells you the cost.
A 2× render costs 4 credits — four times the pixels, four times the price.
Also available
Batch
Send many, get per-row success and failure. One bad row fails alone; the rest proceed.
Signed webhooks
Completion callbacks signed with X-Anjin-Signature. Fetch the secret from the API and verify it.
CLI + MCP
anjin render … for shells and CI, and an MCP server so AI agents can render on brand.
Questions
- How do I generate images from a template with an API?
- POST to /v1/renders with a template key and your content as typed slots. You get back a job with a signed output_url and a permanent asset_url. There is a batch endpoint for volume and signed webhooks for completion.
- Will the API output match my design exactly?
- Yes. The editor and the API run the same rendering engine on the same file, so parity is structural rather than tested for. We measure it at SSIM 1.00000.
- Is there a free image generation API?
- The free trial gives you 30 credits with no card, which is enough to build a template and render from the API properly. Paid plans start at £29 a month.
- Can I generate images in bulk?
- Yes — POST /v1/renders/batch returns per-row success and failure, so one bad row fails alone and the rest of the batch proceeds.
- What image formats and sizes are supported?
- PNG, JPG and WebP at the template's own dimensions, with a scale multiplier from 1× to 4×. Each output size is a separate frame with its own layout, so it is composed rather than cropped.
- Do the image URLs expire?
- output_url is signed and valid about an hour. asset_url is permanent — use that one for anything you store.
