---
name: vecsnap
description: Turn an image (logo, icon, illustration) into a clean SVG with the VecSnap API. Use when a task needs an image vectorized, traced or converted to SVG.
---

# VecSnap

Add VecSnap to this project. VecSnap turns an image into a clean SVG.

1. Read https://vecsnap.com/docs/quickstart.md and the API at https://vecsnap.com/docs/api.md
   (the OpenAPI document: https://api.vecsnap.com/v1/openapi).
2. Read the key from VECSNAP_API_KEY. Never write a key into code.
3. Call POST https://api.vecsnap.com/v1/vectorize with the image (multipart, field "file").
   On 200 save files.web. On 202 wait for the webhook, or poll GET /v1/conversions/{id}.
   With the official SDK (@vecsnap/sdk, or vecsnap for Python) vectorize() waits for you.
4. Send an Idempotency-Key on every POST. On 429 wait Retry-After seconds.
   Branch on error.code, never on the message.
5. Use a vs_test_ key until the tests pass. It spends nothing.

## The one call

```bash
curl https://api.vecsnap.com/v1/vectorize \
  -H "Authorization: Bearer $VECSNAP_API_KEY" \
  -F file=@logo.png
```

* 200: the conversion and `files`, a link to each SVG (`files.web`), valid until `filesExpireAt`.
* 202: still converting. Wait for the webhook, or read `GET /v1/conversions/{id}` until `status` ends, then
  `GET /v1/conversions/{id}/download?format=web`.
* An error: `{ error: { code, message, requestId } }`. Branch on `code`: every code is at https://vecsnap.com/docs/errors.md.

## The SDKs

`npm install @vecsnap/sdk` (`new VecSnap().vectorize({ file })` waits for you) · `pip install vecsnap` · `npx vecsnap logo.png`.

## More

The docs: https://vecsnap.com/llms.txt. The API as OpenAPI: https://api.vecsnap.com/v1/openapi.
