Vectorize Image

Submit an image and convert it to vector SVG. Returns the SVG content directly in the response.

Quick Reference

POST/api/v1/vectorizemultipart/form-datahttps://api.veclify.com

Authentication

Include an Authorization header with your API key:

Authorization: Bearer vf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Obtain an API key from the API Keys page.

Vectorize Image POST /api/v1/vectorize

Request

MethodPOST
Content-Typemultipart/form-data
Base URLhttps://api.veclify.com
AuthBearer Token

Form Fields

FieldTypeRequiredDescription
imageFileYesImage file (PNG / JPG / WebP, ≤10MB)
paramsString (JSON)NoJSON string of vectorization parameters

Params Object

ParameterTypeDefaultDescription
modestring"auto"Recognition mode: auto / photo / sketch
colorPrecisioninteger6Color precision (1–8)
layerDifferenceinteger1Layer difference threshold (0–5)
cornerThresholdinteger60Corner detection threshold (0–180)
pathPrecisioninteger4Path precision (1–10)
filterSpeckleinteger0Speckle filtering (0–20)
segmentLengthinteger10Segment length (1–20)
spliceThresholdinteger45Splice threshold (1–90)
inputEnhancebooleanfalsePreprocess enhance before vectorizing
curveModestring"auto"Curve mode: auto / polygon / spline / none

Response Fields (200 OK)

FieldTypeDescription
idstringUnique task/conversion ID (e.g. vec_lx..._ab3f2k)
svgstringFull SVG markup content
widthintegerOriginal image width in pixels
heightintegerOriginal image height in pixels
node_countintegerNumber of SVG path nodes in the output
processing_time_msintegerBackend processing time in milliseconds
credits_remaininginteger | nullRemaining credits (Free plan users only; null for Pro/Lifetime)

Example Response (200)

{
  "id": "vec_m4x8k2_ab3f2k",
  "svg": "<svg xmlns=\"http://www.w3.org/2000/svg" width=\"512" height=\"512" viewBox=\"0 0 512 512">\n  <path d=\"M256 32L32 480h448L256 32z" fill=\"#4f46e5"/>\n</svg>",
  "width": 512,
  "height": 512,
  "node_count": 3,
  "processing_time_ms": 847,
  "credits_remaining": 42
}

Example Error Responses

401 — Invalid API Key

{ "error": "Invalid API key" }

402 — Insufficient Credits

{ "error": "insufficient_credits", "credits_remaining": 0 }

400 — Missing Image

{ "error": "Missing 'image' field in form data" }

429 — Rate Limited

{ "error": "Rate limit exceeded. Try again in 12 seconds." }

Error Codes Reference

StatusCodeDescription
401Missing or invalid API key
402insufficient_creditsInsufficient credits on account
403Account is suspended or banned
400Invalid request parameters or missing file
429Rate limit exceeded — retry after the indicated seconds
502Vectorization backend processing failed
503Backend service unavailable
500Internal server error

Code Examples

cURL

curl -X POST https://api.veclify.com/api/v1/vectorize \
  -H "Authorization: Bearer vf_YOUR_API_KEY" \
  -F "[email protected]" \
  -F 'params={"mode":"auto","colorPrecision":6}'

# Example response:
# {
#   "id": "vec_m4x8k2_ab3f2k",
#   "svg": "<svg xmlns=...>...</svg>",
#   "width": 512,
#   "height": 512,
#   "node_count": 48,
#   "processing_time_ms": 847,
#   "credits_remaining": 42
# }

Python

import requests

url = "https://api.veclify.com/api/v1/vectorize"
headers = {"Authorization": "Bearer vf_YOUR_API_KEY"}

with open("logo.png", "rb") as f:
    files = {"image": ("logo.png", f, "image/png")}
    data = {"params": '{"mode":"auto","colorPrecision":6}'}
    resp = requests.post(url, headers=headers, files=files, data=data)

result = resp.json()
print(f"Task ID: {result['id']}")
print(f"Nodes: {result['node_count']}, Time: {result['processing_time_ms']}ms")
print(f"Credits remaining: {result.get('credits_remaining', 'N/A')}")

# Save SVG to file
with open("output.svg", "w") as out:
    out.write(result["svg"])

Node.js / TypeScript

import fs from "fs";

const form = new FormData();
form.append("image", new Blob([fs.readFileSync("logo.png")]), "logo.png");
form.append("params", JSON.stringify({ mode: "auto", colorPrecision: 6 }));

const res = await fetch("https://api.veclify.com/api/v1/vectorize", {
  method: "POST",
  headers: { Authorization: "Bearer vf_YOUR_API_KEY" },
  body: form,
});

const result = await res.json();
console.log(`Task: ${result.id}, Nodes: ${result.node_count}`);

fs.writeFileSync("output.svg", result.svg);

Rate Limits

PlanRate LimitCreditsConcurrency
Pro / LifetimeUnlimitedN/A (unlimited)No restriction
FreePer-second burst protection1 credit per vectorization1 concurrent request