templates

AI design generation

Changed on

Generate or modify an Unlayer design using AI. Send the conversation as messages (today only the last user message is consumed; earlier turns are accepted as chat history) and describe the target with output.kind + output.displayMode. Pass the current canvas state in context (full design JSON + selection pointer) to modify an existing design. Only anthropic and openai models are supported. To import existing HTML or an image instead, use POST /v3/templates/import.

post/v3/templates/generate

Request

  • Base URL: https://api.unlayer.com
  • URL: https://api.unlayer.com/v3/templates/generate
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Query parameters

projectIdstring

The project ID (required for PAT auth, auto-resolved for API key auth)

Request body

modelstring

Preferred AI model in "provider/id" form, e.g. "anthropic/claude-opus-5". Optional — server resolves a default per output kind.

localestring

BCP-47 fallback locale for AI status messages.

conversationIdstring

Reserved for future server-side conversation memory.

Response

The generated (or modified) design plus model metadata and optional usage metadata.

idstring

Provider response id for the generation turn.

Changes

    • breaking

      the request property / became not nullable

    • breaking

      the request property / became not nullable

    • breaking

      the request property / became not nullable