URL Parameters Reference

Comprehensive reference of all query parameters supported by the Open Graph Image Generator API.

Every image generated by /v1/images/{layout}.png is customized via URL query parameters.

The API uses strict parameter validation: unknown parameters, invalid characters, or values outside permitted ranges result in an immediate HTTP 400 (invalid_parameter or unknown_parameter) error response.


Global Query Parameters

ParameterTypeRequiredDefaultValidation & Constraints
titlestringYes—Length: 1 to 120 characters. Trimmed. Required across all layouts.
subtitlestringNo—Length: 0 to 80 characters. Secondary heading text.
descriptionstringNo—Length: 0 to 240 characters. Explanatory paragraph or summary body.
sizestringNoogEnum: og (1200×630), twitter (1200×600), square (1200×1200).
themestringNodarkEnum: dark, light. Controls default contrast palettes.
bgstringNoLayout defaultHex color code (3 or 6 characters, e.g. 0a0a0a or fff). Do not include #.
bg2stringNo—Hex color code for secondary gradient stop. When omitted, background is solid or image-backed.
anglenumberNo135Integer: 0 to 360. Gradient rotation angle in degrees (requires bg2).
bg_imagestringNo—Publicly routable HTTPS URL for canvas backdrop (max 2 MB).
bg_overlaynumberNo75Integer: 0 to 100. Contrast tint opacity percentage over bg_image (requires bg_image).
colorstringNoLayout defaultPrimary foreground text color (3 or 6 hex characters without #).
accentstringNoLayout defaultAccent color for highlight rules, tags, and borders (hex without #).
fontstringNointerEnum: inter (sans), source-serif-4 (serif), jetbrains-mono (mono).
alignstringNoLayout defaultEnum: left, center. Text alignment for headings and descriptions.
imagestringNo—Publicly routable HTTPS URL for featured content mockup or screenshot (max 2 MB).
image_fitstringNocoverEnum: cover, contain. Scaling mode for content image.
image_radiusstringNoroundedEnum: rounded (16px), circle (100%), square (0px).
image_borderstringNosubtleEnum: subtle (1px translucent edge), none.
logostringNo—Publicly routable HTTPS URL to brand logo (PNG, JPEG, or SVG, max 2 MB).
logo_fitstringNocontainEnum: contain, cover. Scaling mode for brand mark.
logo_radiusstringNoroundedEnum: rounded, circle, square.
logo_borderstringNononeEnum: none, subtle.
avatarstringNo—Publicly routable HTTPS URL to user avatar (PNG or JPEG, max 2 MB).
avatar_fitstringNocoverEnum: cover, contain. Scaling mode for avatar.
avatar_radiusstringNocircleEnum: circle, rounded, square.
avatar_borderstringNononeEnum: none, subtle.
authorstringNo—Length: 0 to 40 characters. Author name or handle.
vstringNo—Cache buster string ([a-z0-9]{1,16}, e.g. v=2 or v=ab3f).

Layout Parameter Support Matrix

Not all layouts consume every query parameter. Supplying an unsupported parameter returns an invalid_parameter or unknown_parameter error.

The table below reflects the exact capabilities of each built-in layout:

Parameterminimalarticledocsproductprofileannouncement
titleYesYesYesYesYesYes
subtitle—YesYesYesYesYes
description—YesYes—YesYes
sizeYesYesYesYesYesYes
themeYesYesYesYesYesYes
bgYesYesYesYesYesYes
bg2YesYesYesYesYesYes
angleYesYesYesYesYesYes
bg_imageYesYesYesYesYesYes
bg_overlayYesYesYesYesYesYes
colorYesYesYesYesYesYes
accentYesYesYesYesYesYes
fontYesYesYesYesYesYes
alignYesYesYesYesYesYes
imageYesYesYesYesYesYes
image_fitYesYesYesYesYesYes
image_radiusYesYesYesYesYesYes
image_borderYesYesYesYesYesYes
logo——YesYes—Yes
logo_fit——YesYes—Yes
logo_radius——YesYes—Yes
logo_border——YesYes—Yes
avatar—Yes——Yes—
avatar_fit—Yes——Yes—
avatar_radius—Yes——Yes—
avatar_border—Yes——Yes—
author—Yes————
vYesYesYesYesYesYes

Color Formatting & Syntax

Colors must be passed as raw 3-digit or 6-digit hex values without the leading hash (#) symbol:

  • Correct: bg=0a0a0a&color=f4f4f5&accent=3b82f6
  • Incorrect: bg=%230a0a0a (fails validation with invalid_parameter)

If bg2 is provided alongside bg, the renderer applies a linear gradient calculated from angle (default: 135 degrees).


Text Encoding & Length Limits

  • Maximum URL Length: 2,048 characters total. If your request exceeds this, the edge returns HTTP 414 (uri_too_long).
  • Encoding: Always URL-encode values containing spaces, ampersands, or Unicode characters:
    • Space: %20 or +
    • Ampersand: %26
    • Quotation marks: %22
    • Slash: %2F

For interactive experimentation with automatic parameter validation, visit the Playground.