# Image to SVG, in one API call

> Send a PNG, JPEG or WebP image and get a clean, editable SVG back, from your server, your script or your automation tool.

Source: https://perfectvector.com/api

PerfectVector API · Beta

- Add image-to-SVG to your product or internal tools
- Convert logos, icons and illustrations inside your own pipelines
- Pay only for the conversions that succeed

- [Get a free test key](https://perfectvector.com/account/developers)
- [Read the quickstart](https://perfectvector.com/docs/api/quickstart)

From $0.08 per SVG · free test keys

## Why teams choose the PerfectVector API

### Charged only on success

One API credit per SVG delivered. Failed and timed-out conversions, status checks and repeat downloads cost nothing.

### A free test mode that behaves like live

Test keys run the same checks, limits and responses as live keys and return a sample SVG, so you finish the integration before you pay.

### Safe to retry

Send an Idempotency-Key and a retried request returns the same conversion instead of running, or charging, twice.

## What you can build with the PerfectVector API

Build a new service on it, add it to the product you already run, or let it work inside your pipelines.

### Launch a new service

Sell products made from your customers' images.

- Custom decals and cut files
- Personalized engraving orders
- Batch tools for shop sellers

### Add it to your product

Give your users a vector button, without building the engine.

- Design and template editors
- Print-on-demand and merch
- Cutting-machine and sign software

### Automate your pipeline

Convert files as they arrive, with no one clicking.

- Brand asset libraries
- Agency and studio backlogs
- No-code automation tools

Your coding agent can write the integration from the one-page API reference for agents. [Open the reference for agents](https://perfectvector.com/docs/api/agents)

## API capabilities

Everything you need to put image-to-SVG into production.

- [Convert](https://perfectvector.com/docs/api/quickstart): PNG, JPEG or WebP up to 5 MiB, 100 to 4,096 pixels per side, in one multipart request.
- [Wait or poll](https://perfectvector.com/docs/api/waiting-and-async): Get the SVG in the same response, or take the ID and poll while it runs.
- [Results](https://perfectvector.com/docs/api/results): Download links work for 24 hours. Delete a conversion's files at any time.
- [Idempotency](https://perfectvector.com/docs/api/idempotency): Retries with the same key return the same conversion, never a second charge.
- [Test mode](https://perfectvector.com/docs/api/test-mode): Free test keys run the full request and return a sample SVG.
- [Errors and limits](https://perfectvector.com/docs/api/errors): Stable error codes, a request ID on every response, and clear rate-limit headers.

## From key to first SVG in minutes

1. **Create a test key**: Sign in, open the Developer API page of your account and create a key in test mode. It's free.
2. **Send an image**: POST it as multipart form data. Ask for image/svg+xml and the SVG comes back in the same call.
3. **Switch to a live key**: Buy a credit pack, swap in a live key, and you're converting real images. Nothing else changes.

### cURL

```sh
curl https://api.perfectvector.com/v1/vectorizations \
  -H "Authorization: Bearer $PERFECTVECTOR_API_KEY" \
  -H "Idempotency-Key: logo-0001" \
  -H "Accept: image/svg+xml" \
  -F image=@logo.png \
  -o logo.svg
```

### Python

```python
import os
import requests

with open("logo.png", "rb") as image:
    response = requests.post(
        "https://api.perfectvector.com/v1/vectorizations",
        headers={
            "Authorization": f"Bearer {os.environ['PERFECTVECTOR_API_KEY']}",
            "Idempotency-Key": "logo-0001",
            "Accept": "image/svg+xml",
        },
        files={"image": ("logo.png", image)},
        timeout=130,
    )

if response.headers["Content-Type"].startswith("image/svg+xml"):
    with open("logo.svg", "wb") as file:
        file.write(response.content)
```

### Node.js

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

const form = new FormData();
form.append("image", new Blob([await readFile("logo.png")]), "logo.png");

const response = await fetch("https://api.perfectvector.com/v1/vectorizations", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PERFECTVECTOR_API_KEY}`,
    "Idempotency-Key": "logo-0001",
    Accept: "image/svg+xml",
  },
  body: form,
  signal: AbortSignal.timeout(130_000),
});

if (response.headers.get("content-type")?.startsWith("image/svg+xml")) {
  await writeFile("logo.svg", Buffer.from(await response.arrayBuffer()));
}
```

[Full examples with polling and error handling are in the quickstart.](https://perfectvector.com/docs/api/quickstart)

## Credit packs, not subscriptions

Buy once, use for 12 months. One API credit is one successful SVG.

- **Starter** · 10 API credits · Regular price $5, beta price $4 · $0.40 per SVG
- **Bulk 100** · 100 API credits · Regular price $20, beta price $16 · $0.16 per SVG
- **Bulk 1,000** · 1,000 API credits · Regular price $100, beta price $80 · $0.08 per SVG

Beta price, 20% off

[See API pricing](https://perfectvector.com/pricing/api)

Need 10,000 or more API credits? [Talk to sales](mailto:sales@perfectvector.com)

## API questions

### Is the PerfectVector API available now?

Yes. It has been open to everyone as a public beta since November 3, 2026. Create a free test key to start building today.

### What images can I convert?

PNG, JPEG and WebP images up to 5 MiB, each side between 100 and 4,096 pixels. Logos, icons and illustrations with clear shapes give the cleanest SVGs. Each request converts one image with standard settings.

### How does pricing work?

A live conversion uses one API credit when it succeeds. You buy credits in one-time packs, with no subscription and no automatic top-up. Failed conversions, status checks and repeat downloads are free.

### Can I try it before I pay?

Yes. Test keys are free and run the whole request, including key checks, file checks and rate limits, and return a sample SVG. When your integration works, switch to a live key.

### Are API credits the same as website credits?

No. API credits are separate from the credits you use on the website and in AI assistants, and the two never convert into each other. Website plans include no API credits.

### What happens to the images I send?

Your images and SVGs are available for 24 hours, then deleted from storage within 48 hours. You can delete a conversion at once through the API. Your images are never used to train AI models and never sold.

### Should I use the API or PerfectVector MCP?

Use the API when your own software converts images, with an API key. Use PerfectVector MCP when you want to convert images by asking ChatGPT, Claude or another supported assistant, with no code.

## Start building with a free test key

No cost until your integration works. Then one credit per SVG you actually get.

- [Get a free test key](https://perfectvector.com/account/developers)
- [Read the API docs](https://perfectvector.com/docs/api)

Rather ask an AI assistant? [Try PerfectVector MCP](https://perfectvector.com/mcp)

## Explore

[Site index](https://perfectvector.com/llms.txt) — available pages and descriptions.

- [Read the HTML page](https://perfectvector.com/api)
- [PerfectVector API for AI agents (Markdown)](https://perfectvector.com/docs/api/agents.md)
- [PerfectVector MCP (Markdown)](https://perfectvector.com/mcp.md)
- [API pricing (Markdown)](https://perfectvector.com/pricing/api.md)
- [Product facts](https://perfectvector.com/product-facts.md)
- [FAQ](https://perfectvector.com/faq.md)
- [Pricing and credits](https://perfectvector.com/pricing.md)
