POST /API/V1/CAD/EXTRACT
CAD and drawing extraction
Turn native CAD files and 2D drawings into structured, agent-readable JSON. Upload STEP, IGES, DXF, PDF, or SVG and receive four-cad.extraction.v1: solids with topology and mass properties, drawing entities, measured dimensions, annotations, and an optional Rowe-ready point_cloud_scene.
POST /api/v1/cad/extract
Authenticate with your API key, upload a file up to 25 MB, and pick a target_contract: structured (default) for the agent-readable extraction, point_cloud_scene for Rowe-ready geometry, or both. The endpoint accepts multipart uploads and JSON with base64 content.
https://fourechelon.com/api/v1/cad/extractcurl https://fourechelon.com/api/v1/cad/extract \
-H "Authorization: Bearer $FOUR_ECHELON_API_KEY" \
-F "file=@bracket.step" \
-F "target_contract=both"The same request as JSON with base64-encoded content:
curl https://fourechelon.com/api/v1/cad/extract \
-H "Authorization: Bearer $FOUR_ECHELON_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"file_name\": \"drawing.dxf\",
\"target_contract\": \"structured\",
\"content_base64\": \"$(base64 -i drawing.dxf | tr -d '\n')\"
}"Response schema
Successful extractions return four-cad.extraction.v1. 3D sources fill structure.solids with topology and mass properties; 2D drawings fill structure.entities and structure.dimensions. Sections that do not apply to the source are omitted.
schemastringAlways four-cad.extraction.v1 for successful extractions.
source_formatstringDetected input format (step, stp, iges, igs, dxf, pdf, svg).
unitsstringLength unit of the extraction, for example millimeter.
structure.kindstringbrep for 3D solids, drawing2d for DXF/PDF/SVG drawings.
structure.assembly / structure.solidsarray3D topology: per-solid bbox, volume, surface_area, center_of_mass, face/edge/vertex counts, typed faces (plane, cylinder, ...), and edge_types.
structure.layers / structure.entitiesarray2D drawing content: layers plus typed entities (line, circle, arc, polyline, text, ...) with geometry, layer, and text.
structure.dimensionsarrayMeasured drawing dimensions: dim_type, numeric measurement, display text, and definition points.
structure.annotations / structure.blocks / structure.pagesarrayNotes, reusable block definitions, and page structure when the source has them.
point_cloud_sceneobjectRowe-ready point_clouds[] sampled from the geometry. Present when target_contract is point_cloud_scene or both.
statisticsobjectConverter statistics about the parsed file.
warningsarrayNon-fatal parse warnings. Sections that do not apply to the source format are omitted.
usageobjectMetered spatial tokens: input from uploaded bytes, output from the extraction JSON.
request_idstringRequest id for support and debugging.
{
"schema": "four-cad.extraction.v1",
"source_format": "dxf",
"units": "millimeter",
"structure": {
"kind": "drawing2d",
"layers": ["0", "DIMENSIONS"],
"entities": [
{
"id": "e1",
"type": "line",
"layer": "0",
"geometry": { "start": [0, 0], "end": [120, 0] }
},
{
"id": "e2",
"type": "circle",
"layer": "0",
"geometry": { "center": [60, 40], "radius": 8 }
}
],
"dimensions": [
{
"id": "d1",
"dim_type": "linear",
"measurement": 120.0,
"text": "120",
"defpoints": [[0, 0], [120, 0]]
}
],
"annotations": [],
"blocks": []
},
"point_cloud_scene": {
"point_clouds": [
{
"object_id": "drawing",
"kind": "surface",
"points": [{ "x": 0, "y": 0, "z": 0 }]
}
]
},
"statistics": { "entity_count": 2, "dimension_count": 1 },
"warnings": [],
"file_name": "drawing.dxf",
"target_contract": "both",
"usage": {
"input_tokens": 20890,
"output_tokens": 512,
"estimated_input_cost_usd": 0.02089,
"estimated_output_cost_usd": 0.002048,
"estimated_cost_usd": 0.022938
},
"request_id": "req_..."
}Supported formats
step / stp3D CADISO 10303 STEP solids and assemblies. Preferred 3D input.
iges / igs3D CADIGES solids and surfaces.
dxf2D drawingAutoCAD DXF: layers, entities, dimensions, blocks, annotations.
pdf2D drawingVector PDF drawings parsed into pages and entities.
svg2D drawingSVG vector drawings parsed into entities.
sldprt / sldasmrejected (415)SolidWorks native files are not parsed. Export as STEP and upload the .step file.
Errors and pricing
Extraction is metered like every Rowe request: uploaded bytes count as input spatial tokens and the extraction JSON counts as output spatial tokens at the standard token rates. Only 2xx extractions are billed; converter and validation failures are recorded but never charged.
400invalid_request_errorMissing file/file_name, invalid base64 content, or invalid target_contract.
401authentication_errorMissing, revoked, or invalid API key.
402payment_requiredAn active or trialing paid API subscription is required.
413request_too_largeThe uploaded file exceeds the 25 MB limit.
415unsupported_file_typeFormat outside STEP/STP/IGES/IGS/DXF/PDF/SVG, including SolidWorks files (export STEP).
422converter error (passed through)The converter parsed the request but could not extract the file; its error body is returned unchanged.
502/503converter_unavailableNo converter is configured or the converter cannot be reached. Non-2xx responses are never billed.