Skip to content

API Reference ​

Start the server:

bash
covecto serve --port 3000

All endpoints are under /v1/.


GET /v1/health ​

Health check.

Response 200

json
{
  "status": "ok",
  "version": "0.1.0"
}

GET /v1/metrics ​

Server metrics since startup.

Response 200

json
{
  "request_count": 42,
  "avg_processing_ms": 23.5
}

POST /v1/vectorize ​

Vectorize an image.

Request multipart/form-data

FieldTypeRequiredDescription
filebinary✅Image file (PNG, JPEG, WebP, BMP, GIF, TIFF)
enginestring—auto, spline, pixel-exact (default: auto)
formatstring—svg, pdf, eps (default: svg)
presetstring—vtracer preset: bw, poster, photo
profilestring—Profile: icon, logo, photo, lineart
optimizeboolean—Run SVG optimization (default: true)
optimize_presetstring—default, safe, none
multipassboolean—Multiple optimization passes
color_precisionint—Color quantization precision (1–32)
filter_speckleint—Speckle noise threshold
corner_thresholdint—Corner detection (0–180)
splice_thresholdint—Path splice (0–100)
color_modestring—color or binary
hierarchicalstring—stacked or cutout
path_simplifystring—spline, polygon, none
layer_differenceint—Layer difference threshold
length_thresholdfloat—Minimum path length
max_iterationsint—Max quantization iterations
path_precisionint—Coordinate decimal places

Response 200 (format=svg)

json
{
  "svg": "<svg>...</svg>",
  "engine_used": "spline",
  "metadata": {
    "input_size": [128, 128],
    "svg_byte_size": 4520,
    "path_count": 24,
    "processing_time_ms": 12.3,
    "engine_used": "spline"
  }
}

Response 200 (format=pdf or eps)

Returns raw binary with Content-Type: application/pdf or application/postscript.

Error 400

json
{
  "error": "No file provided"
}

POST /v1/optimize ​

Optimize an existing SVG.

Request multipart/form-data

FieldTypeRequiredDescription
filebinary✅SVG file to optimize
presetstring—default, safe, none (default: default)
multipassboolean—Multiple passes (default: false)
multipass_iterationsint—Pass count (default: 10)

Response 200

json
{
  "svg": "<svg>...</svg>",
  "original_size": 15240,
  "optimized_size": 8120,
  "reduction_pct": 46.7
}

OpenAPI Spec ​

The full OpenAPI 3.1 specification is available in the repository.