CMS integrations

The cleanest OG pipeline generates the image when you publish, not when a crawler shows up. Every recipe below follows the same shape: your CMS fires a hook, a tiny handler calls the OGImagen API, and the permanent CDN URL lands back in your content, ready for og:image.

CMS publish
  → webhook / lifecycle hook
  → your handler
      ├─ default:  POST /api/v1/templates   (sync, 0 credits, deterministic)
      └─ hero:     POST /api/v1/generations (AI, async, webhook or poll)
  → write the permanent URL into the CMS field
  → your frontend renders <meta property="og:image" ...>

Templates for the blog, AI for the launches

Two different jobs, two different engines:

  • Every post, same branded card, use templates. They cost 0 credits, render in one synchronous call, and look identical post after post. Pass your brandKitId and every card carries your logo and color.
  • The pages that matter, landings, launches, flagship guides, use AI generation. One flash credit buys a card that doesn't look like a template, hosted forever on the CDN.

Don't run AI on every publish of a 200-post blog: it burns credits and the visual variation between posts reads as inconsistency, not creativity. Make templates the default and AI the opt-in.

The three API features that make this work

  • Brand kits, brandKitId on both endpoints applies your logo, color, style and headline defaults to every image. One kit, fifty consistent posts.
  • Idempotency, CMS hooks fire more than once. Send an idempotencyKey (e.g. a hash of slug + title) and retries return the original image instead of charging again.
  • Webhooks, pass webhookUrl and get a signed generation.completed event instead of polling. Your handler patches the CMS and exits.

Recipes

PlatformApproach
SanityGROQ-powered webhook on publish, patch the document with the image URL.
StrapiLifecycle hook (afterUpdate on publish) or a Strapi webhook.
WordPress (headless)A 20-line mu-plugin fires on publish; your Next/Astro frontend reads the URL.
n8n / MakeNo-code flow covering Webflow, Ghost, Notion, Airtable, and classic WordPress.

Ghost, Payload, Contentful and Webflow all speak the same webhook language, the n8n/Make recipecovers them without platform-specific code, or adapt the Sanity handler (it's ~40 lines).

Requirements

Any paid plan ($5 one-time and up) includes the API key. Templates are unlimited and free to render on every plan; hosting is unlimited on paid plans. AI generations cost credits (flash = 1 credit per variant).


Start with the API reference, or jump straight into a recipe above. Questions? Talk to us.