OG images
GET /og/{publicId} returns a 1200×630 PNG suitable for <meta property="og:image">. Every option below is a query parameter.
Minimum request
https://api.ogstack.dev/og/{publicId}?url=https://example.com/postThe url parameter is required and must be URL-encoded. Its origin must match one of the project’s registered domains.
Query parameters
| Parameter | Type | Values |
|---|---|---|
url | string | Required. URL-encoded target page. |
template | string | Template slug (see Templates). Default: editorial. |
accent | hex | #RRGGBB. URL-encode as %23RRGGBB. |
dark | boolean | true or false. Default: true. |
font | enum | inter, plus-jakarta-sans, space-grotesk, jetbrains-mono, noto-sans, instrument-serif. |
logoUrl | string | URL to a logo (PNG/SVG). URL-encoded. |
logoPosition | enum | top-left, top-right, bottom-left, bottom-right. |
ai | boolean | true to enable an AI-generated background with default model. |
aiModel | enum | standard or pro (High fidelity — Pro plan only). |
aiPrompt | string | Up to 500 characters. Blended with page-derived context unless override is used in API calls. |
Response
Content-Type: image/png- Binary PNG body
Cache-Control: public, max-age=31536000, immutable(content-addressed — cached indefinitely)
Framework integration
Pick your stack. Each example wires the OG meta tag (and twitter:card) into the page’s <head>. Replace cLx8kZ9m with your project’s public ID.
HTML
<meta
property="og:image"
content="https://api.ogstack.dev/og/cLx8kZ9m?url=https://example.com/post&template=aurora&accent=%2310b981"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />Rate limits
Public endpoints are rate-limited per public ID using the project owner’s plan. Common social crawlers (Twitterbot, LinkedInBot, Slackbot, Discordbot, FacebookBot) bypass the limit so your previews still render during traffic spikes. See Rate limits.