HTML to Image connects to a Nagent workspace with an API key. Once it is connected, agents can call 3 HTML to Image actions: "Get HTML to Image", "Check HTML-to-Image Account Usage" and "Convert HTML to Image". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against HTML to Image, with input parameters and output schema.
HTML_TO_IMAGE_CHECK_USAGEAttempts to retrieve account usage statistics from the HTML-to-Image API by trying multiple common endpoint patterns. NOTE: The html2img.com API does not officially document a dedicated usage statistics endpoint. This action tries several plausible endpoint paths and returns empty usage data if none are found (when return_defaults_on_error=true). For actual usage tracking with html2img.com, monitor the 'credits_remaining' field returned in responses from the convert or screenshot endpoints. Returns hourly, daily, and monthly image creation counts if a usage endpoint exists, or empty statistics as a fallback.
Input parameters
Optional custom endpoint paths to try for usage statistics (e.g., \['/v1/usage', '/api/stats'\]). Supports both relative paths (e.g., '/v1/usage') and fully-qualified URLs (e.g., 'https://api.example.com/usage'). If not provided, the action tries built-in candidates: /v1/usage, /api/usage, /v1/account/usage, /api/account/usage.
If true (default), returns empty usage statistics when no endpoint is found or all endpoints fail. If false, raises an error with details about which endpoints were tried. Recommended to keep as true for graceful handling when the API provider doesn't support usage endpoints.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
HTML_TO_IMAGE_CONVERT_TO_IMAGETool to convert HTML content into an image. Returns either a downloadable file or a JSON payload containing id and url, depending on the upstream API behavior.
Input parameters
HTML content to render into an image
Width of the output image in pixels; must be >=1 Maximum enforced limit may apply; exceeding it can cause validation errors or silent downscaling.
Height of the output image in pixels; must be >=1 Maximum enforced limit may apply; exceeding it can cause validation errors or silent downscaling.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
HTML_TO_IMAGE_GET_IMAGERetrieve a previously generated image by its URL. Use this to fetch, resize, or download an existing HTML-to-image asset. The image URL is typically obtained from the 'url' field of the HTML_TO_IMAGE_CONVERT_TO_IMAGE response.
Input parameters
Set to 1 to serve the image as a downloadable attachment.
Optional DPI metadata for the image; maximum 600.
Optional output width in pixels; maximum 5000.
Optional output height in pixels; maximum 5000.
Full URL of the generated image (e.g., 'https://i.html2img.com/image-1234567890-123456.png'), typically obtained from the 'url' field of the HTML_TO_IMAGE_CONVERT_TO_IMAGE response. You may also provide just a partial path or append .png, .jpg, or .webp to select the format.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 3 HTML to Image actions on Nagent: "Get HTML to Image", "Check HTML-to-Image Account Usage" and "Convert HTML to Image". Get HTML to Image: Retrieve a previously generated image by its URL. Each action is listed on this page with its input parameters and its output.
HTML to Image connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Get HTML to Image takes 1 required input: image_id. It also takes 4 optional inputs: dl, dpi, width and height. It returns data, error and successful.