# html2ogimage: Convert HTML to an Image

> html2ogimage (Convert HTML to an Image) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/html2ogimage, 5 credits per item. It works in Make, n8n, scripts and AI agents as a plain HTTP call.

Converts an HTML snippet (with Tailwind classes) into an image, e.g. an Open Graph image for social media.

- Group: Images
- Endpoint: `POST https://api.1001fx.com/images/html2ogimage`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 5 credits per item
- Ready-made in: none, use an HTTP request
- Docs: https://1001fx.com/functions/html2ogimage

## Parameters

- `html` (string, required) – HTML: HTML to render as an image. You can use tailwind classes provided in a tw tag in your elements. The following font families are supported: Alegreya, Barlow, Inter, Lato, Montserrat, OpenSans, Oswald, Poppins, PTSans, Raleway, Roboto
- `width` (number, required, min 1, max 10000) – Width: The image width.
- `height` (number, required, min 1, max 10000) – Height: The image height.
- `outputFormat` (enum, required, one of `png`, `jpeg`) – Output Format: The desired output format
- `defaultFont` (enum, optional, one of `Alegreya`, `Barlow`, `Inter`, `Lato`, `Montserrat`, `OpenSans`, `Oswald`, `Poppins`, `PTSans`, `Raleway`, `Roboto`) – Default Font: A default font that is injected at top level into your html. Can be overwritten by providing another font-family in a sub element.
