How do I generate images via API?

2 min read
API & Integration

Our REST API lets you generate images programmatically from any application. This guide will get you up and running in minutes.


Quick Start Guide

Follow these three steps to make your first API call:

Step 1: Get Your API Key

  1. Go to DashboardIntegrations (or API Keys)
  2. Click "Create API Key"
  3. Copy and save your key immediately

Warning: Your full API key is only shown once when you create it. Store it securely!

Step 2: Get Your Design ID

You can find your design ID in two ways:

  • From the URL: Open your design in the editor — the ID is in the URL: /editor/YOUR_DESIGN_ID
  • From the Dashboard: Hover over any design card to see its ID

Step 3: Make Your First API Call

Here's a complete example using cURL:

bash
curl -X POST "https://api.canvelete.com/api/v1/render" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "designId": "YOUR_DESIGN_ID", "format": "png", "dynamicElements": { "title": { "text": "Hello World" } } }'

API Response

A successful response looks like this:

json
{ "success": true, "imageUrl": "https://cdn.canvelete.com/renders/abc123.png", "renderTime": 234 }

Success: The imageUrl is a direct link to your generated image. It's publicly accessible and CDN-delivered for fast loading worldwide.


Code Examples

Go to DashboardIntegrations to get ready-to-use code in:

  • JavaScript / Node.js
  • Python
  • PHP
  • Ruby
  • Go
  • cURL

Pro Tip: The Integrations page lets you select your design, configure dynamic elements, and generates the exact code you need.


API Parameters Reference

ParameterDescriptionDefault
designIdYour design's unique IDRequired
formatOutput format: png, jpeg, pdf, svgpng
qualityImage quality (1-100, JPEG only)90
dynamicElementsData to override in the design{}
cacheCache the result for faster subsequent requeststrue

Next Steps

Was this article helpful?

Need more help? Contact support