HTMLCSStoImage API via curl. Use this skill to generate images from HTML/CSS or capture screenshots of web pages.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Use the HTMLCSStoImage API via direct curl calls to generate images from HTML/CSS or capture screenshots of web pages.
Official docs:
https://docs.htmlcsstoimage.com/
Use this skill when you need to:
export HCTI_USER_ID="your-user-id"
export HCTI_API_KEY="your-api-key"
The API uses HTTP Basic Authentication:
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples below assume you have HCTI_USER_ID and HCTI_API_KEY set.
The base URL for the API is:
https://hcti.io/v1/imageGenerate an image from basic HTML:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" -d '"'"'html=<div style="padding:20px;background:blue;color:white;font-size:24px;">Hello World</div>'"'"'' | jq .
Response:
{
"url": "https://hcti.io/v1/image/abc123..."
}
The returned URL is permanent and served via Cloudflare CDN.
Generate a styled card image:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'html=<div class="card"><h1>Welcome</h1><p>This is a styled card</p></div>'"'"' --data-urlencode '"'"'css=.card { padding: 40px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; color: white; font-family: sans-serif; text-align: center; } h1 { margin: 0 0 10px 0; } p { margin: 0; opacity: 0.9; }'"'"'' | jq .
Generate an image with custom fonts:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'html=<div class="title">Beautiful Typography</div>'"'"' --data-urlencode '"'"'css=.title { font-family: Playfair Display; font-size: 48px; padding: 40px; background: #1a1a2e; color: #eee; }'"'"' -d '"'"'google_fonts=Playfair Display'"'"'' | jq .
Multiple fonts: google_fonts=Playfair Display|Roboto|Open Sans
Capture a screenshot of any public URL:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"'' | jq .
Wait for JavaScript to render before capturing:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"' -d '"'"'ms_delay=1500'"'"'' | jq .
ms_delay waits specified milliseconds before taking the screenshot.
Screenshot only a specific element on the page:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"' -d '"'"'selector=h1'"'"'' | jq .
Use any CSS selector: #id, .class, div > p, etc.
Generate 2x or 3x resolution images:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" -d '"'"'html=<div style="padding:20px;font-size:18px;">High Resolution Image</div>'"'"' -d '"'"'device_scale=2'"'"'' | jq .
device_scale accepts values 1-3 (default: 1).
Set specific viewport dimensions:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"' -d '"'"'viewport_width=1200'"'"' -d '"'"'viewport_height=630'"'"'' | jq .
Perfect for generating OG images (1200x630).
Capture the entire page height:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"' -d '"'"'full_screen=true'"'"'' | jq .
Automatically hide consent/cookie popups:
bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" --data-urlencode '"'"'url=https://example.com'"'"' -d '"'"'block_consent_banners=true'"'"'' | jq .
Add ?dl=1 to the image URL to trigger download:
IMAGE_URL="$(bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" -d '"'"'html=<div style="padding:20px;background:green;color:white;">Download Me</div>'"'"'' | jq -r '.url')"
curl -s "${IMAGE_URL}?dl=1" --output image.png
Add width/height query parameters to resize:
IMAGE_URL="$(bash -c 'curl -s "https://hcti.io/v1/image" -X POST -u "${HCTI_USER_ID}:${HCTI_API_KEY}" -d '"'"'html=<div style="padding:40px;background:purple;color:white;font-size:32px;">Resizable</div>'"'"'' | jq -r '.url')"
echo "Original: ${IMAGE_URL}"
echo "Thumbnail: ${IMAGE_URL}?width=200&height=200"
Success (200):
{
"url": "https://hcti.io/v1/image/be4c5118-fe19-462b-a49e-48cf72697a9d"
}
Error (400):
{
"error": "Bad Request",
"statusCode": 400,
"message": "HTML is Required"
}
--data-urlencode for HTML/CSS: Properly encodes special charactersms_delay for JS-heavy pages: Give time for JavaScript to renderdevice_scale: 2x for retina displays, 1x for standard