Form API-1The press manual — one endpoint, infinite imagesPixelDrive

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

FieldTypeDescription
Render APIhttps://render.pixeldrive.pro/v1All authenticated render endpoints
Image CDNhttps://render.pixeldrive.pro/imgPublic image serving (no auth)
MCPhttps://pixeldrive.pro/mcpModel Context Protocol for AI agents
POSTAuthorization: Bearer <token>

Authentication

auth:

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.

Template variables

Design a template once, then make any layer dynamic: select it and click the database icon to mark it a Variable. Each variable becomes a key in your render payload, addressed by its layer name (set one in the Layers panel) or its element id. Every template ships a ready-to-paste payload with all its variables on its API page — open a template → API.

Variable types

FieldTypeDescription
Text{ "text", "fontSize"?, "color"?, "lang"? }Text, QR-code and barcode layers.
Image / SVG{ "src": "https://…" }Swap the image/graphic by full URL.
Rating{ "value": 4.5 }Star rating — whole and half stars, 0…max.

Text that never breaks the design

Long values auto-shrink to fit their box, so a 5-word headline and a 25-word one both stay inside the layout — no overflow, no clipping. Need control per render? Two optional overrides on any text variable:

FieldTypeDescription
fontSizenumber (px)Force a size — overrides the auto-fit shrink for that render.
colorCSS colorRecolor the text, e.g. "#E11D48" or "rebeccapurple".
{ "headline": { "text": "Big news", "fontSize": 64, "color": "#E11D48" } }

Translate (any language)

Add lang to a text value and the render service translates it into that language before drawing — self-hosted, cached per text + lang, and auto-fit so longer translations stay on-layout. Use an ISO-639-1 code (es, fr, ja, ar, …) — 70+ common languages, or any FLORES-200 code (spa_Latn) for the full 200.

{ "headline": { "text": "Spring Sale", "lang": "es" } }   →   "Venta de Primavera"

Or translate the whole template at once: pass a top-level langand every text layer renders in that language — no per-field setup, no need to re-send the copy. On the URL endpoint it’s just ?lang=es.

POST /v1/render   { "templateId": "…", "lang": "es" }
GET  /v1/render?templateId=…&token=…&lang=es     # whole template, in Spanish

Fonts

Whatever typeface you set in the editor — web fonts or uploaded custom fonts — is embedded in the template and rendered pixel-for-pixel on the server. No per-request font config needed.

Output formats

Default output is PNG at the template’s exact canvas size. Pass format for others, and pixelRatio 2/3 for hi-res.

FieldTypeDescription
pngimage/pngDefault. Lossless, supports transparency.
jpegimage/jpegSmaller, opaque (transparency flattened to white). Set quality 1–100.
webpimage/webpMuch smaller than PNG, keeps transparency. quality 1–100.
avifimage/avifSmallest modern format. quality 1–100.
pdfapplication/pdfSingle page sized to the canvas — for certificates / print.

On the URL endpoint use ?format=webp&quality=80. Each format + quality is cached separately; identical requests return instantly and cost nothing.

POST/v1/render

Render a single image

auth: Bearer tokencost: 1 credit (cache hits free)

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

FieldTypeDescription
templateIdstring (uuid)The template to render. Required.
payloadobjectMap of layer name (or element id) → value. See below. Required.
formatstringpng (default) | jpeg | webp | avif | pdf. See Output formats above.
qualitynumber1–100 for jpeg/webp/avif. Default 85.
langstringTranslate the whole template into this language (ISO code, e.g. "es").
pixelRationumberOutput scale. Default 1 (exact canvas size). Pass 2 for retina, 3 for hi-res.

Payload value types

Each key is a layer name (from the Layers panel) or the element id — both work, the name wins if set. Each maps to one value object, depending on the element:

FieldTypeDescription
{ "text": "…" }stringText, QR-code and barcode elements
{ "src": "https://…" }urlImage and SVG elements (full URL)
{ "value": 4.5 }numberNumeric fields (e.g. rating stars)

Text values take two optional per-render overrides: fontSize (px — overrides the auto-fit shrink) and color(any CSS colour). Long text always auto-shrinks to fit its box, so designs don't break.

{ "headline": { "text": "Big news", "fontSize": 64, "color": "#E11D48" } }

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
}
GET/v1/render

Render from a URL (for <img>, og:image, email)

auth: Bearer tokencost: 1 credit (cache hits free)

A URL-only render. Put it straight in an <img src>, an og:image tag, or an email — no code. It renders (or cache-hits) and 302-redirects to the immutable image URL.

Query params

FieldTypeDescription
templateIduuidThe template. Required.
tokenstringYour API token (headers aren’t possible in an <img>). Required.
<field>stringText field: ?headline=Hello → headline gets that text.
<field>.srcurlImage field: ?logo.src=https://…
<field>.valuenumberNumeric field: ?stars.value=5
langstringTranslate the whole template, e.g. ?lang=es. Per field: ?headline.lang=fr.
pixelRationumberOutput scale (default 1).
formatstringjpeg | webp | avif | pdf (default png), or json for the metadata body.
qualitynumber1–100 for jpeg/webp/avif. Default 85.

Example

<img src="https://render.pixeldrive.pro/v1/render?templateId=ee3a339f-…&token=pdrv_…&headline=500K%20followers" />

# → 302 redirect → https://render.pixeldrive.pro/img/t/<templateId>/<hash>.png

Encode special characters

Field values must be URL-encoded. Characters like # & + % = are URL syntax — left raw, the value is silently truncated or split (a # drops everything after it before the request is even sent, so ?msg=A%23B arrives, but ?msg=A#B arrives as just A). Wrap each value in encodeURIComponent(), let curl -G --data-urlencode do it, or skip the URL and POST a JSON body (which needs no encoding).

# raw — BREAKS:  # truncates the URL, & splits it, % is a bad escape
?headline=Big news & 50% off! #sale

# encoded — works  (encodeURIComponent("Big news & 50% off! #sale"))
?headline=Big%20news%20%26%2050%25%20off!%20%23sale

The token sits in the URL, so treat these as semi-public: use a dedicated token you can revoke, or for truly public embeds, render server-side and embed the returned /img/… URL (which carries no token), optionally via /v1/sign.

POST/v1/render/batch

Bulk render (async)

auth: Bearer tokencost: 1 credit per non-cached image

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

FieldTypeDescription
templateIdstring (uuid)Template to render against.
payloadsobject[]Array of 1–1000 payload objects (same shape as /v1/render).
userIdstring (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": ["…","…"] }
GET/v1/batches/:id

Batch status (polling)

auth: Bearer token

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 }
  ]
}
GET/v1/batches/:id/stream

Batch status (live stream)

auth: Bearer token

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":[ … ]}
GET/v1/jobs/:id

Single job status

auth: Bearer token

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
}
GET/img/t/:templateId/:hash.png

Serve a rendered image

auth: none — publiccost: free

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
POST/v1/sign

Signed image URL

auth: Bearer token

Issue a short-lived signed URL for an image (for private/expiring links).

FieldTypeDescription
keystringImage key, e.g. t/<id>/<hash>.png. (or pass url)
urlstringA full image URL instead of a key.
expiresInnumberSeconds 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 }
POSThttps://pixeldrive.pro/mcp

MCP server (for AI agents)

auth: Bearer tokencost: preview free · generate 1 credit

A Model Context Protocol endpoint so AI assistants can browse, design, and render directly — 25 toolscovering the whole editor and renderer. Authenticate with the same Bearer API token. The two you’ll use most:

FieldTypeDescription
preview_imagefreeEphemeral preview, returns an inline image for the model to see. No credit. For iterating.
generate_image1 creditFinal, saved render. Returns the permanent URL + credits remaining.

→ Full MCP guide: one-command install, one-click Cursor/VS Code buttons, the complete tool list

MCP-aware clients (Cursor, Claude Code, …)

{
  "mcpServers": {
    "pixeldrive": {
      "url": "https://pixeldrive.pro/mcp",
      "headers": { "Authorization": "Bearer pdrv_your_token" }
    }
  }
}

Claude Desktop (proxies the remote server over stdio)

{
  "mcpServers": {
    "pixeldrive": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://pixeldrive.pro/mcp",
        "--header", "Authorization: Bearer pdrv_your_token"
      ]
    }
  }
}

Credits, limits & errors

FieldTypeDescription
1 creditper renderEach non-cached render. Refunded on failure.
0 creditscache hitsIdentical template+payload returns instantly, free.
0 creditspreviewspreview:true and the MCP preview_image tool.
0 creditsimage servingGET /img/… is always free.
60 / minpreview ratePer user, for preview renders (429 when exceeded).
1000batch maxPayloads per /v1/render/batch call.

Status codes

FieldTypeDescription
200 / 202okSuccess (202 for accepted batches).
400bad requestInvalid body / payload (Zod validation).
401unauthorizedMissing / revoked / expired token.
402no creditsInsufficient credit balance. Top up on Billing.
404not foundUnknown template / image / job.
429rate limitedPreview rate limit exceeded.

Manage tokens in API tokens · upgrade for more credits on Billing · see plans on Pricing.