Frequently Asked Questions
Everything you need to know about AgentGen.
What is AgentGen?
AgentGen is an HTML-to-PDF and HTML-to-Image API built for AI agents and developers. You send an HTML string via HTTP and get back a CDN download link for a PDF document or PNG/JPEG/WebP image rendered by headless Chrome. Token-based pricing — no subscription required.
How do AI agents use this API?
You register the AgentGen API call as a "tool" in your agent framework — LangChain StructuredTool, OpenAI function definition, AutoGen function, or CrewAI BaseTool. When the LLM decides to produce a document, it calls the tool with an HTML string and receives a download URL to return to the user.
What is token pricing?
Instead of paying a monthly subscription, you buy a one-time pack of tokens and spend them as you generate. 1 token = 1 image. 2 tokens = 1 PDF page. Temp file uploads are free. Tokens never expire, so unused balance carries over indefinitely.
Is there a free plan?
Every new account gets 50 free tokens instantly — no credit card required. That's 50 image generations or 25 PDF pages. Buy a token pack when you need more.
What output formats are supported?
PDFs: A4, Letter, A3, Legal — portrait and landscape. Images: PNG, JPEG, WebP at any viewport size up to 5000×5000 pixels. Temporary file uploads accept PNG, JPEG, WebP, GIF, and SVG.
How long are generated files stored?
Generated PDFs and images are stored on Cloudflare R2 and served via CDN for 30 days. Temporary uploaded files expire after 24 hours. After expiry, the CDN URLs stop resolving.
Does it work with LangChain?
Yes. Define AgentGen as a StructuredTool with a Pydantic schema, attach it to any LangChain agent (ReAct or tool-calling), and your agent can produce PDFs and images on demand. See the LangChain integration guide for working code.
Does it work with OpenAI function calling?
Yes. Define the API call as an OpenAI tool schema (type: "function"), implement a handler that calls AgentGen, and add it to your GPT-4o chat loop. Works with both the Chat Completions API and the Assistants API.
Does it work with Microsoft AutoGen?
Yes. Register generate_pdf and generate_image as functions in your AssistantAgent's llm_config, map them in the UserProxyAgent's function_map, and any AutoGen agent can call them. See the AutoGen integration guide.
What rendering engine is used?
AgentGen uses headless Chromium — the same engine that powers Google Chrome. It supports all modern HTML5, CSS3, Flexbox, CSS Grid, CSS variables, Google Fonts loaded via @import, and SVG. Output is pixel-identical to what you'd see in a Chrome browser.
Are there any HTML requirements?
Your HTML should be self-contained — inline all styles using the style attribute or a <style> tag inside <head>. External CSS files and local file paths won't load in the rendering environment. Google Fonts via a <link> tag work fine.
How does authentication work?
Pass your API key in the X-API-Key request header on every API call. You can create multiple API keys from the dashboard — useful for separating keys by project or environment.
How many API keys can I have?
Starter pack: 1 API key. Growth pack: 5 API keys. Scale pack: unlimited API keys. All keys on the same account share the same token balance.
What are temp file uploads for?
Temp uploads let you host an image or file on AgentGen's CDN for 24 hours and use the resulting URL inside your HTML template — for example, a company logo or a user's profile photo. Uploads are free (no tokens).
How fast is the API?
A typical single-page PDF renders in 1–2 seconds. Images render in under 1 second. Response time depends on HTML complexity — pages with heavy CSS animations, many external fonts, or large embedded images may take slightly longer.
Is there an MCP server?
Yes. AgentGen exposes a Model Context Protocol (MCP) server at /api/mcp. Add it to your Claude Code settings or Claude.ai project to give Claude direct access to generate_pdf and generate_image tools without writing any wrapper code.
Is my HTML content stored?
Your HTML input is processed ephemerally and never stored. Only the rendered output (PDF or image) is stored on CDN for 30 days. We do not train on or log your HTML content.
What is the refund policy?
If you experience a technical issue on our side that prevents generation, we will refund the tokens used. Tokens are non-refundable for successfully completed generations. Contact us at the email in your account if you have a concern.
Still have questions?
Check the API docs or create a free account and test it yourself.
Get 50 free tokens →