LogoPatentFig AI Docs
LogoPatentFig AI Docs
Homepage

Getting Started

Quick StartAuthentication

Endpoints

Generate FiguresVectorizeEnhanceConvertCredits

Reference

Use with AI AgentsErrorsChangelog
X (Twitter)

Vectorize

POST /v1/vectorize — raster image to SVG, DXF, or vector PDF

Converts a raster image into an editable vector file.

POST https://patentfig.ai/api/v1/vectorize

Cost: 20 credits per call.

Image input

Two forms, shared by all image-accepting endpoints:

  • JSON body with imageUrl — a publicly reachable URL, or
  • multipart/form-data with a file field.

Accepted formats: PNG, JPEG, WebP, TIFF. Max 10 MB.

Parameters

FieldTypeRequiredDefaultDescription
imageUrl / filestring / fileyes—The image to vectorize.
format"svg" | "dxf" | "pdf"no"svg"Output format. PDF embeds the SVG for later extraction.
engine"lineart" | "trace"no"lineart"See below.

Choosing an engine

  • lineart — AI redraws the figure as clean single-stroke patent line art. Each drawn line becomes one path, which is what makes DXF usable in CAD. Best for patent figures.
  • trace — traces the input pixels faithfully, preserving fills and shading. Best when the vector output must match the original image. Note: trace produces filled outlines, so DXF output may contain double lines — prefer lineart for CAD.

Request

curl -X POST https://patentfig.ai/api/v1/vectorize \
  -H "Authorization: Bearer pfig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "imageUrl": "https://example.com/drawing.png",
    "format": "dxf",
    "engine": "lineart"
  }'

Response

{
  "success": true,
  "data": {
    "url": "https://cdn.patentfig.ai/api/…/….dxf",
    "format": "dxf",
    "engine": "lineart",
    "creditsConsumed": 20
  }
}

Errors

Common: INVALID_INPUT (400), FETCH_FAILED (422, imageUrl unreachable), INSUFFICIENT_CREDITS (402), GENERATION_FAILED (500). See Errors.

Table of Contents

Image input
Parameters
Choosing an engine
Request
Response
Errors