v1
latestOpenAPI 3.1.02026-08-06244570.4 KBImage
Generate image from template
Generate an image (PNG, JPEG or WebP) from an image template.
Authentication: API Key required (x-api-key header)
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| template_id | string | ✅ Yes | Template short ID (12 characters) |
| modifications | array | No | Modify elements by layer name (see below) |
| format | string | No | png (default), jpeg or webp |
| width | integer | No | Output width in pixels (defaults to the template's native width) |
| export_type | string | No | url (default) or binary |
Modifications
Each modification targets a layer by the name you set in the editor's Layers panel:
| Property | Description |
|---|---|
| name | Layer name to modify (required) |
| text | Replace the layer's text |
| image_url | Set the layer's image (src for images, background-image otherwise) |
| color | Text color |
| background | Background color |
| hidden | Hide (true) or show (false) the layer |
Unknown layer names are skipped and listed in the response warnings. A name that matches several layers is applied to all of them.
Export Types
- url (default): image is uploaded to CDN, returns JSON with URL
- binary: returns raw image bytes directly
Note: This endpoint only accepts image templates. Use /v1/pdf/create for PDF templates.
Credits: 1 credit deducted per successful generation.
Rate Limits: 60 requests/min (free), 120 requests/min (paid). Headers included in response.
post/v1/image/create
Request body
Example request
{
"export_type": "url",
"format": "png",
"modifications": [
{
"name": "title",
"text": "Summer Sale -50%"
},
{
"image_url": "https://example.com/photo.jpg",
"name": "product_image"
}
],
"template_id": "HMQywVpZxqAM",
"width": 1080
}Response
Image generated successfully
Example response
{
"credits_remaining": 99,
"expires_in": 86400,
"filename": "social-card.png",
"url": "https://cdn.templatefox.com/generated/abc123/social-card.png"
}