Image-to-CAD

Generate a 3D CAD file from one or more reference images.

POST /v1/image-to-cad
Content-Type: multipart/form-data
Authorization: Bearer mk_pub_...

Returns 202 Accepted immediately with a job_id. The file is ready asynchronously — retrieve it via polling or webhook.


Request

This endpoint uses multipart/form-data (not JSON).

Form Fields

Field Type Required Default Description
image file (repeatable) 1–3 image files. Each ≤ 10 MB.
design_mode string "standard" "standard" or "assembly".
output_format string "STEP" "STEP", "STL", "GLB", or "3MF".
callback_url string (HTTPS URL) Webhook endpoint. Must be HTTPS. Omit to use polling or dashboard.
prompt string Optional context hint (e.g. "front view and right-side view"). Helps when submitting multiple images.
metadata_json string {} A JSON-encoded object (e.g. '{"ref":"part-42"}'). Echoed back on the job response.

Accepted Image Types

MIME type Notes
image/png Recommended for drawings and sketches
image/jpeg Recommended for photos
image/webp Supported
image/gif Static frame only; animated GIFs use first frame

Max file size: 10 MB per image
Max images: 3

Design Modes

Mode Description
"standard" Single-part reconstruction from one or more views.
"assembly" Multi-part reconstruction. Use when the image shows an assembly of distinct components.

What Makes a Good Source Image

Image quality is the single biggest factor in output accuracy. The pipeline uses computer vision to extract edges and interpret geometry — garbage in, garbage out.

Best results

  • Single part with a clean, neutral (white or light grey) background
  • Orthographic views (top, front, side) rather than angled perspective photos
  • Dimensioned engineering drawings — highest accuracy, measurements used directly
  • Hand sketches with labeled dimensions — good accuracy, often faster to produce than a photo
  • Multiple views — submit 2–3 images of the same part from different angles with a prompt hint: "front view, side view, and isometric view of the same part"

What does NOT work

  • Blurry or low-contrast images — edge detection degrades rapidly
  • Photos with cluttered backgrounds, shadows, or reflections obscuring edges
  • Images that include hands, rulers, packaging, or unrelated objects
  • Photos of assembled products where internal geometry is occluded by other parts
  • Organic shapes (cloth, food, skin, terrain) — not representable as B-rep CAD
  • Fine PCB or electronic component detail

Note: Image resolution is rarely the limiting factor. A sharp 1MP image outperforms a blurry 12MP image. Focus on clarity and contrast.


Response

202 Accepted

{
  "job_id": "pub_a1b2c3d4e5f6",
  "status": "queued"
}

Poll GET /v1/jobs/{job_id} or wait for a webhook. See async-jobs.md.


Code Examples

curl

curl -X POST https://api.makistry.ai/v1/image-to-cad \
  -H "Authorization: Bearer mk_pub_YOUR_KEY" \
  -F "image=@part_front.png" \
  -F "image=@part_side.png" \
  -F "prompt=front view and right-side view of the same bracket" \
  -F "output_format=STEP"

Python

import httpx

with open("part_front.png", "rb") as f1, open("part_side.png", "rb") as f2:
    resp = httpx.post(
        "https://api.makistry.ai/v1/image-to-cad",
        headers={"Authorization": "Bearer mk_pub_YOUR_KEY"},
        data={
            "prompt": "front view and right-side view of the same bracket",
            "output_format": "STEP",
        },
        files=[
            ("image", ("part_front.png", f1, "image/png")),
            ("image", ("part_side.png", f2, "image/png")),
        ],
    )
resp.raise_for_status()
job_id = resp.json()["job_id"]

Node.js

const form = new FormData();
form.append("image", new Blob([fs.readFileSync("part_front.png")], { type: "image/png" }), "part_front.png");
form.append("image", new Blob([fs.readFileSync("part_side.png")], { type: "image/png" }), "part_side.png");
form.append("prompt", "front view and right-side view of the same bracket");
form.append("output_format", "STEP");

const resp = await fetch("https://api.makistry.ai/v1/image-to-cad", {
  method: "POST",
  headers: { "Authorization": "Bearer mk_pub_YOUR_KEY" },
  body: form,
});
const { job_id } = await resp.json();

Tips

  • Supply a prompt hint whenever submitting multiple images — it removes ambiguity about what each view shows
  • For complex assemblies, use design_mode: "assembly" and submit views from multiple angles
  • Dimensioned drawings always outperform undimensioned photos — if you have a drawing, use it
  • Handle job failures (including image_parse_failed): see errors.md
  • See prompt-image-guide.md for a detailed guide with examples