Skip to content
POST AI agent ready /v1/og/generate

OG Image API - Free Open Graph Generator

Create branded Open Graph images for social sharing. Pass a title and optional description, pick a light or dark theme, set an accent color, and include your logo URL. The API returns a ready-to-use PNG you can serve as your og:image meta tag.

Parameters

stringrequired

Primary text rendered on the image. Keep it under 60 characters for best results.

string

Secondary text rendered below the title. Optional but recommended for context.

string

Background theme for the generated image.

string

Accent color as a hex code (include the #). Applied to highlights and borders.

string

URL to a logo image displayed on the card. PNG or SVG recommended.

Code examples

curl -X POST https://api.botoi.com/v1/og/generate \
  -H "Content-Type: application/json" \
  -d '{"title":"Ship faster with the Botoi API","description":"150+ developer endpoints, zero infrastructure to manage.","theme":"dark","color":"#3b82f6","logo":"https://botoi.com/logo.png"}'

When to use this API

Dynamic blog post previews

Generate a unique OG image for every blog post at publish time. Pass the post title and excerpt to the API, cache the resulting PNG on your CDN, and every social share gets a branded preview without manual design work.

SaaS dashboard share cards

When users share a report or dashboard link, generate an OG image on the fly that includes the report title and a summary stat. Recipients see a rich preview instead of a generic fallback.

E-commerce product cards

Create social preview images for product pages by passing the product name, price, and brand color. Each product link shared on Twitter, Slack, or LinkedIn renders a polished card.

Frequently asked questions

What dimensions does the generated OG image use?
The API returns a 1200x630 PNG, the recommended size for Open Graph and Twitter Card images. This resolution displays well across Facebook, LinkedIn, Twitter, Slack, and Discord.
Can I use a custom font?
The API ships with a clean sans-serif font optimized for readability at social media preview sizes. Custom font uploads are not supported at this time.
How do I serve this as my og:image tag?
You can either call the API at build time, save the PNG to your CDN, and reference that URL in your meta tag; or point the og:image URL directly at the API endpoint if you prefer on-demand generation.
Is the response cached?
The API does not cache responses. If you send the same parameters twice, it generates a fresh image each time. For production use, store the result on your own CDN or object storage.
What happens if I omit the description?
The image renders with the title only, centered vertically. This works well for short, punchy headlines.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.