Connect your AI agent through MCP, or convert HTML and URLs with the REST API.
Recommended for AI agents
Copy a setup prompt for your client. PixelToPdf exposes PDF and screenshot tools at /mcp.
Prompts never contain your key. Configure it privately in your client, never in agent chat or source control.
All API requests require authentication using an API key. Include your key in the X-API-Key header. MCP clients send the same key as an Authorization: Bearer token.
X-API-Key: sk_your_api_key/convert/pdf/convert/png/convert/jpeg/convert/webp/logs| Parameter | Type | Description |
|---|---|---|
source* | string | URL or raw HTML content (required) |
format | string | Page format: A4, Letter, Legal, etc. |
landscape | boolean | Use landscape orientation |
use_print | boolean | Use print media styles |
margin | object | Page margins: {top, right, bottom, left} |
header | object | Header HTML: {source, height} |
footer | object | Footer HTML: {source, height} |
css | string | Custom CSS to inject |
javascript | string | Custom JavaScript to inject |
delay | number | Delay before rendering (ms) |
timeout | number | Max rendering time (seconds) |
wait_for_network | boolean | Wait for network activity to become idle |
lazy_load_images | boolean | Scroll the page to load deferred images |
disable_javascript | boolean | Disable page JavaScript execution |
pages | string | PDF page ranges, for example 1-5 |
zoom | number | PDF scale from 0.1 to 2 |
filename | string | Filename in the response Content-Disposition header |
sandbox | boolean | Sandbox mode (no credits used) |
encode | boolean | Return base64 instead of binary |
curl -X POST https://api.pixeltopdf.com/convert/pdf \
-H "X-API-Key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"source": "https://example.com"}' \
--output document.pdfRate limits depend on your plan:
| Code | Description |
|---|---|
400 | Bad request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
402 | Payment required - No credits remaining |
429 | Too many requests - Rate limit exceeded |
500 | Internal server error - Please retry |
Try a conversion interactively or follow a production pattern for your framework and document type.