Social Card Generator API
POST /api/og/card $0.03 per call
USDC on Base · x402
Social card generator: POST {title, subtitle, domain, theme, accent} and receive a finished 1200x630 OpenGraph card — PNG (base64) plus the source SVG. Three themes (dark, light, midnight), custom accent color, automatic text wrapping. Pairs with /api/og/check: check the page, then generate the missing card.
Parameters
| Name | In | Description | |
|---|---|---|---|
title | body | required | Card headline (required, wraps to 3 lines, max 140 chars) |
subtitle | body | Smaller supporting line (optional) | |
domain | body | Shown bottom-left in accent color (optional) | |
theme | body | dark (default), light, or midnight | |
accent | body | Hex accent color override, e.g. #ff6b35 |
Example request
curl -X POST "https://api.webbersites.com/api/og/card" \
-H "Content-Type: application/json" \
-d '{"title":"Ship Faster With Agent-Native APIs","subtitle":"Pay-per-call data for autonomous software","domain":"x402.webbersites.com","theme":"dark"}'
# first call returns 402 + payment requirements; an x402 client pays and retries automaticallyExample response
{
"width": 1200,
"height": 630,
"theme": "dark",
"svg": "<svg …>",
"png_base64": "iVBORw0…",
"data_uri": "data:image/png;base64,…"
}MCP tool: post_og_card — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.
How payment works
There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.