Official CLI + MCP server · in Anthropic's MCP Registry

Pixel-perfect images,
from any code.

HTML, CSS, or code snippets in – PNG, JPG, or WebP out. The only render API with an official CLI on npm and an MCP server in Anthropic's registry. Free tier 50/mo, paid from $7/mo.

Sandbox: 50 renders/month, watermarked, max 800×800. For testing API integration only. No credit card.
120
renders served
Live
API operational
3
CLI · MCP · REST
Why codetoimage

Built for the agent era.

REST API + CLI + MCP

Three interfaces, one engine. Drop into curl, Node, Python, n8n, Cursor, Claude Desktop.

Pixel-perfect rendering

Real headless Chromium with full CSS3 support – web fonts, gradients, animations frozen at any frame.

Sub-second response

Always-hot renderer (no cold starts). Median 600ms for typical 1200×630 OG images.

Built for agents

First-class MCP server. Add to Claude Desktop in 60 seconds. Your AI agent renders images autonomously.

Use cases

What people build with it.

Pricing

Simple. Pay for what you use.

1 render = 1 credit. Test for free with Sandbox (50/mo, watermarked). Upgrade for clean output, larger sizes, all formats. All plans: monthly or yearly (save 17%).

FOR TESTING
Sandbox
$0/mo
50 renders/month
  • ⚠ Watermark on output
  • ⚠ Max 800×800
  • ⚠ PNG only
  • ✓ API + CLI + MCP
  • ✓ Test integration
Try Sandbox
Hobby
$19/mo
3,000 renders/month
  • ✓ Clean output (no watermark)
  • ✓ Up to 2048×2048
  • ✓ PNG / JPEG / WebP
  • ✓ API + CLI + MCP
  • Email support
Get Hobby
RECOMMENDED
Pro
$59/mo
15,000 renders/month
  • ✓ Clean output (no watermark)
  • ✓ Up to 2048×2048
  • ✓ PNG / JPEG / WebP
  • ✓ API + CLI + MCP
  • Priority support
  • ✓ Webhook outbound
Get Pro
Scale
$149/mo
50,000 renders/month
  • ✓ Clean output (no watermark)
  • ✓ Up to 2048×2048
  • ✓ PNG / JPEG / WebP
  • ✓ API + CLI + MCP
  • Priority support
  • ✓ Webhook outbound
  • ✓ Team seats + white-label
Get Scale
Quickstart

One curl. Done.

curl -X POST https://api.codetoimage.app/v1/render \
  -H "X-API-Key: $CTI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Hello, codetoimage</h1>",
    "css": "h1 { color: #6366f1; font: 700 64px/1 sans-serif; padding: 80px }",
    "width": 1200,
    "height": 630,
    "format": "png"
  }' \
  -o output.png

Need a hosted image URL?

Add "output": "url" and get a temporary public link instead of binary – for tools that fetch by URL, like the Instagram Graph API, Slack unfurls, or OpenGraph images.

curl -X POST https://api.codetoimage.app/v1/render \
  -H "X-API-Key: $CTI_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "html": "<h1>Hello</h1>", "output": "url" }'

# → {
#     "url": "https://img.codetoimage.app/r/9f3c…b1.png",
#     "expires_at": "2026-05-28T12:00:00.000Z",
#     "format": "png",
#     "credits_remaining": 9876
#   }

Prefer your terminal?

The official CLI wraps the API with a one-liner install. Render local HTML files, pipe stdin, or get hosted URLs from any shell.

# install
npm i -g @codetoimage/cli

# authenticate (paste an API key from /dashboard/keys)
cti login

# render an HTML file → PNG
cti render hello.html -o hello.png

# inline HTML → JPEG at 1200×630
cti render --html '<h1>Hi</h1>' -f jpeg -w 1200 -h 630 -o og.jpg

# return a hosted URL instead of bytes
cti render hello.html --url
Listed in the official MCP Registry

Plug into Claude, Cursor, or any MCP client.

The official MCP server gives your AI agent two tools – render_html_to_image (inline image) and render_html_to_url (24h hosted URL). No install – your client runs it via npx.

// claude_desktop_config.json
{
  "mcpServers": {
    "codetoimage": {
      "command": "npx",
      "args": ["-y", "@codetoimage/mcp-server"],
      "env": { "CODETOIMAGE_API_KEY": "cti_live_..." }
    }
  }
}