AGENTUTIL
DocsTools Reference

Browser PDF

$0.01per call
browser.pdf

Render a webpage or HTML content to PDF

Endpoint
POST /v1/tools/browser.pdf/tasks

Input

FieldTypeRequiredDescription
urlstringnoURL to render
htmlstringnoHTML content to render
sizestringno
landscapebooleanno
marginsstringnoPage margins (CSS format)
backgroundbooleannoInclude backgrounds
waitstringno

Output

FieldTypeDescription
file_idstringStored artifact ID
file_urlstring24-hour signed URL for the rendered PDF
content_typestringArtifact MIME type
file_url_notesstringNotes about the signed URL lifetime
expires_atstringSigned URL expiry timestamp
expires_in_daysintegerSigned URL expiry in days
pagesinteger
bytesinteger

Example

Request
{
  "url": "https://example.com",
  "size": "a4"
}
Response
{
  "file_id": "file_abc123def4567890",
  "file_url": "https://1234567890abcdef.r2.cloudflarestorage.com/agentutil/browser/123/pdf-file_abc123def4567890.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=86400&X-Amz-Signature=...",
  "content_type": "application/pdf",
  "file_url_notes": "Signed URL will expire in 24 hours. If you need it for longer then download it and store it somewhere",
  "expires_at": "2026-03-12T08:00:00.000Z",
  "expires_in_days": 1,
  "pages": 3,
  "bytes": 234567
}