/// GENERATE
1 credit

OG Image API — social cards on demand

Branded 1200×630 cards from a template, a title and one HTTP call.

/// Quick answer

The OG Image API renders 1200×630 Open Graph social cards from a template and your text in one REST call. Pick basic, split or quote, pass title, subtitle, eyebrow and an optional logo, and the card comes back as a PNG — with the title font auto-shrunk when a long headline would overflow. One credit per image.

Try OG Image API — free →Read the docs

How does the OG Image API work?

One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.

curl -X POST https://www.ashdocs.com/api/v1/tools/og-image \
  -H "X-API-Key: ash_live_..." \
  -H "Content-Type: application/json" \
  -d '{"template":"basic","fields":{"eyebrow":"GUIDE","title":"Static vs Dynamic QR Codes"}}'

Common use cases

Frequently asked questions

What size are the generated images?+

1200×630 by default — the ~1.91:1 ratio most platforms crop toward. Width and height are overridable in options.

What happens with very long titles?+

The title font size shrinks automatically until the text fits the template, so your longest headline still renders as a clean card instead of overflowing.

Which templates are available?+

basic (eyebrow, title, subtitle, logo), split (text beside a colour panel) and quote (large quotation layout). All render server-side as PNG.

Can I generate a card for every blog post automatically?+

Yes — call the endpoint at publish time with the post title, or on demand behind a cache. Change the image URL when the title changes so platform caches refresh.

RELATED TOOLS