apyhub
MARKETING · SMART GENERATION

Dynamic OG Image API

What it does

Dynamic OG Image Generator creates Open Graph images from a single request. Send a title and optional styling fields, and you get back a binary image you can use for social previews, link cards, and blog sharing.

Use the body object to set the main title and, if needed, tag, subtitle, author, domain, and reading_time. You can also control the look with template, background, bg_color, text_color, and accent_color. The service supports blog, minimal, bold, and card layouts, plus solid, gradient, horizontal gradient, vertical gradient, pattern, and mesh backgrounds.

This is a good fit when you need consistent preview images without generating them in your app or hand-designing each one. For example, you can create share images for new articles, product pages, or docs pages from the same endpoint and keep the styling aligned across your site.

Dynamic OG Image Generator returns the image as a binary response, so you can store it, serve it directly, or feed it into your publishing pipeline.

POST
Dynamic OG Image Generation
http://localhost:8080/chisleroff/dynamic-og-image-generation
QUICKSTARTGUIDE

Quickstart

Generate an OG image by sending the required title field in a JSON body.

curl -X POST "http://localhost:8080/chisleroff/dynamic-og-image-generation" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "How to Build APIs with FastAPI",
  "subtitle": "A complete guide to building production-ready APIs",
  "bg_color": "#4f46e5",
  "template": "blog",
  "background": "gradient",
  "author": "Jane Doe",
  "domain": "blog.example.com",
  "reading_time": "8 min read",
  "tag": "Tutorial"
}'

What you'll get back

Returns a binary file containing the generated image.

TRY ITLIVE · 50 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Tag/label pill text.
Main headline for the OG image.
Domain name to display.
Hex background color.
Subtitle text.
Hex text color.
Hex accent color (auto-derived if omitted).
Reading time label.

About this endpoint

What it does

Generates a dynamic Open Graph image from the provided body fields and returns the image as binary data.

Request Body

ParameterTypeMandatoryDescription
titleStringYesMain headline for the OG image. Max length 200.
tagStringNoTag/label pill text. Max length 50.
authorStringNoMax length 100.
domainStringNoDomain name to display. Max length 100.
bg_colorStringNoHex background color. Default: #1a202c.
subtitleStringNoSubtitle text. Max length 300.
templateENUMNoAllowed values: blog, minimal, bold, card. Default: blog.
backgroundENUMNoAllowed values: solid, gradient, gradient_horizontal, gradient_vertical, pattern, mesh. Default: solid.
text_colorStringNoHex text color. Default: #ffffff.
accent_colorStringNoHex accent color. Auto-derived if omitted.
reading_timeStringNoReading time label. Max length 50.

Response

Returns a binary string containing the generated image.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.