MintRender
All docs pages

AI templates

POST /v1/templates/generate makes a draft template from a short description and a size. You check it in the editor and publish it. It never publishes by itself, and it costs no credits.

The call

curl

curl -X POST "https://mintrender.com/v1/templates/generate" \  -H "Authorization: Bearer $MINTRENDER_KEY" \  -H "Content-Type: application/json" \  -d '{"description":"an OG image for a cooking blog, dark, big title, logo bottom left","size":"1200x630","name":"Cooking blog OG"}'

JavaScript

const res = await fetch("https://mintrender.com/v1/templates/generate", {  method: "POST",  headers: {    Authorization: `Bearer ${process.env.MINTRENDER_KEY}`,    "Content-Type": "application/json",  },  body: JSON.stringify({    description: "an OG image for a cooking blog, dark, big title, logo bottom left",    size: "1200x630",    name: "Cooking blog OG",  }),});const body = await res.json();if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.error.request_id})`);console.log(body);

Python

import os import requests res = requests.post(    "https://mintrender.com/v1/templates/generate",    headers={"Authorization": f"Bearer {os.environ['MINTRENDER_KEY']}"},    json={        "description": "an OG image for a cooking blog, dark, big title, logo bottom left",        "size": "1200x630",        "name": "Cooking blog OG",    },    timeout=120,)body = res.json()if not res.ok:    raise RuntimeError(f"{body['error']['code']}: {body['error']['message']} ({body['error']['request_id']})")print(body)
FieldAbout
descriptionRequired. 3 to 500 characters: what the image is for and how it looks.
sizeWIDTHxHEIGHT, like 1200x630 (default) or 1080×1080. Each side 1 to 10,000.
nameOptional, 1 to 100 characters. Default: the description. A description over 60 characters is cut and ends with …

The answer is 201 with the new template (see the template object). Open it in the editor at https://mintrender.com/editor/#/t/{id}, change what you want, and publish. AI assistants can call the same maker with the MCP tool generate_template.

What it makes

  • A scene that passes the same checks as any template, in the size you asked for.
  • Text, shapes, image boxes, QR codes and barcodes, with a param on the layers you will change per image: titles, names, prices, photos, logos.
  • Fonts that the AI picks from the 60 most used Google Fonts families.
  • Image layers with an empty src. You send the image later in data, or set it in the editor.

The model is @cf/meta/llama-3.3-70b-instruct-fp8-fast on Cloudflare Workers AI. If its first answer does not pass the checks, it gets the problem and one more try. Your description is used only as data that says what to design.

Limits

PlanAI templates a month
Free3
Starter30
Pro100
Business500
  • The month is the calendar month in UTC. Each call that reaches the AI counts, also one that then fails.
  • The whole service also has a daily limit. When it is reached, calls answer 503 ai_busy until 00:00 UTC.
  • The new template counts toward the plan's template limit.
  • The AI has up to 45 seconds for each try. With the second try, one call can take up to 90 seconds.

Good descriptions

Say what the image is for, its mood and colours, and what changes per image. For example:

  • "a blog post OG image, dark blue, big white title, author name and date at the bottom"
  • "a product price card, white, photo on the left, name and price on the right"
  • "an event ticket, warm yellow, event name, date, seat number and a QR code on the right"
  • "a certificate of completion, A4 landscape, cream background, name in a serif font, course and date"

Errors

StatusCodeWhen
400invalid_requestdescription is under 3 or over 500 characters.
400invalid_sizesize is not WIDTHxHEIGHT with sides from 1 to 10,000.
402plan_limitThe plan's template limit is reached.
422ai_invalidThe AI could not make a valid template from this description. Change the description a little and try again.
429ai_limitThis month's AI templates for the plan are used.
451frozenThe workspace is frozen.
502ai_failedThe AI service could not answer. Try again.
503ai_busyThe daily limit of the whole service is reached. Try again after 00:00 UTC.
503not_configuredThe AI template maker is not set up on this server.
504ai_timeoutThe AI took too long. Try again.

Seen MintRender used for content that breaks our terms? Report it. Questions about the API: support@mintrender.com, with the request id.