Quickstart
Three steps and you are converting images to SVG from your terminal, your scripts or your app.
1 · Create your account
Register on the client portal with your email and a password (10+ characters). No credit card required.
2 · Create an API key
In the portal, create a key. It is shown once — store it safely. Keys look like ptp_live_… and can be revoked at any time.
3 · Call /v1/convert
Send your image as multipart/form-data with your key in the Authorization header. The SVG comes back in the response body.
Your first conversion
curl -sS -f -X POST https://api.pixel-to-path.com/v1/convert \
-H "Authorization: Bearer ptp_live_YOUR_KEY" \
-F "[email protected]" \
-F "colormode=binary" \
-o logo.svg
Interactive reference: pixel-to-path.com/v1/docs (OpenAPI/Swagger).
Authentication
Every request is authenticated with a Bearer token in the Authorization header:
Authorization: Bearer ptp_live_0123abc…
- Keys are secrets: they are stored hashed server-side and displayed only once at creation. Lost key? Revoke it and create a new one.
- One account, several keys: create up to 5 active keys to separate your projects. Your monthly free quota is counted per account, not per key.
- Instant revocation: a revoked key stops working immediately, from the portal or the API response of a banned account.
POST /v1/convert
Upload + conversion in a single stateless call. One successful call costs at most 1 credit — failed, invalid or rate-limited calls cost nothing.
Request (multipart/form-data)
| Field | Type | Default | Description |
|---|---|---|---|
file |
file | — | The image to convert. PNG, JPEG, BMP or WebP · max 20 MB · max 50 Mpx · min 64×64 px. |
colormode |
string | color |
<code>color</code> uses the VTracer engine, <code>binary</code> uses Potrace (black & white). |
mode |
string | spline |
Color (VTracer) only — ignored in binary mode. spline | polygon | none |
hierarchical |
string | stacked |
Color (VTracer) only — ignored in binary mode. stacked | cutout |
filter_speckle |
int | 4 |
Color (VTracer) only — ignored in binary mode. 0–16 — remove small noise patches. |
color_precision |
int | 6 |
Color (VTracer) only — ignored in binary mode. 1–8 — number of significant bits per color channel. |
layer_difference |
int | 16 |
Color (VTracer) only — ignored in binary mode. 0–64 — distance between color layers. |
corner_threshold |
int | 60 |
0–180 — corner detection angle (both engines). |
length_threshold |
float | 4.0 |
3.5–10 — minimum segment length (both engines). |
splice_threshold |
int | 45 |
0–180 — path splicing angle (both engines). |
path_precision |
int | 3 |
0–8 — decimal digits in path coordinates. |
invert |
bool | false |
Binary (Potrace) only — ignored in color mode. Trace the light areas instead of the dark ones. |
turdsize |
int | 2 |
Binary (Potrace) only — ignored in color mode. 0–20 — suppress speckles up to this size. |
alphamax |
float | 1.0 |
Binary (Potrace) only — ignored in color mode. 0–1.334 — corner smoothing threshold. |
opttolerance |
float | 0.2 |
Binary (Potrace) only — ignored in color mode. 0–10 — curve optimization tolerance. |
Two engines, chosen by "colormode"
The API runs the exact same engines as the free online converter and the desktop app:
binary — Potrace
Black & white tracing of line art, scans, sketches and logos. The dark part of the image (grayscale < 50%) is traced on a white background. Fine-tune the output with turdsize (noise removal), alphamax (corner smoothing) and opttolerance (path optimization).
color — VTracer
Layered color vectorization for illustrations, cartoons and photos. Control the level of detail with filter_speckle, color_precision, layer_difference and the curve fitting with mode (spline, polygon, none).
Images are preprocessed exactly like on the website: the longest side is resized to 1500 px before conversion, and the API returns the detected image type (line_art, logo, photo or illustration) in the X-Detected-Type header.
Response
On success: 200 OK with image/svg+xml — the body is the SVG file itself. Informative headers:
| Header | Description |
|---|---|
X-Credits-Remaining | Paid credits left on the account, after this call's debit. |
X-Free-Remaining | Free conversions left this month. |
X-Detected-Type | Detected image type (info): line_art, logo, photo or illustration. |
X-Processing-Time | Server processing time in seconds. |
GET /v1/me
Account status for the key used to call it. Free — never counted against your quota, never debited.
Example response
GET /v1/me
Authorization: Bearer ptp_live_…
{
"key": { "name": "prod", "prefix": "ptp_live_0123abc", … },
"usage": {
"month": "2026-09", "free_used": 7, "free_limit": 10,
"free_remaining": 3, "resets_at": "2026-10-01T00:00:00+00:00"
},
"credits": { "balance": 120 }
}
Errors
Every error returns a consistent JSON envelope. Failed calls never consume credits.
HTTP/1.1 402 Payment Required
{
"error": {
"code": "quota_exceeded",
"message": "Monthly free quota used and no credits left.",
"usage": { "free_used": 10, "free_limit": 10, "credits": 0 }
}
}
| HTTP | Code | When |
|---|---|---|
| 401 | invalid_api_key | Missing, malformed, unknown or revoked API key. |
| 402 | quota_exceeded | Monthly free quota used and no credits left. |
| 403 | account_banned | The account is banned — all its keys are refused. |
| 403 | ip_blocked | Caller IP is blocklisted. |
| 413 | file_too_large | File larger than 20 MB. |
| 422 | invalid_image / image_too_small / invalid_params | Invalid image, image too small or invalid parameter value. |
| 429 | rate_limited | Per-key rate limit exceeded (see below). Includes a Retry-After header. |
| 500 | internal_error | Conversion failed server-side — no credit is charged. |
Rate limits
Limits apply per API key, not per IP, so a shared office or CI runner is never penalized for someone else's traffic.
| Limit | Value |
|---|---|
| Requests per minute, per key | 60 |
| Requests per day, per key | 2 000 |
| Concurrent conversions, per key | 2 (extra calls wait, then 429) |
| Max file size / resolution | 20 MB / 50 Mpx |
Pricing
Every new account gets 10 free conversions every month, no credit card required. Need more? Buy prepaid images — any quantity (in batches of 50), with volume discounts. They never expire and stack with your monthly free quota (free conversions are consumed first).
Free
€0/month
- 10 conversions / month
- Both engines (Potrace + VTracer)
- Up to 5 API keys
Prepaid images
€0.050/ image
| Images | 50–450 | 500–2 450 | 2 500–9 950 | 10 000–49 950 | 50 000+ |
|---|---|---|---|---|---|
| €/image | 0.050 | 0.040 | 0.030 | 0.020 | 0.010 |
- 1 image bought = 1 conversion (credits never expire)
- Never expires, stacks with the free tier
- Any quantity: €0.040/image from 500, down to €0.010/image
Automatic credit: your balance is updated within seconds of the payment, via the payment webhook. Refunds deduct the purchased credits, capped at the current balance. Secure checkout by Lemon Squeezy (VAT handled automatically).
Code examples
Copy-paste and adapt. The API speaks plain multipart/form-data, so any HTTP client works.
cURL
curl -sS -f -X POST https://api.pixel-to-path.com/v1/convert \
-H "Authorization: Bearer ptp_live_YOUR_KEY" \
-F "[email protected]" \
-F "colormode=color" \
-F "filter_speckle=4" \
-o photo.svg
Python
import requests
resp = requests.post(
"https://api.pixel-to-path.com/v1/convert",
headers={"Authorization": "Bearer ptp_live_YOUR_KEY"},
files={"file": open("photo.jpg", "rb")},
data={"colormode": "color", "filter_speckle": 4},
)
resp.raise_for_status()
print(resp.headers["X-Credits-Remaining"], "credits left")
with open("photo.svg", "wb") as f:
f.write(resp.content)
JavaScript
const form = new FormData();
form.append("file", new Blob([imageBytes]), "photo.jpg");
form.append("colormode", "color");
const resp = await fetch("https://api.pixel-to-path.com/v1/convert", {
method: "POST",
headers: { "Authorization": "Bearer ptp_live_YOUR_KEY" },
body: form,
});
if (!resp.ok) {
const { error } = await resp.json();
throw new Error(`${error.code}: ${error.message}`);
}
const svg = await resp.text();
console.log(resp.headers.get("X-Credits-Remaining"), "credits left");
Frequently asked questions
What counts as one conversion?
One successful POST /v1/convert call that returns an SVG. Failed calls (invalid image, wrong parameters, rate limited, server error) and GET /v1/me calls are never charged.
How is the monthly free quota counted?
Per account, on the UTC calendar month — it resets on the 1st at 00:00 UTC. Creating several API keys does not multiply the free quota: all keys of an account share the same 10 free conversions.
Do credits expire?
No. Purchased credits stay on your account until you use them. They are consumed only after your 10 free monthly conversions are exhausted.
How do I get more conversions in a month?
Buy prepaid images from the client portal — any quantity, in batches of 50. You always see exactly how many images you get: 50 images €2.50, 500 images €20, 2,500 €75, 10,000 €200, 50,000 €500. Credits are added to your account automatically within seconds of the payment — no license key, nothing to enter.
What happens if I lose my API key?
Keys are stored hashed, so they cannot be recovered. Revoke the lost key in the portal and create a new one — it takes effect immediately.
Which image formats are supported?
PNG, JPEG, BMP and WebP, up to 20 MB and 50 megapixels, at least 64×64 pixels. Images larger than 1500 px on their longest side are resized before conversion, exactly like on the free website.
Choose Your Version
Same powerful engine - pick the format that fits your workflow.
Online Tool
Free
Convert images right in your browser. No install, no account.
Open the toolDesktop App
Free & open source
The full converter on your machine, for Windows & Linux.
Download freeDesktop App Pro
€39 one-time
Hot folder, batch conversion and CLI for heavy workloads.
Get ProAPI
Free tier + credit packs
One REST call: send an image, get a clean SVG. 10 free/month.
Get an API keyCompare all versions & pricing →
Already have an account? Sign in to the client portal →
Ready to vectorize at scale?
Create your account, grab a key and make your first call in under two minutes.
Get your free API key