API Reference
One endpoint, infinite images.
Every PixelDrive plan uses the same REST API. Authenticate with a Bearer token, POST a template id plus your data, get a PNG URL back. Bulk, async, signed URLs, and an MCP server for AI agents are all here.
Base URLs
| Field | Type | Description |
|---|---|---|
| Render API | https://render.pixeldrive.pro/v1 | All authenticated render endpoints |
| Image CDN | https://render.pixeldrive.pro/img | Public image serving (no auth) |
| MCP | https://pixeldrive.pro/mcp | Model Context Protocol for AI agents |
Authorization: Bearer <token>Authentication
Create a token in your dashboard under API tokens. Send it on every request. The same token works for the REST API and the MCP server, and identifies which account is billed.
curl https://render.pixeldrive.pro/v1/render \
-H "Authorization: Bearer pdrv_your_token_here" \
-H "Content-Type: application/json" \
-d '{ ... }'A missing, revoked, or expired token returns 401.
/v1/renderRender a single image
Render one image synchronously. Results are cached by a content hash of the template + payload, so identical requests return instantly and cost nothing.
Request body
| Field | Type | Description |
|---|---|---|
| templateId | string (uuid) | The template to render. Required. |
| payload | object | Map of element id → value. See below. Required. |
| pixelRatio | number | Output scale. Default 1 (exact canvas size). Pass 2 for retina, 3 for hi-res. |
| preview | boolean | If true: ephemeral (~1h), not charged, not saved. For iteration. |
Payload value types
Each element id maps to one value object, depending on the element:
| Field | Type | Description |
|---|---|---|
| { "text": "…" } | string | Text, QR-code and barcode elements |
| { "src": "https://…" } | url | Image and SVG elements (full URL) |
| { "value": 4.5 } | number | Numeric fields (e.g. rating stars) |
Example
curl -X POST https://render.pixeldrive.pro/v1/render \
-H "Authorization: Bearer pdrv_..." \
-H "Content-Type: application/json" \
-d '{
"templateId": "ee3a339f-2826-406c-a6e4-04b9a7b4d373",
"payload": {
"headline": { "text": "500K followers" },
"avatar": { "src": "https://example.com/pic.jpg" }
},
"pixelRatio": 1
}'Response
{
"url": "https://render.pixeldrive.pro/img/t/<templateId>/<hash>.png",
"fromCache": false, // false | "redis" | "db"
"fieldsHash": "a1b2c3d4e5f6g7h8",
"renderMs": 620,
"uploadBytes": 254714,
"creditsRemaining": 9999
}/v1/render/batchBulk render (async)
Queue up to 1,000 renders against one template and get a batch id back immediately. Poll /v1/batches/:id or stream /stream for results. This is the right tool for generating hundreds of images — it never blocks a connection.
Request body
| Field | Type | Description |
|---|---|---|
| templateId | string (uuid) | Template to render against. |
| payloads | object[] | Array of 1–1000 payload objects (same shape as /v1/render). |
| userId | string (uuid) | Account to bill; must own the template. |
curl -X POST https://render.pixeldrive.pro/v1/render/batch \
-H "Authorization: Bearer pdrv_..." \
-H "Content-Type: application/json" \
-d '{
"templateId": "ee3a339f-...",
"payloads": [
{ "name": { "text": "Alice" } },
{ "name": { "text": "Bob" } }
],
"userId": "660e8400-..."
}'
// 202 Accepted
{ "batchId": "770e8400-...", "count": 2, "jobIds": ["…","…"] }/v1/batches/:idBatch status (polling)
Counts plus a per-job results array.
{
"batchId": "770e8400-...",
"total": 2, "queued": 0, "running": 1, "completed": 1, "failed": 0,
"results": [
{ "id": "…", "status": "completed",
"result": { "imageUrl": "https://render.pixeldrive.pro/img/…", "contentType": "image/png", "fromCache": false },
"failedReason": null },
{ "id": "…", "status": "running", "result": null, "failedReason": null }
]
}/v1/batches/:id/streamBatch status (live stream)
Server-Sent Events. Emits a progress event whenever counts change, then a done event with the full results. Closes automatically when finished (max 30 min).
event: progress
data: {"total":2,"completed":1,"failed":0,"running":1,"queued":0}
event: done
data: {"results":[ … ]}/v1/jobs/:idSingle job status
Status of one job from a batch (ids come from the batch response's jobIds).
{
"id": "job-uuid",
"status": "completed", // waiting | active | completed | failed | delayed
"progress": 100,
"result": { "imageUrl": "https://render.pixeldrive.pro/img/…", "contentType": "image/png" },
"failedReason": null,
"attemptsMade": 1
}/img/t/:templateId/:hash.pngServe a rendered image
Public, content-addressed, cached for a year (immutable). These are the URLs returned by every render. Drop them straight into an <img>, an email, or a CDN.
GET https://render.pixeldrive.pro/img/t/ee3a339f-.../a1b2c3d4e5f6g7h8.png
→ 200, Content-Type: image/png, Cache-Control: public, max-age=31536000, immutable/v1/signSigned image URL
Issue a short-lived signed URL for an image (for private/expiring links).
| Field | Type | Description |
|---|---|---|
| key | string | Image key, e.g. t/<id>/<hash>.png. (or pass url) |
| url | string | A full image URL instead of a key. |
| expiresIn | number | Seconds until expiry. 60–604800, default 3600. |
curl -X POST https://render.pixeldrive.pro/v1/sign \
-H "Authorization: Bearer pdrv_..." \
-d '{ "url": "https://render.pixeldrive.pro/img/t/…/….png", "expiresIn": 7200 }'
{ "url": "https://…signed…", "key": "t/…/….png", "expiresIn": 7200 }https://pixeldrive.pro/mcpMCP server (for AI agents)
A Model Context Protocol endpoint so AI assistants can generate images directly. Authenticate with the same Bearer API token. Two tools:
| Field | Type | Description |
|---|---|---|
| preview_image | free | Ephemeral preview, returns an inline image for the model to see. No credit. For iterating. |
| generate_image | 1 credit | Final, saved render. Returns the permanent URL + credits remaining. |
Both take { templateId, payload } with the same payload shape as the REST API. Point your MCP client at https://pixeldrive.pro/mcp with header Authorization: Bearer pdrv_….
Credits, limits & errors
| Field | Type | Description |
|---|---|---|
| 1 credit | per render | Each non-cached render. Refunded on failure. |
| 0 credits | cache hits | Identical template+payload returns instantly, free. |
| 0 credits | previews | preview:true and the MCP preview_image tool. |
| 0 credits | image serving | GET /img/… is always free. |
| 60 / min | preview rate | Per user, for preview renders (429 when exceeded). |
| 1000 | batch max | Payloads per /v1/render/batch call. |
Status codes
| Field | Type | Description |
|---|---|---|
| 200 / 202 | ok | Success (202 for accepted batches). |
| 400 | bad request | Invalid body / payload (Zod validation). |
| 401 | unauthorized | Missing / revoked / expired token. |
| 402 | no credits | Insufficient credit balance. Top up on Billing. |
| 404 | not found | Unknown template / image / job. |
| 429 | rate limited | Preview rate limit exceeded. |
Manage tokens in API tokens · upgrade for more credits on Billing · see plans on Pricing.