API Reference v1

Complete REST API documentation for SVGMaker v1. Generate, edit, convert, and optimize SVGs programmatically.

View SVGMaker SDK

Looking for the legacy API docs? View Legacy API Reference

Quick Navigation

Overview

The SVGMaker API v1 provides a RESTful interface for generating, editing, and converting images to SVG format using advanced AI technology.

Generate SVGs

Create stunning vector graphics from text descriptions using advanced AI

Edit Images

Transform existing images and SVGs with AI-powered modifications

Convert & Optimize

AI vectorize, trace, batch convert, and optimize SVG files

Base URL

https://api.svgmaker.io

API Version: v1 — All endpoints are under https://api.svgmaker.io/v1/

Quick Start

1

Get Your API Key

Sign up at SVGMaker and generate your API key from account settings.

Get API Key
2

Make Your First Request

bash
3

Get Your SVG

json

Authentication

All API endpoints require authentication using an API key passed in the x-api-key header.

Header Format

x-api-key: svgmaker-io{your-api-key}

Security Best Practices

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

Response Format

All API responses follow a consistent structure.

Success Response

json

Error Response

json

Note: The status field in the error object matches the HTTP status code in the response header.

Credit System

Credits are consumed based on the operation type and quality level.

Credit Pricing

OperationQualityCreditsDescription
GenerateLow1Basic quality SVG generation
GenerateMedium2Standard quality SVG generation
GenerateHigh3Premium quality SVG generation
EditLow2Basic quality image/SVG editing
EditMedium3Standard quality image/SVG editing
EditHigh5Premium quality image/SVG editing
Convert (AI Vectorize)-1Convert raster image to SVG using AI
Convert (Trace)-0.5Trace raster image to SVG using VTracer
Convert (SVG to Vector)-0.5Convert SVG to vector format (PDF/EPS/DXF/AI/PS)
Convert (Raster to Raster)-0.25Convert between raster formats
Convert (Batch)-0.5/0.25Batch convert files (0.5 per vector, 0.25 per raster)
Enhance Prompt-0.5Enhance text prompts using AI
Optimize SVG-0.5Optimize SVG files using SVGO. Use compress=true for SVGZ.

Model-Based Credits

When using the model parameter instead of quality, credits are charged based on the specific model. These parameters are mutually exclusive.

Model IDGenerateEditDescription
gpt-image-1-mini12Fast, lightweight image generation
flux-1-dev1-Painterly renders from Black Forest Labs
flux-2-dev12Next-gen Flux model with edit support
z-image-turbo1-Fast turbo generation
qwen-image2-Alibaba's image generation model
qwen-image-edit-plus-2Alibaba's image editing model
flux-kontext-dev-1Context-aware editing model
gpt-image-123OpenAI's standard image model
gpt-image-1.523OpenAI's enhanced image model
nano-banana23Google's Gemini image model
nano-banana-pro55Google's premium Gemini model
imagen-42-Google's Imagen 4 model
imagen-4-ultra3-Google's Imagen 4 Ultra model
seedream-4.523ByteDance's Seedream model

"-" indicates the model does not support that operation.

Generate SVG

Generate SVG graphics from text descriptions using AI.

Method
POST
Endpoint
/v1/generate
Credits
1-3
ParameterTypeRequiredDefaultDescription
promptstringYes-Text description of the SVG to generate
qualitystringNomediumQuality level: low, medium, or high
modelstringNo-Specific AI model ID. Cannot be combined with quality.
aspectRatiostringNoautoAspect ratio: auto, portrait, landscape, or square
backgroundstringNoautoBackground type: auto, transparent, or opaque
storagebooleanNofalseSave files to cloud storage
streambooleanNofalseEnable streaming response via SSE
base64PngbooleanNofalseInclude base64-encoded PNG preview
svgTextbooleanNofalseInclude raw SVG source code
styleParamsobjectNo-Style config: style, color_mode, image_complexity, text, composition
← Scroll horizontally to see more →

Style Parameters

json

Example Request

bash

Example Request (with model)

bash

Response (storage: false)

json

Response (storage: true)

json

Edit Image/SVG

Edit existing images or SVGs with AI-powered modifications.

Method
POST
Endpoint
/v1/edit
Credits
2-5

Request format: multipart/form-data

ParameterTypeRequiredDefaultDescription
imagefileYes-Image file to edit (PNG, JPEG, WebP, SVG, etc.)
promptstringYes-Edit instructions as a text string
qualitystringNomediumQuality level: low, medium, or high
modelstringNo-Specific AI model ID. Cannot be combined with quality.
aspectRatiostringNoautoAspect ratio: auto, portrait, landscape, or square
backgroundstringNoautoBackground type: auto, transparent, or opaque
storagestringNo"false"Save to cloud storage ("true"/"false")
streamstringNo"false"Enable streaming response ("true"/"false")
base64PngstringNo"false"Include base64 PNG ("true"/"false")
svgTextstringNo"false"Include raw SVG source ("true"/"false")
styleParamsstringNo-JSON string with style parameters
← Scroll horizontally to see more →

* Either prompt or styleParams must be provided.

Example Request

bash

Example Request (with model)

bash

Response (storage: false)

json

Response (storage: true)

json

Enhance Prompt

Enhance a text prompt using AI to make it more effective for generating high-quality SVG images.

Method
POST
Endpoint
/v1/enhance-prompt
Credits
0.5
ParameterTypeRequiredDefaultDescription
promptstringYes-The text prompt to enhance
← Scroll horizontally to see more →

Example Request

bash

Example Response

json

Error Responses

Missing Prompt
json

Convert

Convert between image formats with multiple specialized endpoints.

AI Vectorize

Method
POST
Endpoint
/v1/convert/ai-vectorize
Credits
1

Convert raster images (PNG, JPEG, WebP, etc.) to SVG format using AI-powered vectorization. SVG files are not accepted.

ParameterTypeRequiredDefaultDescription
filefileYes-Image file to convert (PNG, JPEG, WebP, TIFF, etc.)
storagestringNo"false"Save to cloud storage ("true"/"false")
streamstringNo"false"Enable streaming response ("true"/"false")
svgTextstringNo"false"Include raw SVG source ("true"/"false")
← Scroll horizontally to see more →

Note: The base64Png parameter is not supported for this endpoint.

bash

Response (storage: false)

json

Response (storage: true)

json

Trace to SVG

Method
POST
Endpoint
/v1/convert/trace
Credits
0.5

Trace raster images to SVG using VTracer algorithms.

ParameterTypeRequiredDefaultDescription
filefileYes-Raster image file (PNG, JPG, WEBP, TIFF)
algorithmstringNovtracerTracing algorithm. potrace & coltrace coming soon.
presetstringNoposterTracing preset: bw, poster, or photo
modestringNosplineTracing mode: pixel, polygon, or spline
hierarchicalstringNostackedHierarchical mode: stacked or cutout
detailnumberNo50Detail level (0-100)
smoothnessnumberNo50Smoothness level (0-100)
cornersnumberNo50Corner detection (0-100)
reduceNoisenumberNo4Noise reduction level
← Scroll horizontally to see more →
bash

SVG to Vector

Method
POST
Endpoint
/v1/convert/svg-to-vector
Credits
0.5

Convert SVG files to other vector formats (PDF, EPS, DXF, AI, PS).

ParameterTypeRequiredDefaultDescription
filefileYes-SVG file to convert
toFormatstringYes-Target format: PDF, EPS, DXF, AI, or PS
textToPathstringNo"false"Convert text to paths ("true"/"false")
dxfVersionstringNoR14DXF version: R12 or R14
← Scroll horizontally to see more →
bash

Raster to Raster

Method
POST
Endpoint
/v1/convert/raster-to-raster
Credits
0.25

Convert between raster formats (PNG, JPG, WebP, TIFF, GIF, AVIF).

ParameterTypeRequiredDefaultDescription
filefileYes-Raster image file to convert
toFormatstringYes-Target: PNG, JPG, WEBP, TIFF, GIF, or AVIF
qualitynumberNo-Output quality 1-100 (lossy formats only)
widthnumberNo-Output width in pixels
heightnumberNo-Output height in pixels
← Scroll horizontally to see more →
bash

Batch Convert

Method
POST
Endpoint
/v1/convert/batch
Credits
0.25-0.5 per file

Convert up to 10 files in a single request. 0.5 credits per vector output, 0.25 credits per raster output.

ParameterTypeRequiredDefaultDescription
filefile(s)Yes-File(s) to convert (up to 10). Use "file" as field name for each.
toFormatstringYes-Target format (SVG, PDF, PNG, JPG, etc.)
textToPathstringNo"false"Convert text to paths for SVG to vector ("true"/"false")
dxfVersionstringNoR14DXF version: R12 or R14. Only for DXF format.
presetstringNoposterTracing preset for raster to SVG: bw, poster, photo
modestringNosplineTracing mode for raster to SVG: pixel, polygon, spline
hierarchicalstringNostackedHierarchical mode: stacked or cutout
detailnumberNo50Detail level 0-100 (for raster to SVG)
smoothnessnumberNo50Smoothness 0-100 (for raster to SVG)
cornersnumberNo50Corner detection 0-100 (for raster to SVG)
qualitynumberNo-Output quality 1-100 (for raster conversions)
widthnumberNo-Output width in pixels (for raster conversions)
heightnumberNo-Output height in pixels (for raster conversions)
← Scroll horizontally to see more →
bash

Convert Response Format (Trace, SVG-to-Vector, Raster-to-Raster, Batch)

json

URLs expire after 12 hours. Files are automatically deleted after 24 hours.

Optimize SVG

Optimize SVG files using SVGO to reduce file size by 10-30%.

Method
POST
Endpoint
/v1/svg/optimize
Credits
0.5
ParameterTypeRequiredDefaultDescription
filefileYes-SVG file to optimize
compressstringNo"false"Compress to SVGZ format ("true"/"false"). Returns svgzUrl when true.
← Scroll horizontally to see more →

Example Request

bash

Response (compress: false)

json

Response (compress: true)

json

Generations Management

Manage your generated content — list, view, delete, share, and download.

List Generations

Method
GET
Endpoint
/v1/generations
Credits
0
ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (1-indexed)
limitnumberNo20Items per page (1-100)
typestringNo-Filter by type (generate, edit). Multiple allowed.
hashtagsstringNo-Filter by hashtag. Multiple allowed.
categoriesstringNo-Filter by category. Multiple allowed.
querystringNo-Search query for prompt/description
← Scroll horizontally to see more →
bash
json

Get Generation

Method
GET
Endpoint
/v1/generations/{id}
Credits
0
bash
json

Delete Generation

Method
DELETE
Endpoint
/v1/generations/{id}
Credits
0

Paid users only. Deletes the generation and its associated files.

bash
json

Share Generation

Method
POST
Endpoint
/v1/generations/{id}/share
Credits
0

Makes a generation public. Returns a shareUrl.

bash
json

Download Generation

Method
GET
Endpoint
/v1/generations/{id}/download
Credits
0

Paid users only. URLs expire after 12 hours.

ParameterTypeRequiredDefaultDescription
formatstringNowebpOutput format: svg, webp, png, svg-optimized, or svgz
optimizestringNo"false"Optimize before compressing (svgz only, "true"/"false")
← Scroll horizontally to see more →
bash
json

Account Management

Get account information and usage statistics.

Get Account Info

Method
GET
Endpoint
/v1/account
Credits
0
bash
json

Get Usage Statistics

Method
GET
Endpoint
/v1/account/usage
Credits
0
ParameterTypeRequiredDefaultDescription
daysnumberNo-Number of days to look back. Cannot use with start/end.
startstringNo-Start date (YYYY-MM-DD). Must use with end.
endstringNo-End date (YYYY-MM-DD). Must use with start.
← Scroll horizontally to see more →

If no parameters are provided, returns all-time totals. If days or start/end are provided, returns daily breakdown.

bash

Response (All-Time)

json

Response (With Date Range)

json

Error Handling

Common error codes and how to handle them.

CodeHTTP StatusDescription
INVALID_API_KEY401Invalid or missing API key
INSUFFICIENT_CREDITS402Not enough credits for the operation
INVALID_REQUEST400Invalid request parameters
VALIDATION_ERROR400Request validation failed
METHOD_NOT_ALLOWED405HTTP method not allowed for this endpoint
ENDPOINT_NOT_FOUND404Endpoint does not exist
CONTENT_POLICY422Content policy violation
RATE_LIMIT_EXCEEDED429Too many requests, rate limit exceeded
SERVER_ERROR500Internal server error
ENDPOINT_DISABLED503Endpoint is currently disabled

Example Error Response

json

Detailed Error Examples

Missing API Key
json
Validation Error
json
Model + Quality Conflict
json
Unknown Model
json
Pro Model Without Paid Account
json

Best Practices

Always check status codes before processing responses

Handle rate limits with exponential backoff

Validate file formats before uploading

Check credit balance before making requests

Rate Limiting

All endpoints are rate limited per API key. Rate limit info is included in response headers.

Rate Limit Headers

HeaderDescription
x-ratelimit-limit-requestsMax requests in current window
x-ratelimit-remaining-requestsRequests remaining in window
x-ratelimit-reset-requestsUnix timestamp when window resets

Computation Endpoints

EndpointLimitWindow
/v1/generate5 requests60s
/v1/edit5 requests60s
/v1/convert/ai-vectorize5 requests60s
/v1/convert/trace10 requests60s
/v1/convert/svg-to-vector10 requests60s
/v1/convert/raster-to-raster10 requests60s
/v1/convert/batch5 requests60s
/v1/enhance-prompt10 requests60s
/v1/svg/optimize10 requests60s
/v1/gallery/{id}/download100 requests60s

Free Endpoints

EndpointLimitWindow
/v1/generations1000 requests60s
/v1/generations/{id}1000 requests60s
/v1/generations/{id}/delete100 requests60s
/v1/generations/{id}/share100 requests60s
/v1/generations/{id}/download100 requests60s
/v1/gallery1000 requests60s
/v1/gallery/{id}1000 requests60s
/v1/account1000 requests60s
/v1/account/usage1000 requests60s

Rate Limit Exceeded Response

429 Too Many Requests
json

Rate Limiting Best Practices

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

Get started background

No credit card required