Image Generation

Image Automation API

Generate OG images, social media cards, and announcement banners from a template and a data payload. Sub-second rendering via headless Chrome. Every image is uploaded to the CDN and returned as a permanent URL.

Requires a paid plan. Get your API key at 1frx.com/dashboard.html

How it works

Request

Endpoint: POST /api/image

Requires: X-1FRX-Key header

Parameters

Parameter Type Description
template string, required "og-card", "social-square", "twitter-card", "announcement", or "custom"
data object, required Template variables — see data fields below
html string Raw HTML string — only when template is "custom"
format string, optional "png" (default), "jpeg", "webp"
quality number, optional 1–100 for jpeg/webp (default: 92)
width number, optional Override template default width
height number, optional Override template default height

Example request

curl -X POST https://api.1frx.com/v1/image \
  -H "X-1FRX-Key: sk_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "og-card",
    "data": {
      "title": "The Future of AI Automation",
      "subtitle": "How 1FRX is changing the way teams build.",
      "brand_color": "#5ee3ff",
      "tag": "PLATFORM"
    },
    "format": "png"
  }'

Response

{
  "success": true,
  "url": "https://assets.1frx.com/images/a3f9b2c1.png",
  "template": "og-card",
  "width": 1200,
  "height": 630,
  "format": "png",
  "size_bytes": 284190
}

Built-in templates

Name Dimensions Best for Data fields
og-card 1200×630 Blog posts, link previews title, subtitle, brand_color, logo_url, tag, background
social-square 1080×1080 Instagram, LinkedIn title, subtitle, brand_color, logo_url, cta, background
twitter-card 800×418 Twitter/X cards title, subtitle, brand_color, logo_url, domain
announcement 1200×400 Product launches, events title, subtitle, brand_color, logo_url, tag, cta

Data fields reference

Field Type Description
title string Main headline text
subtitle string Supporting text / description
brand_color string Hex colour e.g. "#5ee3ff" — controls accent elements
logo_url string URL of your logo PNG/SVG — displayed in header
tag string Small label above the title e.g. "NEW" or "PLATFORM"
cta string Call-to-action button text e.g. "Learn more"
background string "dark" (default), "light", or "gradient"
domain string Domain shown on twitter-card e.g. "1frx.com"

Custom HTML

When template is "custom", provide your own HTML string. The viewport will default to 1200×630 unless overridden with width/height. Your HTML is rendered as-is in headless Chrome — you can use Google Fonts, inline CSS, and any HTML5 features.

Example custom request

{
  "template": "custom",
  "html": "......",
  "width": 1200,
  "height": 630,
  "format": "png"
}