/api/vectorizeRequest
Send the file using multipart/form-data. Let your HTTP client set the content type, including the multipart boundary.
| Field | Type | Required | Description |
|---|---|---|---|
image |
File | Yes | A PNG or JPEG, within the file limits |
The public URL is https://vectali.com/api/vectorize. The current endpoint does not require an Authorization header. No query parameters or processing options are part of this contract.
curl --fail-with-body \
--request POST \
--form 'image=@logo.png' \
https://vectali.com/api/vectorize \
--output result.jsonconst form = new FormData();
form.append("image", file);
const response = await fetch("/api/vectorize", {
method: "POST",
body: form,
});
const result = await response.json();
if (!response.ok) throw new Error(result.error);
const svg = result.svg;from pathlib import Path
import requests
with open("logo.png", "rb") as image:
response = requests.post(
"https://vectali.com/api/vectorize",
files={"image": ("logo.png", image, "image/png")},
timeout=60,
)
response.raise_for_status()
Path("logo.svg").write_text(response.json()["svg"], encoding="utf-8")Successful response
HTTP 200 returns application/json with an svg string, the output format, and information about this conversion. Responses use Cache-Control: no-store.
See the response fields for types and an illustrative payload.
Errors
An invalid request returns a non-success status code and JSON with an error message. Read the body as JSON before deciding what to show in your interface.
const response = await fetch("/api/vectorize", { method: "POST", body: form });
const result = await response.json();
if (!response.ok) {
throw new Error(result.error ?? `Conversion failed (${response.status}).`);
}
See errors for 400, 413, 415, 422, and service failures.
Calling from a different origin
Use your application’s server to call Vectali when the browser page is hosted on another origin. The current endpoint does not declare cross-origin access headers. A successful server request does not imply the same request is allowed directly from any browser origin.