OGKit
Reference

API reference

A single public endpoint renders your image. It takes no request body — everything is a query parameter.

Endpoint

Endpoint
GET https://ogkit.org/api/og?key=YOUR_KEY&url=CANONICAL_URL

Query parameters

The design (layout, colors, fonts, pattern) comes from the saved template referenced by key. Pass the page's url and OGKit resolves its content automatically; or push title/subtitle/site to set the content directly. When both are present, the explicit text wins.

ParameterTypeRequiredDefaultDescription
keystringYesYour template's API key. Find it in the editor or on the API keys page.
urlstringNoThe page's absolute canonical URL. OGKit reads it — from a curated card or a live crawl — for the page's real title/description. Its host must be within the template's bound domain, or the request is rejected. This is the recommended way to wire it.
titlestringNo""Advanced override — sets the headline directly and skips the pull. Useful for pages you can't or don't want crawled.
subtitlestringNo""Advanced override for the secondary line under the title.
sitestringNo""Advanced override for the small site label / domain shown on the image.

Response

On a fresh render, a 200 with Content-Type: image/pngand the rendered bytes. On a cache hit, a redirect to the cached image's Blob storage URL instead of re-sending the bytes. Either way the image is sized 1200×630 — the standard Open Graph ratio that X, LinkedIn, Slack, Facebook, and iMessage expect. A missing or unknown key returns an error status rather than an image; a url whose host is outside the template's bound domain returns 403.

The endpoint never returns a 5xx for a valid key. If a live crawl times out, it falls back to the template's default text and still renders an image — so your production og:image never breaks.

Caching

Renders are cached by the template plus the resolved content. A curated card is keyed by its own version, so edits show immediately; a live-crawled page is bucketed hourly, so a page's content edits propagate within about an hour. If you change a template's design, re-run your page through a social debugger to bust the crawler's own cache.

url selects the page; title, subtitle, and site override the pulled content. Everything visual is set once in the template — see Designing templates.