Conventions#
- All bodies are JSON; send
Content-Type: application/json. - Errors are envelopes:
{ "error": { "code", "message" } }— codes listed in Rendering. - Rate limits and
429behaviour: Authentication.
List templates#
GET/v1/templates
Every published template your key can render, with its addressing key.
{
"templates": [
{
"id": "tpl_…",
"name": "Instagram post",
"derived_key": "acme_instagram_1080x1350",
"width": 1080,
"height": 1350
}
]
}Template schema#
GET/v1/templates/:id/schema
The slot contract — validate before you spend a credit, and keep your integration honest when a designer adds a slot.
{
"slots": [
{ "name": "headline", "type": "text" },
{ "name": "hero_image", "type": "image" },
{ "name": "brand_color", "type": "color" }
]
}Create a render#
POST/v1/renders
| Field | Type | Description |
|---|---|---|
template | string | The addressing key ({project_slug}_{frame_slug}). |
modifications | array | Slot values: {"name", "text" | "image_url" | "color"} per entry. Omitted slots keep their designed content. |
format | string? | png (default), jpg or webp. |
scale | number? | 1–4. Costs scale² credits. |
webhook_url | string? | Completion callback — see Webhooks. |
Returns 202 with a pending job, or 200 with the finished URLs when you send Prefer: wait and the render completes inside the wait window — the full contract is in Rendering.
{ "id": "6f1c…", "status": "pending", "output_url": null }Get a render#
GET/v1/renders/:id
{
"id": "6f1c…",
"status": "completed", // pending | processing | completed | failed
"output_url": "https://…signed…", // ~1h from THIS response
"asset_url": "https://…permanent…"
}output_url is re-signed on every fetch — its ~1 hour lifetime runs from the response you read it in. Failed jobs carry an error message and are refunded.
Batch render#
POST/v1/renders/batch
| Field | Type | Description |
|---|---|---|
renders | array | 1–50 render specs (the same fields as a single render). |
format / scale / webhook_url | batch-level? | Defaults for every row; a row-level value overrides. |
Per-row isolation, ordering and the mixed-outcome response shape are covered in Batch rendering.
Search assets#
POST/v1/assets/query
Search your project’s asset library by tag or metadata — the same index the MCP search_assets tool uses. Returns ranked matches with URLs ready to pass into an image slot.
{ "tags": ["product", "hero"], "limit": 10 }Webhook secret#
GET/v1/webhook-secret
Your HMAC signing secret for verifying X-Anjin-Signature on webhook deliveries. Keep it server-side. Verification recipe: Webhooks.
