How do I vectorize images from a script, an API or an AI agent over MCP?

Updated on

Create an API key in your Homotope account, send the image to POST /api/v1/jobs (or to the vectorize_image tool of the MCP server at https://homotope.app/mcp), poll the job until its state is done, then fetch the SVG, PDF, EPS or DXF: it is server processing, counted against the free plan’s 2 free trial jobs of the month (the same as in the workshop), then the Pro quota, then credits.

Coffee roaster logo grabbed from a website, as a noisy compressed JPEG: a coffee bean on a dark disc inside a thin ring, capital wordmark. JPG · 900 × 640 px
The same logo traced to SVG by Homotope: three clean flat colours, crisp capitals. Engine SVG
900 × 640 px noisy compressed JPEG logo and the SVG produced by the engine, Logo preset, “Number of colours” set to 3, untouched: the JPEG noise and blocks are gone, the disc and its ring stay circles and the capitals stay crisp.
×6 detail: the accented E of the wordmark: JPEG noise and blocks, clean SVG edges. Drag the slider to compare; hover over the image or hold your finger on it to move the magnifier.
Try it with your image Open this example in the workshop

With the REST API

  1. In the workshop, “My account” then “API keys”: create a key. It is shown only once; keep it in a secrets manager.
  2. Send a PNG or JPEG: POST /api/v1/jobs answers straight away with 202 and the job’s identifier.
  3. Poll GET /api/v1/jobs/ID every 2 to 5 seconds until done, then download the SVG, or …/result?format=dxf (pdf, eps, separations).
curl -sS https://homotope.app/api/v1/jobs \
        -H "Authorization: Bearer $HOMOTOPE_API_KEY" \
        -F [email protected] \
        -F 'options={"preset":"logo"}'

      curl -sS https://homotope.app/api/v1/jobs/ID \
        -H "Authorization: Bearer $HOMOTOPE_API_KEY"

      curl -sS -o logo.svg https://homotope.app/api/v1/jobs/ID/svg \
        -H "Authorization: Bearer $HOMOTOPE_API_KEY"

Everything is described in the API documentation and the OpenAPI 3.1 document.

With an AI agent (MCP)

The MCP server lives at https://homotope.app/mcp, over Streamable HTTP, with the Authorization: Bearer header and your key. Tools: vectorize_image, get_job, get_svg, get_result, check_cut (“ready to cut?”), list_vectorizations and get_preview (PNG preview). Same entitlements and limits as the API.

What differs from the workshop

To vectorize without uploading anything, stay in the workshop: see vectorize without uploading. There, with no key, tracing is free. Production exports (DXF, EPS, PDF, separations): 2 free per month with an account, unlimited with Pro; without Pro, 1 credit each beyond those 2.

For a cutting DXF, see image to DXF and convert an image to DXF for a laser.

Frequently asked questions

Does the API have a free trial?

Yes, the same as the workshop: the free plan’s 2 free trial jobs of the month also apply through the API and the MCP server (a trial used anywhere is used everywhere). After that, uploads are refused without Pro quota or credits.

Which formats come back?

SVG, PDF, EPS and DXF, plus per-colour separations; a fixed palette can be set when sending.

Where does the key go?

In the Authorization: Bearer header only, never in a URL or a code repository.

Related questions

Guides and conversions

Try it with your image