Quick Start#

Three steps to your first dynamic OG image.

1. Mint a signed URL#

Call POST /v1/url with your API key, a template ID, and any variables your template expects.

curl -X POST https://api.htmlpix.com/v1/url \
  -H "Authorization: Bearer hpx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "k57k8w9n7n9r8b6r2x6f2q9v1h7p4y0c",
    "variables": {
      "title": "Launch Day",
      "subtitle": "OG image generated by HTMLPix"
    }
  }'

You get back a signed URL and its expiry:

{
  "url": "https://image.htmlpix.com/v1/image?templateId=...&sig=...",
  "expiresAt": 1914998400000
}

This request consumes 1 quota unit. The returned URL can be fetched unlimited times for free.

2. Use it in your meta tags#

Drop the URL into your page's OG and Twitter meta tags:

<meta property="og:image" content="https://image.htmlpix.com/v1/image?..." />
<meta name="twitter:image" content="https://image.htmlpix.com/v1/image?..." />

When a social platform crawls your page, it fetches the image from our CDN — no rendering delay.

3. Keep your API key private#

Always mint URLs from your backend or server actions. Never call the API from client-side code. The signed URL itself is safe to expose publicly.

Next steps#