OG Image Generator API

Generate social preview images with a single URL. No API key needed.

Quick Start

Build a URL with your parameters and use it directly in HTML:

<meta property="og:image"
  content="https://[your-domain]/api/og?title=My+Blog+Post&template=gradient" />

Parameters

ParameterRequiredDefaultDescription
titleYesMain title text (max 80 chars)
subtitleNoSubtitle text (max 120 chars)
templateNogradientgradient, bold, minimal, split, dark
colorNo#ff6b35Hex color for brand accent
logoNoHTTPS URL to your logo (PNG/SVG, max 500KB)

Examples

# Basic
/api/og?title=Hello+World

# Custom template and color
/api/og?title=Launch+Day&template=bold&color=%2339d2c0

# With subtitle and logo
/api/og?title=My+Company&subtitle=We+build+things&logo=https://example.com/logo.png

Rate Limits

100 requests per month per IP address (free tier).

Cache hits don't count — identical parameter combinations are served from edge cache without consuming your quota.

Need more? Pro plan with unlimited API is coming soon.

Response

  • Content-Type: image/png
  • Dimensions: 1200×630 pixels
  • Cache: Identical parameters return instantly from edge cache
  • Errors: 400 (missing title), 429 (rate limited), 500 (render failed)