OG Documentation

OG Worker Docs

Everything you need to generate, serve, and manage Open Graph assets.

Back to home

Introduction

OG Worker Docs covers everything needed to generate, serve, and manage Open Graph assets.

Authentication

All public API requests require a valid API key. Pass it in the Authorization header.

API keys are issued only at /signup . There is no self-serve UI or endpoint to rotate or revoke keys, and no promotion flow yet.

HEADER
Authorization: Bearer <your-api-key>

Keys are visible only once at creation. There is currently no self-serve UI to rotate keys.

Quickstart

01

Create Account

Create an account at /signup to get your one-time API key.

02

Upload Images

Upload any images to the Worker and keep the returned R2 key.

03

Generate Render

POST your template payload to generate a render.

04

Serve Image

GET the serve URL to stream the final image.


POST

/api/v1/og

Generate an image by providing a template_id and input . If you include any images, use *_key fields only.

BASH
curl -X POST https://ogmi.dev/api/v1/og \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "template_id": "classic-headline",
    "input": {
      "title": "Launch day is here"
    },
    "cache": true
  }'

Body Parameters

Field Type Description
template_id string The ID of the layout you want to use.
input object Key-value pairs for text replacements in the template.
size string Optional output size preset.
quality number Optional quality value for the output format.
cache boolean If true, returns a cached asset hash for faster loads.

Optional fields: size, quality, cache.

GET

/asset/:hash

Serve a render using the stable URL returned by the generate response. PNG only; the .png extension is optional.

curl -L https://ogmi.dev/asset/<render-id>
POST

/api/v1/assets

Upload assets via multipart requests. The response includes the R2 key to use in your template payload.
Note: Remote URLs are rejected. Upload files to the Worker first.

curl -X POST https://ogmi.dev/api/v1/assets \
  -H "Authorization: Bearer <your-api-key>" \
  -F "file=@/path/to/logo.png"

Rules

  • Remote URLs are rejected.
  • Upload files to the Worker first.
  • Use the returned *_key values in payloads.

Formats

Output format: png only.

Status

UI at / - API at /api/*.