Vercel OG vs OGMagic: Which Open Graph Solution Should You Choose?
Both generate Open Graph images for Next.js. But they take completely different approaches. Here's how to pick the right one for your project.
If you're building a Next.js app and need dynamic Open Graph images, you've probably encountered @vercel/og — the official solution from Vercel. But there's another option: OGMagic, an API-first alternative.
Both solve the same problem. But they have very different philosophies. This comparison will help you pick the right tool for your needs.
Quick Verdict
Choose Vercel OG if...
- ✅ You want pixel-perfect control over every element
- ✅ You're comfortable writing JSX/React code for designs
- ✅ You need custom fonts loaded dynamically
- ✅ You want to own the image rendering route and deployment
- ✅ You can maintain template code and fonts
Choose OGMagic if...
- ✅ You want a hosted image API with ready-made templates
- ✅ You want to create images when publishing content
- ✅ You want social shares to fetch already saved images
- ✅ You prefer visual design over JSX coding
- ✅ You want 55+ pre-built templates to choose from
Fundamental Difference: Code vs API
Vercel OG: Code-First
With @vercel/og, you write React/JSX code to define each OG image design:
import { ImageResponse } from 'next/og';
export function GET(request: Request) {
const { searchParams } = new URL(request.url);
const title = searchParams.get('title');
return new ImageResponse(
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: 'linear-gradient(to bottom, #1a1a2e, #16213e)',
color: 'white',
fontSize: 60,
}}
>
{title}
</div>,
{ width: 1200, height: 630 }
);
}Every design variation requires code changes. Want a different background? Edit the JSX. Want to add an author name? Add a new prop and update the layout.
OGMagic: API-First
With OGMagic, send an authenticated creation request from your server or publishing workflow, then save its returned public URL:
POST /api/images — publish the returned image URLKeep your private API key in the creation workflow and put only the returned URL in yourog:image and twitter:image tags. Social crawlers retrieve the saved image without credentials.
Head-to-Head Comparison
| Feature | Vercel OG | OGMagic |
|---|---|---|
| Setup | Create API route, write JSX | Create image, then save its URL |
| Design changes | Edit code, redeploy | Pick different template |
| Creation workflow | Your route or build pipeline | Server or publishing request |
| Templates | Build your own | 55+ pre-built |
| Customization | Unlimited (code anything) | Template params + accent color |
| Framework support | ImageResponse / compatible runtimes | Any framework (it's just a URL) |
| Cost | Library plus deployment costs | Free tier + €10 / US $12 one-time Pro |
When should the image be created?
With ImageResponse, you choose whether to generate an image from a route or integrate rendering into your build or publishing pipeline. Runtime support and caching depend on the deployment. Measure your own design and environment before choosing a creation strategy.
OGMagic creates a saved image during an authenticated POST request. If that request runs during a build, the build waits for it. If it runs when content is published, later builds and social shares can reuse the saved URL. A social share does not trigger OGMagic image creation.
When Vercel OG Wins
Vercel OG is the right choice when you need:
- Pixel-perfect custom designs — If your brand has very specific requirements that don't fit templates, coding gives you unlimited control.
- Dynamic data from your CMS — Pulling author avatars, custom badges, or complex layouts based on content? Vercel OG can fetch and render anything.
- Multiple fonts with specific loading — While OGMagic supports fonts, Vercel OG gives you more control over font loading and fallbacks.
When OGMagic Wins
OGMagic is the right choice when you want:
- Hosted rendering — Create through the API or editor, save the returned URL, and publish it in your metadata.
- Creation outside the build — Create images when publishing content so later builds can reuse their stored URLs.
- Beautiful defaults — 55 professionally designed templates. No design skills needed.
- Framework flexibility — Works with Astro, Nuxt, SvelteKit, Hugo, Jekyll, plain HTML — anything that can output a meta tag.
- One-time pricing — €10 / US $12 once vs. Vercel's usage-based pricing (which can add up at scale).
Real-World Example
Let's say you're building a Next.js blog. Here's how you'd add OG images with each:
With Vercel OG
Implement an ImageResponse route as above, then point your page metadata at that route. Validate and encode any query parameters you accept. Fonts, assets, cache policy, and rendering errors belong to that route's implementation.
With OGMagic
// Run on your server, at build time, or when publishing content.
const response = await fetch("https://www.ogmagic.dev/api/images", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.OGMAGIC_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ title: "My article", template: "gradient-mesh" }),
});
if (!response.ok) throw new Error("Image creation failed");
const image = await response.json();
// Save image.url with your content; use it in og:image and twitter:image.Persist image.url with the post and read that field when generating metadata. The Next.js integration guide shows the complete metadata setup.
Pricing Comparison
Vercel OG
Image generation uses your deployment's resources. Check the current function, bandwidth, and caching allowances for your hosting plan. The rendering library and the hosting bill are separate considerations.
OGMagic
Free tier: 50 new images per 30 days, email access
Pro: €10 / US $12 one-time (not monthly), 500 new images per 30 days
Choose a plan based on the number of new images you create. Serving an existing saved URL does not consume another generation credit.
Conclusion
Both tools are solid. The choice comes down to your priorities:
Want maximum control and don't mind coding? Vercel OG is great. You'll spend more time upfront but get unlimited flexibility.
Want ready-made templates? OGMagic lets you create through an editor or HTTP request, then reuse a saved image URL. Your application still manages when to create or replace that image.
And hey — you can always try both. Use OGMagic for your blog posts (fast, beautiful templates) and Vercel OG for highly customized pages (pricing pages, landing pages). They're not mutually exclusive.
Ready to try OGMagic?
55 templates. Free tier. Email access; no password.
This comparison is written by OGMagic. See the Vercel OG documentation for supported runtimes and the Next.js hosted-image guide for a complete integration. Send corrections through contact and support.