API Reference
Full API endpoint documentation with error codes and rate limits.
The RendShot REST API. Render HTML to images and capture URL screenshots with a single HTTP call.
Overview
Base URL: https://api.rendshot.ai
All requests are authenticated with a Bearer token in the Authorization header:
curl https://api.rendshot.ai/v1/usage \
-H "Authorization: Bearer rs_live_YOUR_KEY"Endpoints
| Method | Path | Description |
|---|---|---|
POST | /v1/image | Render HTML/CSS or a template to an image |
POST | /v1/screenshot | Screenshot a URL |
POST | /v1/ai-render | Generate an image from a natural-language prompt (AI Render guide) |
GET | /v1/templates | List published templates |
POST | /v1/templates | Create a draft template owned by the API key holder |
GET | /v1/templates/:id | Get template details and variables |
GET | /v1/usage | Get current usage and plan limits |
GET | /v1/image/:id | Get image metadata |
Interactive Documentation
Explore all endpoints, try requests, and see response schemas in the interactive API reference:
Authentication
Create an API key in the Dashboard. Keys use the format rs_live_... and are hashed (SHA-256) before storage. Keep your key secret -- it cannot be retrieved after creation.
Authorization: Bearer rs_live_YOUR_KEYRate Limits & Plans
| Plan | Rate Limit | Monthly Quota | Retention |
|---|---|---|---|
| Free | 10 req/min | 100 | 7 days |
| Pro | 100 req/min | 10,000 | 30 days |
Maximum image dimensions: 4096 x 4096 for all plans.
Error Codes
All errors return a JSON body with { error: { code, message, status } }.
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid API key |
VALIDATION_ERROR | 400 | Request body failed schema validation |
INVALID_JSON | 400 | Request body is not valid JSON |
RATE_LIMIT_EXCEEDED | 429 | Too many requests per minute |
QUOTA_EXCEEDED | 429 | Monthly usage limit reached |
NOT_FOUND | 404 | Resource not found |
IMAGE_EXPIRED | 410 | Image has been deleted after retention period |
SERVICE_BUSY | 503 | Render queue is full, retry later |
INVALID_HTML | 400 | HTML content could not be parsed |
INVALID_OPTIONS | 400 | Render options are invalid |
PIXEL_BUDGET_EXCEEDED | 400 | Requested dimensions exceed pixel budget |
SSRF_BLOCKED | 400 | URL resolves to a private/internal address |
INVALID_URL | 400 | URL is malformed or uses a disallowed protocol |
RENDER_TIMEOUT | 408 | Render did not complete within the timeout |
BAD_REQUEST | 400 | Generic bad request |
PAYLOAD_TOO_LARGE | 413 | Request body exceeds size limit |
INTERNAL_ERROR | 500 | Unexpected server error |
AI_TIMEOUT | 502 | AI Render generation did not finish within the timeout |
AI_NO_TOOL_CALL | 502 | AI did not emit a template tool call — usually transient, retry |
AI_INVALID_OUTPUT | 502 | AI produced malformed HTML or variables |
AI_GATEWAY_ERROR | 500 / 502 | AI Gateway is unavailable or not configured |
AI Render Endpoint
POST /v1/ai-render turns a prompt into an image. Optionally pass template_id to use an existing template as a visual style reference. The response includes the rendered image plus the AI-generated html and variables, which you can persist via POST /v1/templates for reuse.
See the full AI Render guide for modes, examples, and the generate → save → reuse loop.
curl -X POST https://api.rendshot.ai/v1/ai-render \
-H "Authorization: Bearer rs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Minimal product card for a premium coffee",
"platform": "xiaohongshu",
"locale": "en"
}'| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Natural language description, 1--2000 chars |
platform | string | No | Preset (xiaohongshu, instagram_post, twitter_card, og_image, …) — sets default dimensions |
template_id | string | No | Existing tpl_... ID to use as a visual style reference |
width, height | number | No | Override preset dimensions, 1--4096 |
format | 'png' | 'jpg' | No | Output format |
quality | number | No | JPEG quality, 1--100 |
deviceScale | 1 | 2 | 3 | No | Device pixel ratio |
fonts | string[] | No | Google Fonts to load |
locale | 'zh' | 'en' | No | Language of AI-generated text |
timeout | number | No | AI + render timeout, 1000--55000 ms |
The POST /v1/ai-render call counts as one request against your monthly quota — the same as a regular render. No separate AI surcharge.
Create Template Endpoint
POST /v1/templates creates a new template owned by the authenticated API key holder. Templates are always created as private drafts — publish them through the web dashboard if you want them to appear in the public gallery. This endpoint does not consume render quota.
curl -X POST https://api.rendshot.ai/v1/templates \
-H "Authorization: Bearer rs_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Launch Card",
"html": "<div class=\"card\"><h1>{{title}}</h1></div>",
"variables": [
{ "key": "title", "type": "text", "label": "Title", "default": "Hello" }
],
"platform": "twitter_card"
}'| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name, 1--100 chars |
html | string | Yes | HTML body with {{variable}} placeholders, up to 100 KB |
variables | array | Yes | Variable definitions (max 50) |
description | string | No | Human description, up to 5 KB |
platform | string | No | Platform preset, defaults to custom |
category | string | No | Category slug |
tags | string[] | No | Up to 10 tags |
width, height | number | No | Override preset dimensions |
css | string | No | Extra CSS, up to 100 KB |
fonts | string[] | No | Google Fonts to load |
visibility | 'public' | 'private' | No | Defaults to private |
Each variable in variables has this shape:
{
"key": "title",
"type": "text", // text | image | color | number | select
"label": "Title",
"default": "Hello",
"required": false,
"maxLength": 100, // text only
"min": 0, // number only
"max": 1000, // number only
"options": ["A", "B"] // select only
}Response:
{
"id": "tpl_abc123",
"name": "Launch Card",
"status": "draft",
"visibility": "private",
"platform": "twitter_card",
"width": 1200,
"height": 628,
"createdAt": "2026-04-10T12:00:00Z"
}Next Steps
- Quickstart -- Get your first image in 5 minutes
- JavaScript SDK -- Typed client for Node.js and browsers
- Python SDK -- Official Python client
- CLI -- Command-line rendering tool
- MCP Server -- Integrate with Claude and AI assistants