Tutorial2026-08-176 min read

Generate Beautiful Social Images with OGImage API

When someone shares your website on Twitter, LinkedIn, or Slack, the preview image matters. A good OG image can double your click-through rate.

What is OGImage?

OGImage is a simple API that generates Open Graph images on the fly. No design skills required.

Basic Usage

Add this to your HTML head:

That's it. You now have a professional-looking social preview image.

Available Parameters

ParameterDescriptionExample

titleMain headlinetitle=Hello+World

descriptionSubtitle textdescription=My+awesome+post themeColor schemetheme=dark patternBackground patternpattern=dots logoYour logo URLlogo=https://... fontSizeTitle sizefontSize=72

Themes

We offer 7 built-in themes:

  • light — Clean white background
  • dark — Sleek dark mode
  • gradient — Purple gradient
  • ocean — Blue tones
  • sunset — Warm orange
  • forest — Green nature
  • midnight — Deep blue-black
  • Patterns

    Add visual interest with patterns:

  • dots — Subtle dot grid
  • grid — Light grid lines
  • diagonal — Diagonal stripes
  • Dynamic Images in Next.js

    export async function generateMetadata({ params }) {
    

    const post = await getPost(params.slug);

    return {

    openGraph: {

    images: [{

    url: https://ogimage-sandy.vercel.app/api/og?title=${encodeURIComponent(post.title)}&theme=gradient,

    width: 1200,

    height: 630,

    }],

    },

    };

    }

    Pricing

    OGImage is free for basic usage:

  • 100 images/month on free tier
  • All themes and patterns included
  • No watermark
  • Need more? Pro plans start at $9/month for 10,000 images.

    Try It Now

    Open OGImage →


    *OGImage is part of aiyaiyai, an indie developer studio building focused tools for developers.*