GET /og/{title}.png

Generates a custom Open Graph image (1200x630px) with the specified title and optional styling parameters. Perfect for social media previews.

Note: The actual endpoint includes .png extension (e.g., /og/My-Title.png)

Path parameters

  • title string Required

    The main title text to display on the image (without .png extension)

Query parameters

  • theme string

    Color theme for the image background

    Values are dark or light. Default value is dark.

  • fontSize string

    Custom font size for the title (e.g., "120px"). If not specified, the font size is automatically calculated based on title length.

  • caption string

    Optional caption text displayed below the title

  • captionFontSize string

    Font size for the caption text

    Default value is 70px.

  • images array[string(uri)]

    URLs of images to embed in the OG image (max 180x180px each). Can be specified multiple times for multiple images.

  • colors array[string]

    Hex colors for the title gradient. Can be specified multiple times for multi-color gradients. Omit '#' prefix (e.g., "1d3a4d" not "#1d3a4d").

Responses

  • 200 image/png

    Successfully generated OG image

    Hide headers attributes Show headers attributes
    • Content-Type string
    • Cache-Control string

      Caching policy for the generated image

  • 500 application/json

    Internal Server Error

    Hide response attribute Show response attribute object
    • error string Required

      Error message describing what went wrong

GET /og/{title}.png
curl \
 --request GET 'http://localhost:3000/api/og/Welcome-to-My-Blog.png'
Response examples (500)
{
  "error": "Failed to generate image"
}