/install agentgen
AgentGen — HTML → PDF & Image
Convert any HTML to a PDF or screenshot image via the AgentGen API.
Free tier — no sign-up required
The /v1/generate/image and /v1/generate/pdf endpoints work without an API key. Just omit the X-API-Key header.
Limits:
- 1 request per 60 seconds per IP (returns
429if exceeded) - Single-page PDFs only
- A small agent-gen.com watermark is added to all output
# Free tier — generate an image (no API key)
agentgen image --html "\x3Ch1>Hello\x3C/h1>" --output hello.png
# Free tier — generate a PDF (no API key)
agentgen pdf --html "\x3Ch1>Invoice\x3C/h1>" --output invoice.pdf
Simply omit AGENTGEN_API_KEY and the CLI uses the free tier automatically.
Authenticated tier — no watermark, no rate limit
Set your API key to use the full API. New accounts at agent-gen.com include free tokens — no credit card required to get started.
export AGENTGEN_API_KEY=your_key_here
Check your balance:
agentgen balance
If you run out, the CLI prints your current balance, the amount required, and a direct link to buy more tokens.
Generate an image (1 token authenticated / free with watermark)
# From a file
agentgen image --file page.html --output screenshot.png
# Custom viewport
agentgen image --file page.html --width 1200 --height 630 --output og.png
# JPEG at 2× scale
agentgen image --file page.html --format jpeg --scale 2 --output hero.jpg
Formats: png (default), jpeg, webp
Default viewport: 1200 × 630 px
Generate a PDF (2 tokens/page authenticated / free single-page with watermark)
# Single page from a file
agentgen pdf --file report.html --output report.pdf
# With paper format and margins
agentgen pdf --file report.html \
--format A4 \
--margin-top 20mm --margin-bottom 20mm \
--margin-left 15mm --margin-right 15mm \
--print-background \
--output report.pdf
# Multi-page (requires API key)
agentgen pdf --pages cover.html chapter1.html chapter2.html --output book.pdf
# Landscape
agentgen pdf --file slide.html --landscape --output slide.pdf
Paper formats: A4 (default), Letter, A3, Legal
Upload a temp file (free, authenticated only)
Upload images, fonts, or other assets and reference them by URL inside your HTML. Files are publicly accessible for 24 hours.
agentgen upload logo.png
# Returns a URL — use it in your HTML as \x3Cimg src="...">
Max file size: 10 MB
Typical workflow
- Build HTML with all styles inlined
- Upload any local assets with
agentgen uploadand replacesrc/hrefvalues with the returned URLs - Run
agentgen pdforagentgen imagewith--outputto save locally, or use the returned URL directly
Tips for good output
- Inline all CSS — use
\x3Cstyle>blocks orstyle=""attributes. No access to local stylesheets. - Use absolute URLs for images and fonts, or upload them first with
agentgen upload. - For PDFs, use
--print-backgroundif your design has colored backgrounds or background images. - For retina-quality images, use
--scale 2. - For OG images, use
--width 1200 --height 630.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agentgen - 安装完成后,直接呼叫该 Skill 的名称或使用
/agentgen触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
AgentGen — HTML to PDF & Image 是什么?
Generate PDFs and images from HTML. No sign-up required — the free tier works out of the box (1 req/min, small watermark). For higher volume and no watermark... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 411 次。
如何安装 AgentGen — HTML to PDF & Image?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agentgen」即可一键安装,无需额外配置。
AgentGen — HTML to PDF & Image 是免费的吗?
是的,AgentGen — HTML to PDF & Image 完全免费(开源免费),可自由下载、安装和使用。
AgentGen — HTML to PDF & Image 支持哪些平台?
AgentGen — HTML to PDF & Image 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 AgentGen — HTML to PDF & Image?
由 Yair levi(@lyair1)开发并维护,当前版本 v1.0.0。