Skip to content

v0.6.0 — Batch Generation API

Latest

Choose a tag to compare

@2214962083 2214962083 released this 12 Feb 02:18
· 2 commits to main since this release

What's New

Batch OG Image Generation (POST /v1/og/batch)

Generate up to 20 OG images in a single API call. Perfect for:

  • Static site generators that need OG images for every page
  • CMS systems generating images for all blog posts
  • CI/CD pipelines creating images at build time

Request

{
  "images": [
    { "id": "hero", "title": "My Product", "template": "product" },
    { "id": "blog-1", "title": "How to X", "template": "blog", "author": "Alice" }
  ],
  "defaults": {
    "format": "png",
    "width": 1200,
    "height": 630,
    "domain": "example.com"
  }
}

Response

{
  "results": [
    { "id": "hero", "success": true, "data": "data:image/png;base64,..." },
    { "id": "blog-1", "success": true, "data": "data:image/png;base64,..." }
  ],
  "summary": { "total": 2, "succeeded": 2, "failed": 0, "totalMs": 85 }
}

Key Features

  • Defaults merging — Set shared params once, override per image
  • Parallel rendering — All images render concurrently via Promise.allSettled
  • Partial failure handling — One failed image doesn't kill the batch
  • Quota pre-check — Validates you have enough quota before rendering
  • Efficient billing — Only successful renders count toward usage

Full Changelog

  • POST /v1/og/batch — New batch generation endpoint
  • recordBatchUsage() — Single-query batch usage recording
  • Batch types: BatchRequest, BatchResult, BatchResponse

Try it live →