Generate Figures
POST /v1/figures — patent figure generation from a prompt
Generates a patent-oriented technical figure from a text prompt, optionally guided by reference images.
POST https://patentfig.ai/api/v1/figuresCost: 10 credits per call.
Parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | yes | — | What to draw, up to 10,000 chars. Views, diagram type, and composition are all controlled through the prompt. |
output | "png" | "svg" | no | "png" | png: raster figure via the image-model pipeline. svg: stroke-based line-art SVG (CAD-friendly, fill="none"). |
labeled | boolean | no | false | Add patent-style numeric reference callouts (100, 102, …) with leader lines. |
referenceImageUrls | string[] | no | [] | Up to 4 publicly reachable image URLs (sketches, photos, prior figures) used as the structural baseline. SVG URLs are rasterized automatically. |
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
}'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: truewhen 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.
PatentFig AI Docs