# Vectorizza API > Raster to vector over HTTP: send a PNG, JPEG or WebP image and get back an SVG, PDF, EPS, DXF or PNG vector file. Base URL: https://api.vectorizza.com. Version 1.0.0. ## Authentication Send your API key in the header Authorization: Bearer . Keys are created and revoked in the Vectorizza dashboard. A missing, invalid or revoked key returns 401 unauthorized. Routes without authentication: `GET /v1/openapi.json`, `GET /llms.txt`. ## Modes and credits Every POST /v1/vectorize runs in a mode. production costs 1.0 credit and returns a clean file in any format plus a download token. preview costs 0.2 credit and returns a watermarked SVG plus a download token. test is free and returns a watermarked SVG without a token. POST /v1/download exchanges a token for a clean file in any format: 0.8 credit the first time for a preview token, free for a production token or a preview token already paid. Tokens last 24 hours. Every response after authentication carries X-Credits-Charged and X-Credits-Remaining; a call that fails is not charged. Plans: the output format and some option values depend on the plan of the account that owns the key; a format or value outside the plan returns 403 plan_required with error.resource naming it, without charge. An option sent with its default value never requires a plan. Each key has a per-minute request limit set by the plan; above it the API returns 429 rate_limited, without charge. The table of what each plan includes is at https://vectorizza.com/pricing. ## Routes ### POST /v1/vectorize Vectorize an image. Authentication: API key. Request body (`multipart/form-data`): | Field | Type | Required | Default | Description | |---|---|---|---|---| | `image` | file | yes | | PNG, JPEG or WebP image. | | `mode` | production \| preview \| test | no | `production` | production charges 1.0; preview charges 0.2 and watermarks; test is free and watermarks. | | `format` | svg \| pdf \| eps \| dxf \| png | no | `svg` | Output format. preview and test only accept svg. | | `options` | string (application/json, EngineOptions) | no | | Engine options: a JSON object, sent as text, with the keys of EngineOptions. Omitted options take their default. An unknown name, a wrong type, or a value outside the list or range returns 400 invalid_options. | Responses: - `200`: The vector file. Content-Type: `image/svg+xml`, `application/pdf`, `application/postscript`, `application/dxf`, `image/png`. - Header `X-Credits-Charged`: Credits charged by this call. - Header `X-Credits-Remaining`: Credits available after this call. - Header `X-Download-Token`: Download token, valid for 24 hours (preview and production). - `400`: `invalid_request` (The request is malformed.), `invalid_options` (The options are invalid.) - `401`: `unauthorized` (Missing, invalid or revoked API key.) - `402`: `insufficient_credits` (Not enough credits for this call.) - `403`: `plan_required` (Your plan does not include this resource; error.resource names it.) - `404`: `not_found` (Route not found.) - `413`: `image_too_large` (The image is too large.) - `415`: `unsupported_image` (The image must be PNG, JPEG or WebP.) - `422`: `invalid_image` (The image could not be opened.) - `429`: `rate_limited` (Too many requests for this API key. Wait up to a minute and try again.) - `500`: `internal_error` (Internal error.) - `503`: `engine_unavailable` (The vectorization engine is unavailable. Nothing was charged.) ### POST /v1/download Exchange a download token for a clean file. The image kept with the token is vectorized again with the same options, without watermark, in the requested format. Authentication: API key. Request body (`application/json`): | Field | Type | Required | Default | Description | |---|---|---|---|---| | `token` | string | yes | | Download token from the X-Download-Token header of a vectorize call. | | `format` | svg \| pdf \| eps \| dxf \| png | no | `svg` | Output format. | Responses: - `200`: The clean vector file. Content-Type: `image/svg+xml`, `application/pdf`, `application/postscript`, `application/dxf`, `image/png`. - Header `X-Credits-Charged`: Credits charged by this call. - Header `X-Credits-Remaining`: Credits available after this call. - `400`: `invalid_request` (The request is malformed.) - `401`: `unauthorized` (Missing, invalid or revoked API key.) - `402`: `insufficient_credits` (Not enough credits for this call.) - `403`: `plan_required` (Your plan does not include this resource; error.resource names it.) - `404`: `token_not_found` (The download token does not exist or has expired.), `not_found` (Route not found.) - `429`: `rate_limited` (Too many requests for this API key. Wait up to a minute and try again.) - `500`: `internal_error` (Internal error.) - `503`: `engine_unavailable` (The vectorization engine is unavailable. Nothing was charged.) ### GET /v1/account Account balance. Authentication: API key. Responses: - `200`: The account. Content-Type: `application/json`. Body: `{email: string, credits: string}`. - `401`: `unauthorized` (Missing, invalid or revoked API key.) - `404`: `not_found` (Route not found.) - `429`: `rate_limited` (Too many requests for this API key. Wait up to a minute and try again.) - `500`: `internal_error` (Internal error.) ### GET /v1/openapi.json This document. Authentication: none. Responses: - `200`: OpenAPI 3.1 document. Content-Type: `application/json`. - `404`: `not_found` (Route not found.) - `500`: `internal_error` (Internal error.) ### GET /llms.txt This API described in Markdown for LLM agents (llmstxt.org). Authentication: none. Responses: - `200`: The API reference, generated from this document. Content-Type: `text/plain`. - `404`: `not_found` (Route not found.) - `500`: `internal_error` (Internal error.) ## Errors Body of every error, served as application/json. error.code is stable; error.message is for people and may change; error.resource, only on plan_required, names the format or option the plan does not include. | Code | Status | When | |---|---|---| | `invalid_request` | 400 | The request is malformed. | | `invalid_options` | 400 | The options are invalid. | | `unauthorized` | 401 | Missing, invalid or revoked API key. | | `insufficient_credits` | 402 | Not enough credits for this call. | | `plan_required` | 403 | Your plan does not include this resource; error.resource names it. | | `not_found` | 404 | Route not found. | | `token_not_found` | 404 | The download token does not exist or has expired. | | `image_too_large` | 413 | The image is too large. | | `unsupported_image` | 415 | The image must be PNG, JPEG or WebP. | | `invalid_image` | 422 | The image could not be opened. | | `rate_limited` | 429 | Too many requests for this API key. Wait up to a minute and try again. | | `internal_error` | 500 | Internal error. | | `engine_unavailable` | 503 | The vectorization engine is unavailable. Nothing was charged. | ## Engine options Engine options. All are optional; each omitted option takes its default. | Option | Type | Values or range | Default | Description | |---|---|---|---|---| | `colors` | number | >= 0 | `0` | Maximum number of inks. 0 lets the engine decide. Set a small number to force a short palette, e.g. for screen printing or plotters. | | `tolerance` | number | | `0.6` | How far a curve may stray from the traced edge, in working pixels. Raise for fewer nodes and smoother curves; lower for tighter edges. | | `speckle` | number | | `0` | Smallest region kept, in original-image square pixels; smaller regions merge into a neighbour. 0 = automatic. Raise to remove noise, lower to keep tiny dots. | | `gradientQuality` | number | 0 to 1 | `0.5` | With gradientLevel high: 0 = lighter file (bigger pieces, more error), 1 = more faithful (smaller pieces, many more nodes). | | `maxSide` | number | 1 to 1250 | `1250` | Longest side of the working image in pixels: bigger images are reduced to it, upscaling stops at it. Lower it for speed and less detail; below 1250 it also turns off the automatic fine-line pass. | | `upscale` | number | 0 to 4 | `0` | Enlarge small images before tracing so fine detail survives: 0 = automatic, 1 = never, 2 to 4 = that factor. Never goes past maxSide. | | `denoise` | number | | `2.5` | Strength (pixels) of edge-preserving smoothing before inks are picked; 0 = off. Raise for grainy or JPEG-damaged images, lower to keep texture. | | `paletteRadius` | number | | `4.5` | Colour distance (OKLab x100) within which pixels count as one ink. Raise for fewer, broader inks; lower to split close shades. | | `blotch` | number | | `4` | Multiplier on the speckle area for cleaning up medium blobs and halos of similar colour. Raise to remove bigger blobs. | | `tonalSmooth` | number | | `1.5` | Radius (pixels) for smoothing borders between similar inks into clean edges; 0 = off. Lower to keep ragged tonal detail. | | `sizeFollow` | number | | `1` | Exponent for how curve tolerance grows with image size. Only matters on the large fine-line pass; leave at the default. | | `shadeSplit` | number | | `1.6` | Weight of lightness against hue when grouping inks. Raise to split light and dark steps (shading) into separate inks. | | `flatGap` | number | | `10` | With gradients: internal threshold (OKLab x100) under which neighbouring inks that differ mostly in lightness merge into one flat colour; 0 = off. Leave at the default. | | `mergeHue` | number | | `6` | Largest hue spread (degrees) allowed when merging similar regions; 0 = no hue limit. Lower to keep colour variants apart. | | `farInk` | number | | `7` | Colour distance (OKLab x100): a smooth area farther than this from every ink becomes a new ink; 0 = off. Lower to add more inks. | | `farHue` | number | | `8` | With farInk above 0: hue difference (degrees) that also makes a nearby but differently hued area a new ink, e.g. lips on skin. Lower to separate more hue variants. | | `farDark` | number | | `3.5` | With farInk above 0: lightness step by which a dark area must exceed a near-black line ink to become its own ink. Lower to separate more dark shades (irises, hair). | | `crispFaint` | number | | `0.45` | How much faint but sharp borders get looser, rounder curves. 0 traces them as tightly as strong edges; raise to simplify them more. | | `localHue` | number | | `6` | With high detail and gradients: largest chroma spread (OKLab x100) for grouping same-hue regions into one local gradient; 0 = off. Raise to merge more. | | `rimWidth` | number | | `5` | With rimTrim: largest mean width (working pixels) for a piece to count as an edge band, such as a bevel or frame. Internal; leave at the default. | | `softDelta` | number | | `8` | With softMerge: largest colour difference (OKLab x100) between neighbouring blobs for them to become one shape. Raise to merge more. | | `softEdge` | number | | `0.45` | With softMerge: a border counts as soft when its colour step is below this fraction of the two blobs' colour difference. Raise to let sharper borders merge too. | | `blendWidth` | number | | `2.4` | With dissolveBlend: largest mean width (working pixels) of a thin in-between colour band that is given back to the nearer neighbour. Raise to dissolve wider bands. | | `blendResid` | number | | `0.15` | With dissolveBlend: how far, as a fraction of the neighbours' colour distance, a band may sit off the blend between them and still count as one. Internal; leave at the default. | | `blendCore` | number | | `0.02` | With dissolveBlend: a band whose flat interior exceeds this fraction of its area is kept as a real drawn stripe. Internal; leave at the default. | | `carveDelta` | number | | `5` | With carve: colour deviation (OKLab x100) from the surrounding shape that marks an area to be carved out as its own shape (eye whites, lip lines). Lower to carve more. | | `carveHue` | number | | `5` | With carve: hue deviation (degrees) that also qualifies an area for carving, e.g. lips on skin; 0 = off. | | `spotDelta` | number | | `30` | With carve: how much lighter than its surroundings a small spot must be to come back as a highlight (iris or lip shine); 0 = off. Lower to bring back more highlights. | | `spotMinL` | number | | `70` | With carve and spotDelta above 0: lowest lightness (0 to 100) for a highlight; dimmer spots pass only if round, small and nearly grey. Lower to recover dull highlights. | | `carveEdge` | number | | `3` | With carve: lowest border contrast (OKLab x100) for a carved area to be kept. Raise to keep only crisp-edged areas. | | `gradients` | boolean | | `true` | Allow linear and radial gradient fills. false = flat colours only, the same as gradientLevel flat. | | `gapFiller` | boolean | | `true` | Add thin strokes under the borders between shapes to hide hairline gaps. No effect with stacking stacked. | | `regionColor` | boolean | | `true` | Each flat shape takes the dominant colour of its pixels in the original instead of its palette ink. Turn off for strict palette colours. | | `paletteAll` | boolean | | `true` | With high detail: build the palette from every opaque pixel, not only flat interiors, keeping texture tones in 3D renders and photos. | | `rimTrim` | boolean | | `true` | Trim edge bands (bevels, frames) where they bulge past their usual width; tuned by rimWidth. | | `softMerge` | boolean | | `true` | Merge near-identical blobs with soft borders (airbrush grain) into one shape; tuned by softDelta and softEdge. High detail turns it off unless set. | | `dissolveBlend` | boolean | | `true` | Give thin in-between colour bands between two very different shapes (anti-aliasing, blur) back to the nearer side; tuned by blendWidth, blendResid and blendCore. | | `carve` | boolean | | `true` | Bring back small areas of distinct tone, thin dark lines and highlight spots that the palette swallowed; tuned by the carve and spot options. | | `edgeFromColor` | boolean | | `true` | Place each border by matching edge pixels to the neighbour colour that best explains them, for more accurate anti-aliased edges. | | `gradientLevel` | string | `flat`, `simple`, `normal`, `high`, `heavy` | `normal` | How much gradient the vector gets. flat = none (plotter, screen printing); simple = flat, and tones the eye does not tell apart become one colour; normal = light gradients where the image asks; high = gradient in every varying shape, split until colours match (heaviest files); heavy = same as high. | | `background` | string | `keep`, `outer`, `all` | `all` | Background removal. keep = keep it; outer = remove only the background touching the image border; all = remove the background colour everywhere, including inside letters. | | `stacking` | string | `cutouts`, `stacked` | `cutouts` | cutouts = each shape has its own holes; stacked = each shape continues under the ones above, so paint order matters (turns off gapFiller and grouping). | | `grouping` | string | `merged`, `color`, `layers`, `none` | `merged` | How shapes are organised in the file; the drawing is the same. merged = one shape per colour; color = one group per colour; layers = Background, Shapes, Shadows, Highlights and Outline groups; none = loose pieces. Only with stacking cutouts. | | `detail` | string | `auto`, `normal`, `high`, `painting` | `auto` | Detail level. auto = the engine decides (3D renders and photos get high); normal; high = more tones, less cleanup; painting = high with the palette covering all tones and a gradient in every shape. | | `hints` | array | `{box: [number, number, number, number], mode: smooth \| detail \| simplify}` | `[]` | Regions to treat differently, each {"box":[x0,y0,x1,y1],"mode":...} with the box in original-image pixels. smooth = small object becomes a smooth shape with few inks; detail = thin detail protected from cleanup; simplify = texture becomes a few blobs. | ## Examples Vectorize an image. ```sh curl -X POST "https://api.vectorizza.com/v1/vectorize" \ -H "Authorization: Bearer $VECTORIZZA_API_KEY" \ -F "image=@image.png" \ -F 'mode=production' \ -F 'format=svg' \ -F 'options={"colors":8,"gradientLevel":"flat"}' \ -o result.svg ``` Exchange a download token for a clean file. ```sh curl -X POST "https://api.vectorizza.com/v1/download" \ -H "Authorization: Bearer $VECTORIZZA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"token":"","format":"svg"}' \ -o result.svg ``` Account balance. ```sh curl "https://api.vectorizza.com/v1/account" \ -H "Authorization: Bearer $VECTORIZZA_API_KEY" ``` This document. ```sh curl "https://api.vectorizza.com/v1/openapi.json" ``` This API described in Markdown for LLM agents (llmstxt.org). ```sh curl "https://api.vectorizza.com/llms.txt" ``` ## OpenAPI - [openapi.json](https://api.vectorizza.com/v1/openapi.json): OpenAPI 3.1 document.