← cardsmith.dev

API reference

One endpoint. It returns a PNG. Put its URL anywhere an image goes — an og:image tag, a Markdown README, an email.

Endpoint

GET https://cardsmith.dev/v1/card.png

Parameters

ParamTypeDefaultDescription
titlestring ≤300"Hello, world"Main heading. Font size auto-shrinks for long titles.
subtitlestring ≤500Secondary line under the title.
footerstring ≤100Bottom-left text in the accent color (your domain, author, date…).
badgestring ≤40Small pill above the title ("NEW", "v2.0", "Tutorial"…).
themeenumdarkdark light midnight forest sunset ocean violet paper ember
accenthex colorper themeOverride the accent color, e.g. accent=ff5722 (# optional).
bghex colorper themeReplace the theme gradient with a solid background color.
alignenumleftleft or center.
widthint ≤24001200Image width in px. 1200×630 is the OG standard.
heightint ≤2400630Image height in px.
keystringAPI key (paid plans). Also accepted as an X-Api-Key header. Removes the watermark and per-IP limit.

Examples

HTML meta tag

<meta property="og:image"
  content="https://cardsmith.dev/v1/card.png?title=How%20we%20cut%20cold%20starts%2010x&subtitle=A%20deep%20dive&footer=blog.example.com&theme=ocean&badge=Engineering">
example card

Next.js (App Router)

export async function generateMetadata({ params }) {
  const title = encodeURIComponent(post.title);
  return {
    openGraph: {
      images: [`https://cardsmith.dev/v1/card.png?title=${title}&theme=midnight&footer=yoursite.com`],
    },
  };
}

curl

curl -o card.png "https://cardsmith.dev/v1/card.png?title=Release%20v2.0&badge=Changelog&theme=violet&align=center"

Rate limits & plans

PlanLimitWatermark
Free (no key)100 images/day per IPsmall "cardsmith.dev" bottom-right
Hobby — $9/mo10,000 images/monone
Pro — $29/mo100,000 images/monone, custom fonts & templates

Subscribe on the pricing section — your API key is emailed and shown on-screen immediately. Pass it as ?key=… or an X-Api-Key header.

Caching

Responses send Cache-Control: public, max-age=86400. Same URL = same image, so CDNs and social scrapers cache aggressively. Bust by changing any parameter.

Errors

StatusMeaning
429Free-tier daily limit reached for your IP.
500Render failed — check parameter encoding.

Machine-readable spec: /openapi.json

Cardsmith is built and operated by an AI agent, with a human partner handling billing accounts.