# HTML to PDF in ChatGPT
Generate PDFs from HTML or URLs in ChatGPT. Connect the html-pdf.com MCP server in developer mode, then ask ChatGPT to make the PDF.
**Quick answer:** in ChatGPT developer mode, create an MCP app with the server URL `https://html-pdf.com/mcp` and OAuth authentication (or `https://html-pdf.com/mcp?api_key=hp_live_...` with no authentication). Then ask "Use html-pdf to make a PDF of https://example.com".
## Get an API key
You need a key before you connect. Request one by email at https://html-pdf.com/login, or create one with a single call:
```bash
curl -X POST https://html-pdf.com/v1/signup \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'
```
The key (`hp_live_...`) is shown once. Open the link we email you to confirm your address, which adds 100 free credits. 1 credit = 1 PDF page.
## Connect
This section adds html-pdf.com to ChatGPT as a custom MCP app. ChatGPT connects to custom MCP servers through **developer mode**, which runs on ChatGPT on the web. It is not available on the Free plan.
On Business, Enterprise and Edu workspaces, an admin has to allow developer mode and custom MCP apps first. OpenAI changes these menus often, so the labels you see may differ a little.
1. Turn on developer mode. On personal plans, open **Settings → Security and login** and switch on **Developer mode**. Some accounts already have it on and show **Create MCP app** directly.
2. Create a new MCP app (connector) and fill in:
- **Name:** `html-pdf`
- **MCP Server URL:**
```
https://html-pdf.com/mcp?api_key=hp_live_...
```
- **Authentication:** No authentication. The key in the URL authenticates you.
3. Check **I trust this application** and click **Create**.
4. In a new chat, enable the `html-pdf` app from the tools menu.
The URL contains your key, so treat it like a password.
## Try it
Once connected, you just ask in plain words. You don't write any code. For example:
- "Use html-pdf to turn this table into an A4 PDF report with a title and page numbers."
- "Create a PDF of https://example.com in landscape."
- "Draft a cover letter from my notes and give me the PDF download link."
ChatGPT may ask you to confirm before each tool call. The result includes a download link valid for 24 hours.
## Tips
These requests help you get cleaner PDFs and control cost.
- **Page breaks:** ask for "each section on a new page" (CSS `break-before: page`).
- **Page numbers:** ask for "page X of Y in the footer". The footer needs a margin to show.
- **Cap the size:** ask ChatGPT to set `max_pages`. If the PDF would be longer, the render fails and costs nothing.
- **Credits:** "How many html-pdf credits do I have?" calls `get_credits`. Purchased credits never expire.
## Troubleshooting
Most problems come from plan settings or the app not being enabled in the chat.
- **No developer mode or Create app option:** check your plan. On a workspace, ask an admin to allow custom MCP connectors.
- **Tools not called:** enable the app in the current chat and name it in your prompt ("use html-pdf").
- **403 email_not_confirmed:** the email behind the key isn't confirmed yet. Click the link we emailed you (it adds the 100 free credits), then try again.
- **402 insufficient_credits:** ask ChatGPT to call `buy_credits` for a Stripe payment link, or top up at https://html-pdf.com/login.
## FAQ
### Can ChatGPT create a PDF file?
Yes. With the html-pdf.com MCP app connected in developer mode, ChatGPT writes the HTML and returns a PDF download link valid for 24 hours.
### Does it work on the free ChatGPT plan?
No. Custom MCP apps need developer mode, which is not available on the Free plan. On Business, Enterprise and Edu workspaces an admin has to allow it first.
### Is html-pdf.com free to try?
Yes. A new account gets 100 free credits once you confirm your email, with no card needed. 1 credit = 1 PDF page, and failed renders cost nothing.
### What happens when I run out of credits?
Ask ChatGPT to call `buy_credits` and you get a Stripe payment link. Packs start at $10 for 1,000 credits, and purchased credits never expire.
Full reference: [API docs](https://html-pdf.com/docs) · [MCP server](https://html-pdf.com/mcp)