Skip to main content
recraft avatar

Recraft Vectorize API

recraft/vectorize

Convert a raster image (PNG/JPG/WEBP logo, icon, or sketch) into a clean, infinitely scalable SVG vector file.

vectorize
0.01

Model Input

Input

The URL of the image to be vectorized. Must be in PNG, JPG or WEBP format, less than 5 MB in size, have resolution less than 16 MP and max dimension less than 4096 pixels, min dimension more than 256 pixels.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Loading
Generated in 8.282 seconds
Logs (1 lines)

Model Example Requests

Examples

Example output 1Example output 2Example output 3

Recraft Vectorize API

Recraft Vectorize is a image-to-image AI model by recraft. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.01 per image.

POST https://queue.modelrunner.run/recraft/vectorize

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/recraft/vectorize \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://media.modelrunner.ai/7gc0Hjq0oiiMMpPh-d_CqdtLiMWBGT6QWQWxAf_WgjcnM2X.png",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/recraft/vectorize/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/recraft/vectorize/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("recraft/vectorize", {
  input: {
    "image_url": "https://media.modelrunner.ai/7gc0Hjq0oiiMMpPh-d_CqdtLiMWBGT6QWQWxAf_WgjcnM2X.png"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/recraft/vectorize",
    headers=headers,
    json={
      "image_url": "https://media.modelrunner.ai/7gc0Hjq0oiiMMpPh-d_CqdtLiMWBGT6QWQWxAf_WgjcnM2X.png"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

NameTypeRequiredDescription
image_urlstring (uri)yesThe URL of the image to be vectorized. Must be in PNG, JPG or WEBP format, less than 5 MB in size, have resolution less than 16 MP and max dimension less than 4096 pixels, min dimension more than 256 pixels.

Machine-readable: OpenAPI schema · llms.txt

Use Recraft Vectorize from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Recraft Vectorize becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint recraft/vectorize.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run recraft/vectorize on ModelRunner to generate image”. MCP setup guide.

Model Details

Model Details

Recraft Vectorize converts an existing raster image — a PNG, JPG, or WEBP logo, icon, sketch, or illustration — into a true vector SVG with clean paths and flat color regions. You supply one source image via `image_url` and it returns a single `.svg` file you can scale to any size, recolor, or edit in vector tools without quality loss. Its strength is faithfully retracing crisp, graphic artwork (logos, line art, simple illustrations) into editable vector geometry rather than re-imagining the image.

## Best for - Turning a flat or pixelated logo into a clean, resolution-independent SVG for print and web - Recovering an editable vector version of an icon or wordmark you only have as a raster - Vectorizing hand-drawn or scanned sketches and line art into scalable paths - Producing scalable brand assets from existing raster graphics

## Choose another model when - You want to generate a new image or vector graphic from a text prompt rather than convert an existing one — use a text-to-image model with vector styles - You need to edit, restyle, or recolor a photo while keeping it raster — use an image-editing model - Your source is a detailed photograph (faces, landscapes, gradients) — vectorization works best on flat, graphic artwork and will not faithfully trace photographic detail

## Tips - Provide the cleanest, highest-contrast source you have: vectorization tracks edges, so crisp line art and flat color regions trace far better than noisy or compressed images - The source must be PNG, JPG, or WEBP, under 5 MB, under 16 MP, with the longest side under 4096 px and the shortest side over 256 px - Output is always a single SVG file (`image/svg+xml`); open it in any vector editor to recolor or reshape paths

## Limitations - Photographs, soft gradients, and fine textures lose fidelity — the result is a graphic approximation, not a pixel-accurate trace - Very intricate artwork can produce dense, hard-to-edit path geometry

To run via the ModelRunner JavaScript client: ```js import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("recraft/vectorize", { input: { image_url: "https://media.modelrunner.ai/q6Ld6hF6jlp3cXSp-vectorize-simple.jpg", }, }); ```