POST
/v1/generate/og-imageGenerate professional Open Graph images programmatically using customizable templates.
OG Image Generation
Create beautiful, professional OG images using customizable templates. Perfect for blogs, SaaS products, and content platforms.
Available Endpoints
POST
/v1/generate/og-imageGenerate from custom title, subtitle, and options
POST
/v1/generate/from-urlAuto-generate from URL metadata
Request Body (Custom)
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | - | Main title text (max 100 chars) | |
subtitle | string | - | Secondary text (max 200 chars) | |
template | enum | gradient | gradient | minimal | bold | dark | light | |
primary_color | string | - | Hex color code (e.g., #6366f1). Auto-generated if not provided. | |
domain | string | - | Domain name to display | |
logo | string | - | Logo image URL to display on the OG image |
Templates
gradient
Smooth gradient from primary color to dark. Best for modern tech products.
minimal
Clean white background. Great for professional brands.
bold
Dark background with decorative circles. Eye-catching design.
dark
Solid dark navy background. Ideal for tech and developer content.
light
Light gray background. Perfect for clean, professional look.
Request Example (Custom)
curl -X POST "https://api.katsau.com/v1/generate/og-image" \
-H "Authorization: Bearer ks_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "10 Tips for Better Code",
"subtitle": "A comprehensive guide for developers",
"template": "gradient",
"primary_color": "#6366f1",
"domain": "myblog.dev",
"logo": "https://myblog.dev/logo.png"
}'Request Example (From URL)
Automatically extract title, description, and favicon from any URL:
curl -X POST "https://api.katsau.com/v1/generate/from-url" \
-H "Authorization: Bearer ks_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"url": "https://myblog.dev/posts/better-code",
"template": "gradient"
}'Response
{
"success": true,
"data": {
"image_url": "https://api.katsau.com/cdn/generated/og_a1b2c3d4e5f6.png",
"dimensions": { "width": 1200, "height": 630 },
"format": "png",
"size_bytes": 199403,
"expires_at": "2026-01-24T00:00:00Z"
},
"meta": {
"request_id": "req_abc123xyz",
"response_time_ms": 777
}
}Response (From URL)
The from-url endpoint includes extracted metadata:
{
"success": true,
"data": {
"source_url": "https://myblog.dev/posts/better-code",
"image_url": "https://api.katsau.com/cdn/generated/og_xyz789.png",
"dimensions": { "width": 1200, "height": 630 },
"format": "png",
"size_bytes": 199403,
"expires_at": "2026-01-24T00:00:00Z",
"extracted": {
"title": "10 Tips for Better Code",
"subtitle": "A comprehensive guide for developers",
"domain": "myblog.dev",
"favicon": "https://myblog.dev/favicon.png",
"theme_color": "#6366f1"
}
},
"meta": {
"request_id": "req_xyz789abc",
"response_time_ms": 850
}
}Image Specifications
| Dimensions | 1200 × 630 pixels (optimal for all platforms) |
| Format | PNG |
| CDN | Cloudflare R2 (global edge delivery) |
| Cache | 1 year (immutable) |
| Expiration | 30 days after generation |
Use Cases
- •Blog Posts: Auto-generate OG images for each article
- •SaaS Products: Create branded social cards for landing pages
- •Event Pages: Generate event-specific promotional images
- •User Content: Create OG images for user-generated content