# Turn any image into a clean SVG with one call

Send a PNG, JPG, WebP, AVIF, GIF, BMP or TIFF. You get back an SVG with real circles and rectangles and few anchor points, and the figures to prove it. Test keys are free and spend nothing.

1. **Get a test key** Free for every account, on [your developer page](https://vecsnap.com/app/developers). It runs the whole API and spends no credit.
2. **Send one image** One request to `/v1/vectorize`. A slow image answers `202` and finishes by itself; the SDKs wait for you.
3. **Read the file and its figures** Anchor points, file size and formats, in every answer. Your code can check them.

curl:

```bash
curl https://api.vecsnap.com/v1/vectorize \
  -H "Authorization: Bearer $VECSNAP_API_KEY" \
  -H "Accept: image/svg+xml" \
  -F file=@logo.png \
  -L -o logo.svg
```

Node.js:

```js
import { readFile, writeFile } from "node:fs/promises";
import { VecSnap } from "@vecsnap/sdk";

const vecsnap = new VecSnap(); // reads VECSNAP_API_KEY
const result = await vecsnap.vectorize({ file: await readFile("logo.png"), filename: "logo.png" });
await writeFile("logo.svg", await vecsnap.download(result));
console.log(`${result.result?.anchorPoints} anchor points`);
```

Python:

```python
from vecsnap import VecSnap

vecsnap = VecSnap()  # reads VECSNAP_API_KEY
result = vecsnap.vectorize(file=open("logo.png", "rb").read(), filename="logo.png")
open("logo.svg", "wb").write(vecsnap.download(result))
print(result["result"]["anchorPoints"], "anchor points")
```

## For your agent

**Connect your agent in a minute.** Paste one prompt, or install the VecSnap skill. Your agent learns the call, the wait and every error. [More ways](https://vecsnap.com/docs/build-with-ai).

- **Any agent**: The call, the wait and every error, in one prompt.

```text
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.
```

- **Claude Code**: Install the skill. It loads when a task mentions images or SVG.

```text
npx skills add https://vecsnap.com --skill vecsnap
```

- **Cursor**: Add the docs: one index of every page, each as Markdown. [llms.txt](https://vecsnap.com/llms.txt)

- **ChatGPT**: Ask it about these docs, with them open in the chat. [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fvecsnap.com%2Fdocs.md%20and%20help%20me%20add%20the%20VecSnap%20API%20to%20my%20project.)

## What comes back

What a test key returns for any image: the VecSnap mark, drawn by the engine. A live key returns yours, with the same figures.

| Figure | Value | What it is |
| --- | --- | --- |
| Anchor points | 29 | counted as Illustrator and Figma count them |
| File size | 550 bytes | the web file, ready for the web |
| Credits | 0 | a test key spends none; a live image 1, once |

Files: `web.svg`, `design.svg`

## Guides

- [Wait for a result](https://vecsnap.com/docs/wait-for-a-result): Wait in the call, poll, stream events or take a webhook.
- [Webhooks](https://vecsnap.com/docs/webhooks): Signed with Standard Webhooks. Verify in four lines.
- [Errors and retries](https://vecsnap.com/docs/errors): Every code, what it means and what to do next.
- [Keys and test mode](https://vecsnap.com/docs/keys-and-test-mode): A sample result for every call, for free.
- [Credits and unlocking](https://vecsnap.com/docs/credits-and-unlocking): One credit per image. Retries and every other format are free.
- [Go live](https://vecsnap.com/docs/go-live): Live keys come with Pro. The checklist before your first real image.

> Every page is also Markdown: add `.md` to its address. For agents: [llms.txt](https://vecsnap.com/llms.txt), [the OpenAPI document](https://api.vecsnap.com/v1/openapi), [SKILL.md](https://vecsnap.com/docs/skill.md).

---
This page: https://vecsnap.com/docs
