Comprehensive API documentation for SVGMaker. Learn how to generate, edit, and convert SVGs using our public API.
Start building with SVGMaker API in minutes
Create stunning vector graphics from text descriptions using advanced AI
Transform existing images and SVGs with AI-powered modifications
Convert raster images (PNG, JPEG) to scalable vector format
https://svgmaker.io/api
All API endpoints are relative to this base URL
Generate your first SVG with a simple API call
curl -X POST https://svgmaker.io/api/generate \
-H "Content-Type: application/json" \
-H "x-api-key: svgmaker-io{your-api-key}" \
-d '{
"prompt": "A simple geometric logo with blue and white colors",
"quality": "medium"
}'
Receive a high-quality SVG file ready for use
{
"svgUrl": "https://storage.googleapis.com/.../generated.svg",
"creditCost": 2,
"quality": "medium"
}
Your first SVG is just an API call away. Explore the endpoints below to unlock the full power of SVGMaker.
Secure your API requests with API key authentication
All API endpoints require authentication via an API key passed in the x-api-key
header.
x-api-key: svgmaker-io{your-api-key}
Keep your API key secure and never share it publicly
Store API keys in environment variables, not in your code
Rotate your API keys regularly for enhanced security
Monitor your API usage to detect any unauthorized access
Understand how credits work and choose the right plan for your needs
Operation | Quality | Credits | Description |
---|---|---|---|
Convert | NA | 1 credit | Convert raster images to SVG |
Generate | Low | 1 credit | Basic quality SVG generation |
Generate | Medium | 2 credits | Standard quality SVG generation |
Generate | High | 4 credits | Premium quality SVG generation |
Edit | NA | 3 credits | AI-powered image/SVG editing |
Explore the main API endpoints for generating, editing, and converting SVGs
Create stunning SVG graphics from text descriptions using advanced AI technology.
POST
/api/generate
Content-Type: application/json
x-api-key: svgmaker-io{your-api-key}
{
"prompt": "string",
"quality": "low|medium|high",
"aspectRatio": "auto|portrait|landscape|square|wide|tall",
"background": "auto|transparent|opaque",
"stream": "boolean",
"base64Png": "boolean",
"svgText": "boolean",
"styleParams": {
"style": "string",
"color_mode": "string",
"image_complexity": "string",
"category": "string",
"composition": "string",
"advanced": {
"stroke_weight": "thin|medium|thick",
"corner_style": "none|rounded|sharp",
"shadow_effect": "none|soft|hard"
}
}
}
curl -X POST https://svgmaker.io/api/generate \
-H "Content-Type: application/json" \
-H "x-api-key: svgmaker-io{your-api-key}" \
-d '{
"prompt": "A minimalist mountain landscape with geometric shapes",
"quality": "high",
"aspectRatio": "landscape",
"background": "transparent",
"base64Png": true,
"svgText": true,
"styleParams": {
"style": "minimalist",
"color_mode": "monochrome",
"composition": "center-object"
}
}'
{
"svgUrl": "https://storage.googleapis.com/your-bucket/generated-svg.svg",
"creditCost": 4,
"base64Png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"svgText": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">...</svg>",
"prompt": "A minimalist mountain landscape with geometric shapes",
"quality": "high",
"revisedPrompt": "A minimalist mountain landscape featuring clean geometric mountain shapes..."
}
Transform existing images and SVGs with AI-powered modifications and enhancements.
POST
/api/edit
Content-Type: multipart/form-data
x-api-key: svgmaker-io{your-api-key}
Field | Type | Required | Description |
---|---|---|---|
image | File | Yes | Image file to edit (PNG, JPEG, WebP, SVG) |
prompt | string | Yes | Edit instructions as a simple text string |
styleParams | string | No | JSON string containing style parameters |
quality | string | No | Quality level: "low", "medium", "high" (default: "medium") |
aspectRatio | string | No | Aspect ratio: "auto", "portrait", "landscape", "square", "wide", "tall" (default: "auto") |
background | string | No | Background: "auto", "transparent", "opaque" (default: "auto") |
stream | boolean | No | Enable streaming response (default: false) |
base64Png | boolean | No | Include base64-encoded PNG preview in response (default: false) |
svgText | boolean | No | Include SVG source code as text in response (default: false) |
curl -X POST https://svgmaker.io/api/edit \
-H "x-api-key: svgmaker-io{your-api-key}" \
-F "image=@input-image.png" \
-F "prompt=Add a golden frame around this image" \
-F "quality=medium" \
-F "aspectRatio=square" \
-F "background=transparent" \
-F "base64Png=true" \
-F "svgText=true"
{
"svgUrl": "https://storage.googleapis.com/your-bucket/edited-svg.svg",
"originalImageUrl": "https://storage.googleapis.com/your-bucket/original-image.png",
"creditCost": 3,
"base64Png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"svgText": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">...</svg>",
"prompt": "Add a golden frame around this image",
"quality": "medium"
}
Transform raster images into scalable vector graphics with AI-powered conversion.
POST
/api/convert
Content-Type: multipart/form-data
x-api-key: svgmaker-io{your-api-key}
Field | Type | Required | Description |
---|---|---|---|
file | File | Yes | Image file to convert (PNG, JPEG, WebP, etc.) |
stream | boolean | No | Enable streaming response (default: false) |
svgText | boolean | No | Include SVG source code as text in response (default: false) |
curl -X POST https://svgmaker.io/api/convert \
-H "x-api-key: svgmaker-io{your-api-key}" \
-F "file=@image-to-convert.png" \
-F "stream=false" \
-F "svgText=true"
{
"svgUrl": "https://storage.googleapis.com/bucket-name/converted-svg.svg",
"originalImageUrl": "https://storage.googleapis.com/bucket-name/original-image.png",
"creditCost": 1,
"quality": "medium",
"svgText": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">...</svg>"
}
Unlock powerful capabilities with streaming, custom formats, and style parameters
When stream=true
is set, responses are sent as Server-Sent Events (SSE) for real-time updates.
Content-Type: text/event-stream
{"status": "processing", "message": "Received request..."}
{"status": "processing", "message": "Generating image..."}
{"status": "processing", "message": "Processing SVG paths..."}
{"status": "complete", "svgUrl": "https://...", "simulationMode": false}
{"status": "error", "error": "Error message", "errorType": "general_error"}
base64Png
)When base64Png=true
is included in requests to /api/generate
or /api/edit
, the response will include a base64Png
field containing a base64-encoded PNG preview of the generated SVG.
{
"svgUrl": "https://...",
"base64Png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
"creditCost": 2
}
svgText
)When svgText=true
is included in requests to any endpoint, the response will include a svgText
field containing the raw SVG source code.
{
"svgUrl": "https://...",
"svgText": "<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">...</svg>",
"creditCost": 2
}
Integrate SVGMaker into your applications with our official SDKs
npm install svgmaker-sdk-node
import SVGMakerClient from 'svgmaker-sdk-node';
// Initialize the client
const client = new SVGMakerClient('svgmaker-io{your-api-key}');
// Generate an SVG
const result = await client.generate({
prompt: 'A geometric mountain landscape',
quality: 'high',
styleParams: {
style: 'minimalist',
color_mode: 'monochrome'
},
base64Png: true,
svgText: true
});
console.log(result.svgUrl);
Create SVGs from text prompts
Modify existing images
Convert raster to vector
const client = new SVGMakerClient('svgmaker-io{your-api-key}', {
baseUrl: 'https://svgmaker.io/api',
timeout: 30000,
retries: 3,
rateLimit: {
requestsPerMinute: 60
}
});
try {
const result = await client.generate({
prompt: 'A beautiful landscape'
});
} catch (error) {
if (error.code === 'INSUFFICIENT_CREDITS') {
console.log('You need more credits');
} else if (error.code === 'RATE_LIMITED') {
console.log('Rate limit exceeded');
} else {
console.log('An error occurred:', error.message);
}
}
Automatic API key management
Request validation and sanitization
Secure error handling
Automatic retry logic
Rate limiting protection
Connection pooling
Full TypeScript support with comprehensive type definitions
Simple API that matches your existing code patterns
Regular updates and community-driven improvements
Handle errors gracefully with proper status codes and error messages
Status Code | Description | Action Required |
---|---|---|
200 | Success | Process response normally |
400 | Bad Request - Invalid parameters | Check request parameters |
401 | Unauthorized - Invalid or missing API key | Verify API key |
402 | Payment Required - Insufficient credits | Purchase more credits |
413 | Payload Too Large - File size exceeds limit | Reduce file size |
429 | Too Many Requests - Rate limit exceeded | Implement backoff strategy |
500 | Internal Server Error | Retry later |
{
"error": "Insufficient credits",
"creditsRequired": 4
}
{
"error": "Content that is not allowed by our safety system",
"errorType": "content_safety"
}
{
"error": "File size exceeds 25 MB limit"
}
{
"error": "SVG files are already in vector format and do not need conversion"
}
Always check status codes before processing responses
Handle rate limits by implementing exponential backoff
Validate file formats before uploading
Check credit balance before making requests
Implement retry logic for transient errors
Log errors for debugging and monitoring
Get help and resources to make the most of SVGMaker API
Get instant help from our technical team