LogoPatentFig AI Docs
LogoPatentFig AI Docs
Homepage

Getting Started

Quick StartAuthentication

Endpoints

Generate FiguresVectorizeEnhanceConvertCredits

Reference

Use with AI AgentsErrorsChangelog
X (Twitter)

Generate Figures

POST /v1/figures — patent figure generation from text or images

Generates a patent-oriented technical figure from a text prompt, reference images, or both. Image-only requests use a default patent-drawing instruction.

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

Cost: 10 credits per call.

Parameters

FieldTypeRequiredDefaultDescription
promptstringconditional—What to draw, up to 10,000 chars. Required unless at least one referenceImageUrls entry is provided.
output"png" | "svg"no"png"png: raster figure via the image-model pipeline. svg: stroke-based line-art SVG (CAD-friendly, fill="none").
labeledbooleannofalseAdd patent-style numeric reference callouts (100, 102, …) with leader lines.
referenceImageUrlsstring[]conditional[]Up to 4 publicly reachable HTTP(S) image URLs (sketches, photos, prior figures) used as the structural baseline. Required when prompt is empty. SVG URLs are rasterized automatically.

At least one of prompt or referenceImageUrls must be provided. Local browser blob: preview URLs are never valid API image URLs.

Request

curl -X POST https://patentfig.ai/api/v1/figures \
  -H "Authorization: Bearer pfig_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Front perspective view of an ergonomic vertical computer mouse with a thumb rest and two side buttons",
    "output": "png",
    "labeled": true
  }'

Image-only request:

curl -X POST https://patentfig.ai/api/v1/figures \
  -H "Authorization: Bearer pfig_xxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: figure-from-reference-001" \
  -d '{
    "referenceImageUrls": ["https://example.com/cad-reference.png"],
    "output": "png"
  }'

Response

{
  "success": true,
  "data": {
    "url": "https://cdn.patentfig.ai/api/…/….png",
    "format": "png",
    "creditsConsumed": 10
  }
}

With output: "svg" the response additionally contains the full SVG source in data.svg.

Prompting tips

  • One figure per call. For a multi-view set (front / side / top), make one call per view and state the view in each prompt.
  • Name the parts you want drawn — part names tell the model what to draw, not what to label. Text labels are only added on diagram-type figures (flowcharts, block diagrams) or when you ask for them.
  • For diagrams, name each node explicitly: "Flowchart with steps: receive request, validate input, …".
  • Set labeled: true when you want reference numerals for a specification draft.
  • Generation takes from ~20 seconds up to a few minutes. Use a client timeout of at least 300 seconds.

Errors

Common: INVALID_INPUT (400), INSUFFICIENT_CREDITS (402), GENERATION_FAILED (500). See Errors.

Table of Contents

Parameters
Request
Response
Prompting tips
Errors