Public Beta — reserve early accessJoin Waitlist
ThumbAPI logoThumbAPI

Blog Cover Image API — Generate Featured Images From Post Title

ThumbAPI generates 1200x630 blog cover images from any post title. Plug it into your CMS publish hook and every article gets a unique featured image — no stock photos, no design tools, no manual work.

You publish a blog post. It needs a featured image for the page header, the RSS feed, the newsletter, and social sharing. You either spend 15 minutes in Canva, dig through stock photo sites, or skip it entirely. With ThumbAPI, your publish workflow calls the API with the post title and gets a unique cover image back in under 30 seconds.

API launches Q2 2026 — reserve your spot

Join Waitlist

Preview — API launches Q2 2026

generate-cover.sh
curl -X POST https://api.thumbapi.dev/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "A Complete Guide to Database Indexing",
    "format": "blogpost",
    "imageStyle": "faceless"
  }'

The Problem With Blog Featured Images

Every blog post needs a featured image. It shows up in at least four places: the post page header, social media previews (og:image), RSS readers, and newsletter embeds. Without one, your content looks incomplete.

The typical options are all bad:

  • Stock photos — generic, overused, and often irrelevant to the actual post title. Your article about database indexing gets a photo of someone typing on a laptop.
  • Manual design (Canva, Figma) — produces good results but takes 10-20 minutes per image. For a team publishing 5-10 posts per week, that adds up to hours of design work.
  • Skip it — no featured image means a broken-looking social preview, lower click-through rates from social shares, and a less professional blog.

ThumbAPI solves this with a single API call. Send your post title, get a unique 1200x630 image designed to match the content.

How It Works

  1. Send your post title with format: "blogpost" and your preferred imageStyle (faceless, with-image, or with-logo).
  2. AI generates the design. Typography, color palette, layout, and visual elements are selected based on the title content.
  3. Get a 1200x630 image as base64 (WebP or PNG). Save it as your featured image and og:image.

Under 30 seconds per image. The same image works as both your blog header and your og:image for social sharing — 1200x630 is the standard for both.

CMS Integration

WordPress

Hook into save_post to auto-generate a cover image on publish:

// WordPress: auto-generate featured image on publish
add_action('save_post', function($post_id) {
  if (get_post_status($post_id) !== 'publish') return;
  if (get_post_thumbnail_id($post_id)) return; // already has one

  $title = get_the_title($post_id);

  $response = wp_remote_post('https://api.thumbapi.dev/v1/generate', [
    'headers' => [
      'Authorization' => 'Bearer ' . THUMBAPI_KEY,
      'Content-Type'  => 'application/json',
    ],
    'body' => json_encode([
      'title'      => $title,
      'format'     => 'blogpost',
      'imageStyle' => 'faceless',
    ]),
  ]);

  $data = json_decode(wp_remote_retrieve_body($response), true);
  // Save $data['image'] as featured image...
});

Ghost

Use a Ghost webhook on post.published. Your webhook handler calls ThumbAPI with the post title, receives the image, and updates the post's feature image via the Ghost Admin API.

Headless CMS (Strapi, Sanity, Contentful)

Set up a webhook that fires on publish. Your handler calls ThumbAPI, uploads the image to the CMS media library, and links it to the post entry. Works with any headless CMS that supports webhooks.

// Express webhook handler for headless CMS
app.post('/webhooks/new-post', async (req, res) => {
  const { title, postId } = req.body;

  const response = await fetch('https://api.thumbapi.dev/v1/generate', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.THUMBAPI_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      title,
      format: 'blogpost',
      imageStyle: 'faceless',
    }),
  });

  const { image } = await response.json();

  // Save base64 image to S3, Cloudflare R2, or CMS media library
  // Update the post with the image URL

  res.sendStatus(200);
});

Static Site Generators

For static sites, generate cover images at build time so they're served as static files — no runtime API calls needed.

Next.js

Call ThumbAPI in generateStaticParams or a build script. Save images to public/covers/ and reference them in your page metadata. Each image is generated once at build time and served statically.

Astro

Write a build-time script that iterates your content collection, generates a cover for each post, and saves to public/covers/. Reference the images in your layout frontmatter.

Hugo / Jekyll

Run a pre-build script that reads post frontmatter, checks if a cover image already exists, and generates missing ones via the API. Only new posts trigger API calls — previously generated covers are cached.

# Python build script for static site generators
import os, json, base64, glob, requests

API_KEY = os.environ["THUMBAPI_KEY"]
COVERS_DIR = "public/covers"

# Read all post titles from markdown frontmatter
for md_file in glob.glob("content/posts/*.md"):
    slug = os.path.basename(md_file).replace(".md", "")
    cover_path = f"{COVERS_DIR}/{slug}.webp"

    if os.path.exists(cover_path):
        continue  # Already generated

    # Extract title from frontmatter
    with open(md_file) as f:
        for line in f:
            if line.startswith("title:"):
                title = line.split(":", 1)[1].strip().strip('"')
                break

    # Generate cover image
    res = requests.post(
        "https://api.thumbapi.dev/v1/generate",
        headers={"Authorization": f"Bearer {API_KEY}"},
        json={"title": title, "format": "blogpost", "imageStyle": "faceless"},
    )

    image_b64 = res.json()["image"].split(",")[1]
    with open(cover_path, "wb") as f:
        f.write(base64.b64decode(image_b64))

    print(f"Generated cover for: {title}")

Pricing

PlanGenerations / monthPrice
Free3$0
Starter60$12/month
Pro300$29/month
BusinessUnlimited$150/month

A blog publishing 10 posts per week needs about 40 cover images per month — the Starter plan covers that. For teams publishing at higher volume, the Pro plan handles 300. See full pricing details.

FAQ

What size are blog cover images?

1200x630 pixels — the standard for featured images and Open Graph images. Set format: "blogpost" in your API request.

Can the same image work as both featured image and og:image?

Yes. 1200x630 is the correct size for both your blog header and social sharing previews. Generate once, use everywhere.

What if I update the post title?

Make another API call with the new title to regenerate the cover. For CMS integrations, hook into the update event to automatically regenerate when the title changes.

Should I generate at build time or on publish?

For static sites: build time. For CMS-driven sites: on publish via webhook. Either way, generate once and cache. Don't generate per visitor request.

Can I add my company logo to blog covers?

Yes. Set imageStyle: "with-logo" and include your logo as base64 in the personImage field. Every cover will have your brand consistently applied.

Does ThumbAPI host the images?

No. The API returns base64 in the response. You save images to your own hosting — static files, S3, Cloudflare R2, or your CMS media library. Full control over caching and delivery.

Every blog post deserves a unique cover image — generate them automatically

Join Waitlist