Generate beautiful dynamic Open Graph images programmatically with signed URLs and ready-to-use templates.
Used locally to derive sub. Stored only in your browser.
Default template for landing pages, homepages, and general content
Generate beautiful Open Graph images programmatically
This preview simulates how your OG image will appear. The actual API generates a high-quality PNG.
{
"iss": "yourdomain.com",
"sub": "YOUR_KEY",
"iat": 1769808122,
"template": "page",
"title": "OG Pilot",
"description": "Generate beautiful Open Graph images programmatically",
"bg_color": "#1a1a2e",
"text_color": "#eaeaea",
"logo_url": "https://api.dicebear.com/7.x/shapes/svg?seed=acmecorp&backgroundColor=transparent&shape1Color=eaeaea&shape2Color=a0a0a0&shape3Color=808080",
"image_url": "https://images.unsplash.com/photo-1551434678-e076c223a692?w=800&q=80"
}Sign this payload with HS256 using your API key as the secret. Remove iat for indefinite caching.
https://ogpilot.com/api/v1/images?token=YOUR_JWT_TOKEN"og_pilot_ruby" gem to generate OG images in your applicationog-pilot-js, og-pilot, sunergos/og-pilot-php) and use the code examples below to generate URLsOG Pilot uses JWT tokens signed with your API key to authenticate requests. This means:
1. Install gem & configure once
# Gemfile gem "og_pilot_ruby" # Set OG_PILOT_API_KEY and OG_PILOT_DOMAIN in your environment variables # OG_PILOT_API_KEY=ogpilot-your-api-key # OG_PILOT_DOMAIN=yourdomain.com
2. Generate images anywhere
# Use in meta tag <meta property="og:image" content="<%= OgPilotRuby.create_image(title: "My Post Title") %>" />
Install the appropriate library
Ruby: og_pilot_ruby
JS: og-pilot-js
Python: og-pilot
PHP: sunergos/og-pilot-php
Store API key and domain in environment variables
OG_PILOT_API_KEY=ogpilot-your-api-key OG_PILOT_DOMAIN=yourdomain.com
Configure the SDK once
Ruby: OgPilotRuby.configure
JS: configure
Python: og_pilot.configure
PHP: OgPilot::setConfig (or .env in Laravel)
Add og:image meta tag to your layout
Ruby: OgPilotRuby.create_image(title: ...)
JS: createImage(...)
Python: og_pilot.create_image(...)
PHP: OgPilot::createImage([...])
Override per-page as needed
Pass template-specific parameters (author, date, etc.) to customize individual pages
All API requests require a signed JWT passed as the token query parameter:
https://ogpilot.com/api/v1/images?token=YOUR_JWT_TOKENRequired JWT claims:
iss - Verified domain hostname for your accountsub - API key prefix (first 8 characters of your API key)Optional: iat for daily cache busting, plus any image parameters like template, title, and description.
API keys are account-scoped and can be used with any verified domain on your account.
Domain ownership must be verified via DNS TXT before the API generates images. For local development, requests from localhost are allowed in development mode only.
If you include iat in the JWT payload, OG Pilot treats the image as cacheable for 24 hours from that timestamp.
To refresh daily, generate a new JWT with a new iat value. If you omit iat, the image will remain cached indefinitely until parameters change.
If a new render is queued, OG Pilot serves the last completed image while regeneration happens in the background. When no prior image exists, JSON responses return a 202 and HTML/PNG requests redirect to a processing placeholder. Failed renders return an error placeholder while OG Pilot retries.
Default template for landing pages, homepages, and general content
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Main headline (max 60 chars) |
| bg_color | string | No | Background color (hex) |
| description | string | No | Subtitle text (max 100 chars) |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
Optimized for blog articles with author info and publication date
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Main headline (max 60 chars) |
| author_avatar_url | string | No | Author avatar URL |
| author_name | string | No | Author name |
| bg_color | string | No | Background color (hex) |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| publish_date | string | No | Publication date (ISO 8601) |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
Designed for podcast episodes with episode metadata
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Episode title |
| bg_color | string | No | Background color (hex) |
| episode_date | string | No | Episode date (ISO 8601) |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
E-commerce product pages with USP badges
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Product name |
| bg_color | string | No | Background color (hex) |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
| unique_selling_point | string | No | USP badge text |
Event pages with date, location, and ticket info
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Event name |
| bg_color | string | No | Background color (hex) |
| event_date | string | No | Event date or range |
| event_location | string | No | Event location |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
Book and publication pages
| Parameter | Type | Required | Description |
|---|---|---|---|
| book_author | string | Yes | Book author |
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| title | string | Yes | Book title |
| bg_color | string | No | Background color (hex) |
| book_description | string | No | Longer description |
| book_genre | string | No | Book genre |
| book_series_number | integer | No | Series number |
| description | string | No | Book description |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
Personal portfolio and profile pages
| Parameter | Type | Required | Description |
|---|---|---|---|
| iss | string | Yes | Verified domain hostname for your account |
| sub | string | Yes | API key prefix (first 8 chars of your key) |
| bg_color | string | No | Background color (hex) |
| iat | integer | No | Issued-at timestamp for daily cache busting |
| image_url | string | No | URL to main/hero image |
| logo_url | string | No | URL to your brand logo |
| template | string | No | Template type |
| text_color | string | No | Text color (hex) |
# Gemfile
gem "og_pilot_ruby"
# Set the API key and domain in your environment variables
OG_PILOT_API_KEY=your-og-pilot-api-key
OG_PILOT_DOMAIN=yourdomain.com
# ============================================================
# USAGE IN YOUR CONTROLLERS / VIEWS
# ============================================================
# Generate an OG image URL (handles JWT signing automatically)
og_image = OgPilotRuby.create_image(title: "My Page Title")
# With template and additional parameters
og_image = OgPilotRuby.create_image(
title: @post.title,
template: "blog_post",
author_name: @post.author.name,
publish_date: @post.published_at.to_date.iso8601,
image_url: @post.featured_image_url
)
# In ERB templates
# <meta property="og:image" content="<%= OgPilotRuby.create_image(title: @page_title) %>" />
# ============================================================
# FULL CONTROLLER EXAMPLE (with Inertia.js meta tags)
# ============================================================
class PostsController < ApplicationController
def show
@post = Post.find(params[:id])
og_image = OgPilotRuby.create_image(
title: @post.title,
description: @post.excerpt,
template: "blog_post",
author_name: @post.author.name
)
# Works great with Inertia Rails meta tags
inertia_meta.add [
{tag_name: "meta", property: "og:image", content: og_image},
{tag_name: "meta", name: "twitter:image", content: og_image}
]
render inertia: "posts/show", props: {post: @post}
end
endSecurity: Never hardcode your API key. Store it in an environment variable like OG_PILOT_API_KEY.
| 400 Bad Request | Missing or invalid parameters |
| 401 Unauthorized | Invalid JWT token |
| 403 Forbidden | Domain mismatch, not verified, or subscription required |
| 404 Not Found | Not found |
| 429 Too Many Requests | Rate limited |
Connect your domain, generate signed URLs, and let OG Pilot handle every social preview. One endpoint, all your templates.
Start a trial and ship OG images that earn clicks.