PatentFig AI API
SkillDocs & knowledgepatentfig is a skill that generates patent-office-compliant figures through the PatentFig AI API. It turns text into patent line art as PNG or SVG, vectorizes drawings to SVG, DXF, or vector PDF, upscales images, and converts files to filing-ready TIFF, PDF, or PNG. Use it when a user asks for patent drawings, patent figures, invention diagrams, or USPTO/EPO submissions.
Use PatentFig AI API in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add PatentFig AI API and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the PatentFig AI API skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Obtain an API key for the PatentFig AI API.
What your AI can do with it
- Generate patent line art from text as PNG or SVG
- Vectorize drawings to SVG, DXF, or vector PDF
- AI-upscale images
- Convert files to filing-ready TIFF, PDF, or PNG
- Produce patent-office-compliant figures for USPTO/EPO
Getting started
- Obtain an API key for the PatentFig AI API.
- Configure the skill with that API key.
- Provide the text or drawing the agent should turn into a patent figure.
- Choose the output format, such as PNG, SVG, TIFF, PDF, DXF, or vector PDF.
- Run the skill and retrieve the generated file.
What this skill tells your AI
The instructions your AI receives, as published by davila7/claude-code-templates in cli-tool/components/skills/creative-design/patentfig/SKILL.md and read by ahel’s review.
Generate and convert patent figures through the PatentFig AI REST API.
- Base URL:
https://patentfig.ai/api/v1 - Auth:
Authorization: Bearer $PATENTFIG_API_KEY - All endpoints are synchronous and return JSON:
{ "success": true, "data": {...} }on success,{ "success": false, "error": { "code", "message" } }on failure. - Generated files are returned as URLs on
https://cdn.patentfig.ai— pass them to the user or feed them into follow-up calls.
Setup
The key comes from the PATENTFIG_API_KEY environment variable. Never hardcode it, print it, or write it into files or logs.
If the variable is not set, tell the user to create a key at https://patentfig.ai/settings/api-keys (requires a PatentFig AI account; keys start with pfig_) and export it:
export PATENTFIG_API_KEY="pfig_..."
Verify connectivity and credit balance (free call):
curl -s https://patentfig.ai/api/v1/credits \
-H "Authorization: Bearer $PATENTFIG_API_KEY"
# → { "success": true, "data": { "balance": 500 } }
Generate a patent figure (10 credits)
POST /figures — the core endpoint. One prompt → one figure. Views, diagram type, and composition are all controlled through the prompt; for a multi-view set (front/side/top), make one call per view.
curl -s -X POST https://patentfig.ai/api/v1/figures \
-H "Authorization: Bearer $PATENTFIG_API_KEY" \
-H "Content-Type: application/json" \
--max-time 300 \
-d '{
"prompt": "Exploded view of a wireless earbud charging case showing lid, hinge, charging coil, and battery",
"output": "svg",
"labeled": true
}'
output:"png"(raster figure) or"svg"(stroke-based line art, CAD-friendly). Default"png".labeled: trueadds patent-style numeric reference callouts (100, 102, …).referenceImageUrls: up to 4 public image URLs (sketch/photo/prior figure) used as the structural baseline.- Response
data.urlis the figure; withoutput: "svg"the full SVG source is also indata.svg.
Prompting tips: name the parts to draw (names tell the model WHAT to draw, not what to label); for flowcharts/block diagrams, name every node explicitly.
Convert an existing image
All three endpoints accept either JSON with imageUrl (public URL) or multipart/form-data with a file field (PNG/JPEG/WebP/TIFF, ≤10 MB).
Vectorize (20 credits) — raster → SVG / DXF / vector PDF:
curl -s -X POST https://patentfig.ai/api/v1/vectorize \
-H "Authorization: Bearer $PATENTFIG_API_KEY" \
-H "Content-Type: application/json" \
--max-time 300 \
-d '{ "imageUrl": "https://example.com/drawing.png", "format": "dxf", "engine": "lineart" }'
engine: "lineart" (default) redraws as clean single-stroke patent line art — use for CAD/DXF. engine: "trace" reproduces the input pixels faithfully, preserving fills — use when output must match the original.
Enhance (20 credits) — AI super-resolution: POST /enhance with scale (2 or 4, controls pixels) and dpi (300 or 600, metadata stamp only).
Convert (20 credits) — filing-ready raster: POST /convert with format (png/tiff/pdf) and dpi (300 or 600).
Full parameter tables for every endpoint: see references/endpoints.md. Machine-readable spec: https://patentfig.ai/api/openapi.yaml
Operational rules
- Set a client timeout of at least 300 seconds — generation and vectorization take from ~20s up to a few minutes.
- Credits are charged only on success; retrying a failed call never double-bills.
- Rate limit: 60 requests/minute per key. On
429back off (start at 5s) and retry. - On
402 INSUFFICIENT_CREDITS, stop and tell the user to top up at https://patentfig.ai/pricing. - On
500 GENERATION_FAILED, one retry is reasonable; persistent failures usually mean the input doesn't suit the pipeline (e.g., a photo sent for line-art vectorization — suggestPOST /figureswith the photo asreferenceImageUrlsinstead). - Before a batch of billable calls, check
GET /creditsand confirm the balance covers it.
Signals
- GitHub stars
- 32k
- Forks
- 4k
- Last commit
- Oct 2026
Questions
- What kinds of figures can it create?
- It creates patent line art from text, vectorizes drawings to SVG, DXF, or vector PDF, upscales images, and converts files to filing-ready TIFF, PDF, or PNG.
- Which patent offices are supported?
- The skill is for patent-office-compliant figures and is used for USPTO and EPO submissions.
- What output formats are available?
- Outputs include PNG, SVG, DXF, vector PDF, and filing-ready TIFF, PDF, or PNG.
- What do I need to start?
- You need an API key for the PatentFig AI API and a way to configure the skill with it.
Advanced
- Item type
- skill
- Key
patentfig- Source
- github.com/davila7/claude-code-templates
github.com/davila7/claude-code-templates
More in Docs & knowledge
Skill · mattpocock
More in Docs & knowledgecanvas-design
Skill · anthropics
More in Docs & knowledgedoc-coauthoring
Skill · anthropics
More in Docs & knowledgewriting-for-agents
Skill · mattpocock
More in Docs & knowledgespec-driven-development
Skill · addyosmani
More in Docs & knowledgedefuddle
Skill · kepano
More in Docs & knowledge