The SVG Me image-to-SVG API
Send a PNG, JPG or WebP from your own code and get back a clean SVG (or PDF, EPS or DXF) with a few flat colors, smooth curves and no stray specks. It runs the same engine and settings as the web app, at 1 credit per image: 10¢ each with the 200-credit pack.
Create an API keyGet started
- Create an API key on your account page (sign in and verify your email first). The key is shown once, so store it as a secret.
- Send it as
Authorization: Bearer <key>with each request. - Each successfully converted image uses 1 credit from your account. Failed conversions, re-exports to another file type and converting the exact same result again are free.
- Every converted image is also saved to My SVGs, unlocked, so you can recolor or download it again from the app.
New to it? The step-by-step guide walks through a first request, polling a job, converting a whole folder with synchronous Python or Node.js, and giving your agent a conversion skill. Comparing it with free libraries? See converting images to SVG in Python or Node.js.
Convert an image (sync)
POST /api/v1/convert waits for the conversion (usually a few seconds) and answers with the file. The response headers include X-Conversion-Id, X-Credits-Charged and X-Credits-Remaining.
curl https://svgme.app/api/v1/convert \
-H "Authorization: Bearer $SVGME_API_KEY" \
-F [email protected] \
-F colors=4 \
-o logo.svgEvery option in the app is available as a form field:
curl https://svgme.app/api/v1/convert \
-H "Authorization: Bearer $SVGME_API_KEY" \
-F [email protected] \
-F remove_background=auto \
-F gradients=on \
-F format=layers \
-F file_type=pdf \
-o photo.pdfPrefer JSON? Send image_base64 and an options object, and ask for Accept: application/json to get { id, content, content_type, palette, stats, credits_remaining } back.
curl https://svgme.app/api/v1/convert \
-H "Authorization: Bearer $SVGME_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"image_base64": "'"$(base64 < logo.png)"'", "filename": "logo.png",
"options": {"colors": 4, "recolor": {"#ffffff": null}}}'Queue an image (async)
POST /api/v1/jobs takes the same input and answers 202 straight away, so it suits short HTTP timeouts and large batches. Poll GET /api/v1/jobs/:id (it sends Retry-After while the job runs), then fetch GET /api/v1/jobs/:id/result.
# 1. Submit: answers 202 right away
curl https://svgme.app/api/v1/jobs \
-H "Authorization: Bearer $SVGME_API_KEY" \
-F [email protected] -F colors=3
# {"id":"8c1e…","status":"running","poll_url":"https://svgme.app/api/v1/jobs/8c1e…", …}
# 2. Poll until status is "succeeded" or "failed"
curl https://svgme.app/api/v1/jobs/8c1e… -H "Authorization: Bearer $SVGME_API_KEY"
# 3. Download the file (add ?file_type=dxf or ?format=outline to re-export free)
curl https://svgme.app/api/v1/jobs/8c1e…/result -H "Authorization: Bearer $SVGME_API_KEY" -o logo.svgTo get a result you already paid for in another format, call POST /api/v1/conversions/:id/export with { "format": "sticker", "file_type": "pdf" }. It’s free, like switching formats in the app.
Options
All optional. Without any, the API picks the image type, colors, background and gradients automatically, the way the app’s defaults do. Send them as form fields, as an options JSON field, or in the JSON body.
| Option | Values | What it does |
|---|---|---|
colors | 2–12 | How many colors to trace with. Leave it out for automatic. |
palette | #rrggbb,… | Exact colors to use, comma separated or a JSON list. Overrides colors. |
color_mode | auto, unlimited, two, custom | Usually implied by colors or palette. |
profile | auto, logo-low … photo-high | The image type and detail level. auto detects it, as the app does. |
flatten | auto, white, black, preserve, #rrggbb | What to do with transparency: keep it, or fill it with a color. |
remove_background | false, true, auto | Remove a solid background before tracing. auto only removes a single-color border. |
background_tolerance | 0–100 (20) | How close a color must be to the background to be removed. |
gradients | auto, on, off | Merge banded ramps into smooth gradient fills. |
shading | auto, off, remove, restore | Trace flat paint without shadows, optionally adding a soft shading layer back. |
smoothing | true, false | Smooth jagged outlines. |
fitting | true, false | Fit Bézier curves (fewer nodes). |
resize | recommended, none | Shrink very large images to 1.6 megapixels first, as the app does. |
recolor | {"#from": "#to" | null} | Swap colors in the result; null removes a color. |
format | standard, layers, outline, sticker | Layers by color, cut outlines, or a sticker with a white border and cut line. |
sticker_border | thin, medium, wide | The sticker border width. |
file_type | svg, pdf, eps, dxf | The file you get back. |
AI assistants and agents (MCP)
The same conversions are available as tools on a remote MCP server at https://svgme.app/mcp, for Claude, ChatGPT, Cursor and other assistants. Chat apps connect by signing in; other clients can send an API key as the bearer token. Each conversion costs the same 1 credit. Connect your assistant.
claude mcp add --transport http svgme https://svgme.app/mcpAgents with a shell can use the API through the SVG Me agent skill instead, with your API key. In Claude Code, install it as a plugin:
/plugin marketplace add vchiapaikeo/svgme-tools
/plugin install svgme@svgmeErrors and limits
Errors are JSON: { "code": "…", "message": "…" }. Each key can make 60 requests a minute (see the RateLimit header), each account can run 2 sync conversions at once and have 20 jobs waiting or running, and images can be up to 20 MB.
| Code | Status | Meaning |
|---|---|---|
invalid_api_key | 401 | Missing, mistyped or revoked key. |
payment_required | 402 | Out of credits. Buy more on your account page. |
invalid_option | 400 | An option has a bad value; the message names it. |
missing_image / invalid_image | 400 | No image, or one that can’t be read. |
image_too_large | 413 | Over 20 MB. |
conversion_failed | 422 | The engine couldn’t convert this image. No credit is used. |
rate_limited / too_many_jobs | 429 | Slow down; wait for Retry-After seconds. |
queue_full / engine_unavailable | 503 / 502 | Temporary. Retry with backoff. |
Questions
How good is the output?
It is the same engine as the web app, which beat VTracer and Potrace on accuracy in our tests. Converting and previewing in the web app is free, so you can check your own images first.
How much does it cost?
1 credit per converted image, from the same balance as the app. Credits never expire. Buy them on your account page: 200 for $20 (10¢ an image), 20 for $4 or 6 for $2. No subscription.
Should I use sync or async?
Sync is simplest for one image at a time. Use async when your platform cuts requests off after a few seconds, or to submit many images and collect them later.