ImageToSVG

API Documentation

REST API v1 — Base URL: https://imagetosvg.com

Authentication

All /api/v1/* endpoints require a Bearer API key. Get a key from Settings → API Keys (requires a paid plan).

Authorization: Bearer sk_img_<your-key>

Credits

1 credit per successful conversion via /api/v1/convert

Free tier: 5 conversions/day via the web app (no API key needed)

Starter plan ($9.99/mo): 100 credits/month + API access

Pro plan ($29/mo): 500 credits/month + API access

View all plans →

Endpoints

POST/api/v1/convert

Convert a single image to SVG. Costs 1 credit. Returns the SVG inline.

Request

POST /api/v1/convert
Authorization: Bearer sk_img_...
Content-Type: multipart/form-data

image      (file)    required — PNG, JPG, WEBP, GIF, BMP, TIFF · max 15 MB
preset     (string)  optional — default | icon | art | photo
colorMode  (string)  optional — color (default) | bw

Response 200

{
  "success": true,
  "id": "a1b2c3d4-...",
  "url": "/api/download/a1b2c3d4-...",
  "imageType": "logo",
  "originalSize": 48291,
  "optimizedSize": 3104,
  "savings": 93.6,
  "creditsRemaining": 97
}

Error codes

401 — Missing or invalid API key

402 — No credits remaining

413 — File too large or image dimensions > 8192px

415 — Unsupported image format

GET/api/download/:id

Download the SVG file by conversion ID (from the id field in the convert response). No auth required — IDs are UUIDs, effectively private by obscurity.

Returns Content-Type: image/svg+xml with Content-Disposition: attachment.

GET/api/v1/keys

List your API keys (metadata only — actual keys are never returned after creation). Requires Supabase session JWT in the Authorization header.

{
  "keys": [
    {
      "id": "uuid",
      "name": "Production",
      "prefix": "sk_img_abc1",
      "createdAt": "2026-06-01T00:00:00Z",
      "lastUsedAt": "2026-06-30T12:00:00Z"
    }
  ]
}
POST/api/v1/keys

Create a new API key. The key field is returned once only — store it securely. Requires a paid plan.

POST /api/v1/keys
Authorization: Bearer <supabase-jwt>
Content-Type: application/json

{ "name": "Production" }
{
  "id": "uuid",
  "name": "Production",
  "prefix": "sk_img_abc1",
  "key": "sk_img_abc1def2...",   ← shown once
  "createdAt": "2026-06-30T00:00:00Z"
}
DELETE/api/v1/keys

Revoke an API key immediately.

DELETE /api/v1/keys
Authorization: Bearer <supabase-jwt>
Content-Type: application/json

{ "id": "uuid-of-key-to-revoke" }

Code Examples

Node.js / fetch

import fs from "fs";

const form = new FormData();
form.append("image", new Blob([fs.readFileSync("logo.png")], { type: "image/png" }), "logo.png");
form.append("preset", "logo");

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

const { id, savings, creditsRemaining } = await res.json();
console.log(`Saved ${savings}% — download: https://imagetosvg.com/api/download/${id}`);

Python / requests

import requests

with open("logo.png", "rb") as f:
    res = requests.post(
        "https://imagetosvg.com/api/v1/convert",
        headers={"Authorization": "Bearer sk_img_..."},
        files={"image": ("logo.png", f, "image/png")},
        data={"preset": "logo"},
    )

data = res.json()
print(f"Saved {data['savings']}% — id: {data['id']}")

cURL

curl -X POST https://imagetosvg.com/api/v1/convert   -H "Authorization: Bearer sk_img_..."   -F "[email protected]"   -F "preset=logo"

Rate Limits

API key requests are credit-limited, not rate-limited by time. You can send as many requests as you have credits.

If you need high-volume processing, use batch processing to convert up to 20 images per request.