Complete REST API documentation for SVGMaker v1. Generate, edit, convert, and optimize SVGs programmatically.
Looking for the legacy API docs? View Legacy API Reference
Quick Navigation
The SVGMaker API v1 provides a RESTful interface for generating, editing, and converting images to SVG format using advanced AI technology.
Create stunning vector graphics from text descriptions using advanced AI
Transform existing images and SVGs with AI-powered modifications
AI vectorize, trace, batch convert, and optimize SVG files
https://api.svgmaker.ioAPI Version: v1 — All endpoints are under https://api.svgmaker.io/v1/
All API endpoints require authentication using an API key passed in the x-api-key header.
x-api-key: svgmaker-io{your-api-key}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
Never commit API keys to version control
All API responses follow a consistent structure.
Note: The status field in the error object matches the HTTP status code in the response header.
Credits are consumed based on the operation type and quality level.
| Operation | Quality | Credits | Description |
|---|---|---|---|
| Generate | Low | 1 | Basic quality SVG generation |
| Generate | Medium | 2 | Standard quality SVG generation |
| Generate | High | 3 | Premium quality SVG generation |
| Edit | Low | 2 | Basic quality image/SVG editing |
| Edit | Medium | 3 | Standard quality image/SVG editing |
| Edit | High | 5 | Premium quality image/SVG editing |
| Convert (AI Vectorize) | - | 1 | Convert raster image to SVG using AI |
| Convert (Trace) | - | 0.5 | Trace raster image to SVG using VTracer |
| Convert (SVG to Vector) | - | 0.5 | Convert SVG to vector format (PDF/EPS/DXF/AI/PS) |
| Convert (Raster to Raster) | - | 0.25 | Convert between raster formats |
| Convert (Batch) | - | 0.5/0.25 | Batch convert files (0.5 per vector, 0.25 per raster) |
| Enhance Prompt | - | 0.5 | Enhance text prompts using AI |
| Optimize SVG | - | 0.5 | Optimize SVG files using SVGO. Use compress=true for SVGZ. |
When using the model parameter instead of quality, credits are charged based on the specific model. These parameters are mutually exclusive.
| Model ID | Generate | Edit | Description |
|---|---|---|---|
gpt-image-1-mini | 1 | 2 | Fast, lightweight image generation |
flux-1-dev | 1 | - | Painterly renders from Black Forest Labs |
flux-2-dev | 1 | 2 | Next-gen Flux model with edit support |
z-image-turbo | 1 | - | Fast turbo generation |
qwen-image | 2 | - | Alibaba's image generation model |
qwen-image-edit-plus | - | 2 | Alibaba's image editing model |
flux-kontext-dev | - | 1 | Context-aware editing model |
gpt-image-1 | 2 | 3 | OpenAI's standard image model |
gpt-image-1.5 | 2 | 3 | OpenAI's enhanced image model |
nano-banana | 2 | 3 | Google's Gemini image model |
nano-banana-pro | 5 | 5 | Google's premium Gemini model |
imagen-4 | 2 | - | Google's Imagen 4 model |
imagen-4-ultra | 3 | - | Google's Imagen 4 Ultra model |
seedream-4.5 | 2 | 3 | ByteDance's Seedream model |
"-" indicates the model does not support that operation.
Generate SVG graphics from text descriptions using AI.
POST/v1/generate| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | Text description of the SVG to generate |
quality | string | No | medium | Quality level: low, medium, or high |
model | string | No | - | Specific AI model ID. Cannot be combined with quality. |
aspectRatio | string | No | auto | Aspect ratio: auto, portrait, landscape, or square |
background | string | No | auto | Background type: auto, transparent, or opaque |
storage | boolean | No | false | Save files to cloud storage |
stream | boolean | No | false | Enable streaming response via SSE |
base64Png | boolean | No | false | Include base64-encoded PNG preview |
svgText | boolean | No | false | Include raw SVG source code |
styleParams | object | No | - | Style config: style, color_mode, image_complexity, text, composition |
Edit existing images or SVGs with AI-powered modifications.
POST/v1/editRequest format: multipart/form-data
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | file | Yes | - | Image file to edit (PNG, JPEG, WebP, SVG, etc.) |
prompt | string | Yes | - | Edit instructions as a text string |
quality | string | No | medium | Quality level: low, medium, or high |
model | string | No | - | Specific AI model ID. Cannot be combined with quality. |
aspectRatio | string | No | auto | Aspect ratio: auto, portrait, landscape, or square |
background | string | No | auto | Background type: auto, transparent, or opaque |
storage | string | No | "false" | Save to cloud storage ("true"/"false") |
stream | string | No | "false" | Enable streaming response ("true"/"false") |
base64Png | string | No | "false" | Include base64 PNG ("true"/"false") |
svgText | string | No | "false" | Include raw SVG source ("true"/"false") |
styleParams | string | No | - | JSON string with style parameters |
* Either prompt or styleParams must be provided.
Enhance a text prompt using AI to make it more effective for generating high-quality SVG images.
POST/v1/enhance-prompt| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Yes | - | The text prompt to enhance |
Convert between image formats with multiple specialized endpoints.
POST/v1/convert/ai-vectorizeConvert raster images (PNG, JPEG, WebP, etc.) to SVG format using AI-powered vectorization. SVG files are not accepted.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file | Yes | - | Image file to convert (PNG, JPEG, WebP, TIFF, etc.) |
storage | string | No | "false" | Save to cloud storage ("true"/"false") |
stream | string | No | "false" | Enable streaming response ("true"/"false") |
svgText | string | No | "false" | Include raw SVG source ("true"/"false") |
Note: The base64Png parameter is not supported for this endpoint.
POST/v1/convert/traceTrace raster images to SVG using VTracer algorithms.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file | Yes | - | Raster image file (PNG, JPG, WEBP, TIFF) |
algorithm | string | No | vtracer | Tracing algorithm. potrace & coltrace coming soon. |
preset | string | No | poster | Tracing preset: bw, poster, or photo |
mode | string | No | spline | Tracing mode: pixel, polygon, or spline |
hierarchical | string | No | stacked | Hierarchical mode: stacked or cutout |
detail | number | No | 50 | Detail level (0-100) |
smoothness | number | No | 50 | Smoothness level (0-100) |
corners | number | No | 50 | Corner detection (0-100) |
reduceNoise | number | No | 4 | Noise reduction level |
POST/v1/convert/svg-to-vectorConvert SVG files to other vector formats (PDF, EPS, DXF, AI, PS).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file | Yes | - | SVG file to convert |
toFormat | string | Yes | - | Target format: PDF, EPS, DXF, AI, or PS |
textToPath | string | No | "false" | Convert text to paths ("true"/"false") |
dxfVersion | string | No | R14 | DXF version: R12 or R14 |
POST/v1/convert/raster-to-rasterConvert between raster formats (PNG, JPG, WebP, TIFF, GIF, AVIF).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file | Yes | - | Raster image file to convert |
toFormat | string | Yes | - | Target: PNG, JPG, WEBP, TIFF, GIF, or AVIF |
quality | number | No | - | Output quality 1-100 (lossy formats only) |
width | number | No | - | Output width in pixels |
height | number | No | - | Output height in pixels |
POST/v1/convert/batchConvert up to 10 files in a single request. 0.5 credits per vector output, 0.25 credits per raster output.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file(s) | Yes | - | File(s) to convert (up to 10). Use "file" as field name for each. |
toFormat | string | Yes | - | Target format (SVG, PDF, PNG, JPG, etc.) |
textToPath | string | No | "false" | Convert text to paths for SVG to vector ("true"/"false") |
dxfVersion | string | No | R14 | DXF version: R12 or R14. Only for DXF format. |
preset | string | No | poster | Tracing preset for raster to SVG: bw, poster, photo |
mode | string | No | spline | Tracing mode for raster to SVG: pixel, polygon, spline |
hierarchical | string | No | stacked | Hierarchical mode: stacked or cutout |
detail | number | No | 50 | Detail level 0-100 (for raster to SVG) |
smoothness | number | No | 50 | Smoothness 0-100 (for raster to SVG) |
corners | number | No | 50 | Corner detection 0-100 (for raster to SVG) |
quality | number | No | - | Output quality 1-100 (for raster conversions) |
width | number | No | - | Output width in pixels (for raster conversions) |
height | number | No | - | Output height in pixels (for raster conversions) |
URLs expire after 12 hours. Files are automatically deleted after 24 hours.
Optimize SVG files using SVGO to reduce file size by 10-30%.
POST/v1/svg/optimize| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file | file | Yes | - | SVG file to optimize |
compress | string | No | "false" | Compress to SVGZ format ("true"/"false"). Returns svgzUrl when true. |
Manage your generated content — list, view, delete, share, and download.
GET/v1/generations| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 1 | Page number (1-indexed) |
limit | number | No | 20 | Items per page (1-100) |
type | string | No | - | Filter by type (generate, edit). Multiple allowed. |
hashtags | string | No | - | Filter by hashtag. Multiple allowed. |
categories | string | No | - | Filter by category. Multiple allowed. |
query | string | No | - | Search query for prompt/description |
GET/v1/generations/{id}DELETE/v1/generations/{id}Paid users only. Deletes the generation and its associated files.
POST/v1/generations/{id}/shareMakes a generation public. Returns a shareUrl.
GET/v1/generations/{id}/downloadPaid users only. URLs expire after 12 hours.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
format | string | No | webp | Output format: svg, webp, png, svg-optimized, or svgz |
optimize | string | No | "false" | Optimize before compressing (svgz only, "true"/"false") |
Browse and download from the public gallery.
GET/v1/gallery| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 1 | Page number (1-indexed) |
limit | number | No | 20 | Items per page (1-100) |
type | string | No | - | Filter by type. Multiple allowed. |
hashtags | string | No | - | Filter by hashtag. Multiple allowed. |
categories | string | No | - | Filter by category (AND condition). |
query | string | No | - | Search query |
pro | string | No | - | Filter for pro images ("true") |
gold | string | No | - | Filter for gold images ("true") |
GET/v1/gallery/{id}GET/v1/gallery/{id}/downloadCredits: SVG formats cost 1 credit. WebP/PNG are free. Pro images require a paid account.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
format | string | No | webp | Output format: svg, webp, png, svg-optimized, or svgz |
optimize | string | No | "false" | Optimize before compressing (svgz only, "true"/"false") |
| Format | Credits |
|---|---|
svg, svg-optimized, svgz | 1 credit |
webp, png | 0 credits (free) |
Get account information and usage statistics.
GET/v1/accountGET/v1/account/usage| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
days | number | No | - | Number of days to look back. Cannot use with start/end. |
start | string | No | - | Start date (YYYY-MM-DD). Must use with end. |
end | string | No | - | End date (YYYY-MM-DD). Must use with start. |
If no parameters are provided, returns all-time totals. If days or start/end are provided, returns daily breakdown.
Common error codes and how to handle them.
| Code | HTTP Status | Description |
|---|---|---|
INVALID_API_KEY | 401 | Invalid or missing API key |
INSUFFICIENT_CREDITS | 402 | Not enough credits for the operation |
INVALID_REQUEST | 400 | Invalid request parameters |
VALIDATION_ERROR | 400 | Request validation failed |
METHOD_NOT_ALLOWED | 405 | HTTP method not allowed for this endpoint |
ENDPOINT_NOT_FOUND | 404 | Endpoint does not exist |
CONTENT_POLICY | 422 | Content policy violation |
RATE_LIMIT_EXCEEDED | 429 | Too many requests, rate limit exceeded |
SERVER_ERROR | 500 | Internal server error |
ENDPOINT_DISABLED | 503 | Endpoint is currently disabled |
Always check status codes before processing responses
Handle rate limits with exponential backoff
Validate file formats before uploading
Check credit balance before making requests
All endpoints are rate limited per API key. Rate limit info is included in response headers.
| Header | Description |
|---|---|
| x-ratelimit-limit-requests | Max requests in current window |
| x-ratelimit-remaining-requests | Requests remaining in window |
| x-ratelimit-reset-requests | Unix timestamp when window resets |
| Endpoint | Limit | Window |
|---|---|---|
| /v1/generate | 5 requests | 60s |
| /v1/edit | 5 requests | 60s |
| /v1/convert/ai-vectorize | 5 requests | 60s |
| /v1/convert/trace | 10 requests | 60s |
| /v1/convert/svg-to-vector | 10 requests | 60s |
| /v1/convert/raster-to-raster | 10 requests | 60s |
| /v1/convert/batch | 5 requests | 60s |
| /v1/enhance-prompt | 10 requests | 60s |
| /v1/svg/optimize | 10 requests | 60s |
| /v1/gallery/{id}/download | 100 requests | 60s |
| Endpoint | Limit | Window |
|---|---|---|
| /v1/generations | 1000 requests | 60s |
| /v1/generations/{id} | 1000 requests | 60s |
| /v1/generations/{id}/delete | 100 requests | 60s |
| /v1/generations/{id}/share | 100 requests | 60s |
| /v1/generations/{id}/download | 100 requests | 60s |
| /v1/gallery | 1000 requests | 60s |
| /v1/gallery/{id} | 1000 requests | 60s |
| /v1/account | 1000 requests | 60s |
| /v1/account/usage | 1000 requests | 60s |
Monitor x-ratelimit-remaining-requests header to know how many requests you have left
When you receive a 429 response, wait until the x-ratelimit-reset-requests timestamp before retrying
Use /v1/convert/batch to process multiple files instead of individual requests