Developer API — get your floor plan 3D model as data
Sketch2Space can hand you your project's 3D model as plain data: every room, wall, door, window, stair, column, and furniture piece, with real-meter positions and sizes. The data already includes all the clean-up our pipeline does (gap closing, wall merging, calibration), so what you rebuild matches what you see in the app. You can also get the tags, notes and room names written on the plan, each tied to the door, window, wall or room it belongs to.
Three ways to use it:
- REST API — fetch the model JSON with any language or tool. Available on every plan.
- Claude skill — a ready-made helper so Claude can answer questions about your projects. Available on every plan.
- MCP server — connect Claude, Cursor, and other AI tools directly, including an
asktool answered by Sketch2Space's own AI. Paid plans.
1. Create an API key#
Click the button below (or in the app, open the menu (☰) → My account → scroll down to API keys):
Open API keysGive the key a name → Create key. Copy the key immediately — it is shown only once. You can hold up to 5 keys.
Each key has an on/off switch: Disable stops it working straight away but keeps it listed, and Enable switches it back on — useful to cut off access without swapping the key out of your scripts. Delete is the permanent one, and it frees up a slot.
Keep keys secret. Anyone with the key can read your projects' model data.
2. REST API#
All endpoints live under https://sketch2space.com/api/v1/dev and authenticate with the key:
curl -H "Authorization: Bearer s2s_your_key" \
https://sketch2space.com/api/v1/dev/projectsGET /me#
Returns { "email": "…" } — the account the key belongs to. Handy when juggling several keys.
GET /projects#
Lists your projects: { items: [{ id, name, status, updatedAt, isExample, buildingId, floorIndex }] }. Use the id in the next call. isExample: true marks the built-in demo project — it does not count toward your plan's project limit. Each floor of a building is its own project: floors of one building share buildingId, and floorIndex counts up from 0 at the bottom (see Buildings with several floors).
POST /projects#
Create a project: {"name": "My house", "description": "optional"} → 201 with the new project. Subject to your plan's project limit — at the cap you get 403 with code PROJECT_LIMIT_REACHED and a message saying to delete a project or upgrade.
POST /projects/{projectId}/floors#
Add a floor on top of the building this project belongs to (any floor's id works): {"name": "First floor"} → 201 with the new floor, including its buildingId and floorIndex. Each floor is a project, so it counts toward your plan's project limit exactly like POST /projects (same 403 at the cap). Then upload the floor's sketch and analyze it like any project. See Buildings with several floors.
PUT /projects/{projectId}/floors/order#
Put the floors of a building in order, the same as dragging them in the app: {"order": ["BASEMENT_ID", "GROUND_ID", "FIRST_ID"]} lists every floor of the building (any floor's id in the path), bottom floor first → 200 with { floors: [...] } in their new order. Leaving a floor out, listing one twice, or a floor of another building answers 400 and nothing changes.
POST /projects/{projectId}/sketch#
Upload the project's sketch as multipart form-data (-F "[email protected]"; JPG/PNG/WebP/TIFF/PDF, plus DWG/DWFX on paid plans). CAD files are converted to a PDF on upload; a pre-2011 binary DWF isn't supported — re-save it as DWFX or PDF. Uploading to a project that already has a sketch replaces it and wipes its previous analysis — that's also how you re-run on a new sketch. Rejected with 422 when the file is too low-resolution or isn't a usable floor plan, and 403 (CAD_UPLOAD_NOT_AVAILABLE) when a CAD upload isn't included in your plan.
Multi-page PDFs — one model is built from one page, so tell us which page with ?page=N (1-based; a page form field works too):
curl -X POST -H "Authorization: Bearer $KEY" \
-F "[email protected]" \
"https://sketch2space.com/api/v1/dev/projects/PROJECT_ID/sketch?page=3"Upload a multi-page PDF without page and it's refused with 422 and code PDF_PAGE_REQUIRED, plus a pageCount field so you know the range — we'd rather ask than spend your analysis run on page 1, which on a multi-sheet set is usually a cover sheet or site plan:
{ "statusCode": 422, "code": "PDF_PAGE_REQUIRED", "pageCount": 7,
"message": "This PDF has 7 pages, so we don't know which one to build. Upload it again with the page you want (1 to 7)." }Only the page you pick is kept as the project's sketch. Single-page PDFs and images ignore page.
POST /projects/{projectId}/analyze and GET /projects/{projectId}/analysis#
analyze starts the full pipeline on the uploaded sketch and returns 202 immediately — it typically runs 1–3 minutes. Poll analysis every ~10 seconds: { "status": "ANALYZING", "progress": { "percent": 42, "phase": "streaming" } } while working; READY, NEEDS_CLARIFICATION, or COMPLETE means the model is ready to fetch; ERROR carries an errorMessage. 409 on analyze means one is already running.
DELETE /projects/{projectId}#
Deletes the project and its files (204). Permanent. A floor of a building is deleted alone and the other floors stay; when the bottom floor's main project is deleted, the next floor up becomes the main project, so the building's buildingId changes.
On the Free and "Pay as you go" plans, projects are also deleted on their own after a set time (shown on the pricing page); after that they no longer appear in GET /projects and their calls answer 404. Ex10ded keeps projects for good.
GET /projects/{projectId}/route#
Walking distance between two points, computed on the real geometry — walls block, doors are open passages. Pass fromX, fromZ, toX, toZ in meters (same space as the model). Returns { "reachable": true, "distanceM": 14.2, "path": [{x, z}, …] }; reachable: false means the points are walled off from each other.
GET /projects/{projectId}/sketch#
Returns the project's original uploaded sketch (image or PDF, as uploaded — for a multi-page PDF, the single page the model was built from). This is the ground truth the model data was extracted from — let your AI look at it for anything the data can't answer: where an open-plan room really is, fixtures drawn on the plan, printed labels and dimensions.
GET /projects/{projectId}/model#
Returns the full model:
{
"schemaVersion": "1",
"project": { "id": "…", "name": "My house" },
"units": "meters",
"coordinateSystem": { "up": "y", "groundPlane": "xz", "rotation": "radians" },
"building": { "totalFloors": 1, "northAngleDeg": 0, "size": { "width": 12.4, "depth": 9.8 } },
"scale": { "source": "doors", "confidence": 0.8,
"detected": { "source": "doors", "confidence": 0.8, "doorsMeasured": 10, "doorsAgreeing": 8 } },
"rooms": [ { "id": "room_living_01", "label": "Living Room", "floorLevel": 0,
"position": { "x": 3.1, "y": 0, "z": 4.2 },
"size": { "width": 5.2, "depth": 4.0, "height": 3.0 },
"area": 20.4, "outline": "traced" } ],
"walls": [ { "id": "wall_01", "start": { "x": 0, "y": 0, "z": 0 }, "end": { "x": 5.7, "y": 0, "z": 0 },
"thickness": 0.2, "height": 3.0, "isExterior": true, "isRailing": false } ],
"doors": [ { "id": "door_01", "hostWallId": "wall_01", "positionAlongWall": 0.35,
"width": 0.9, "height": 2.1, "sillHeight": 0 } ],
"windows": [ … ],
"stairs": [ … ],
"columns": [ … ],
"furniture": [ { "id": "bed_1", "kind": "bed", "position": { "x": 2.0, "z": 6.1 },
"elevation": 0, "rotationY": 1.5708,
"size": { "width": 1.6, "depth": 2.0, "height": 0.5 } } ]
}Everything is in meters. x/z is the floor plane, y is up. rotationY is radians around the vertical axis (0 faces −Z, +π/2 faces +X).
Walls, doors, windows and furniture are measured from the sketch — you can trust them. Room shapes are not all equal: where the walls close a room off we trace its true outline; where they don't, the room is open to its neighbours and simply has no area of its own. Each room says which it is in outline, so check that before you draw a room, compare two rooms, or quote an area. An open-plan kitchen has no area — it has a share of a bigger space, so we give you sharedArea instead of inventing a per-room number. Doing exact geometry on a guessed box (overlaps, "this room crosses a wall") produces confident nonsense.
Field notes:
| Field | Meaning |
|---|---|
scale | How the real size was found and how far to trust it — see Scale below. |
walls[].start/end | Wall centerline segment. Build a box of thickness × height along it. heightStart/heightEnd, when present, slant the top. |
walls[].isRailing | A railing / glass barrier, not a solid wall (railingHeight when set). |
stairs[] | start (bottom) / end (top), width, riserCount. landing: true marks the flat landing between two runs. fromFloorAbove: true marks a run taken from the plan of the floor above — see Buildings with several floors. |
doors[] / windows[] | Cut into the host wall. The opening's center sits at positionAlongWall (0–1 fraction from start to end). sillHeight is the bottom edge above the floor (0 for doors). |
building.outline | The building's outer outline as one {x, z} polygon, traced along the outside face of the outermost walls (present when it can be traced). Draw this for the building's exterior/perimeter — a wall can be partly inside and partly outside, and the outline takes only the truly-outside part. |
walls[].isExterior | True when a good part of the wall faces the outside (computed from the real geometry against building.outline). A flagged wall can still be partly interior — use it for things like "which door is the entrance", not for drawing the exterior. |
walls[].exteriorSpans | The stretch(es) of the wall that really face the outside, as 0–1 fractions along it (from/to, measured start → end). When marking a wall as exterior on a drawing, paint only these stretches — never the full segment. Present only when some part faces the outside. |
rooms[].outline | Read this first — how much of the room's shape we know. traced = we followed the room's own walls, so polygon/area/size/position are solid. merged = the room is open to its neighbours, so it has no area of its own — see sharedArea/sharedWith. estimated = no outline found, so position/size are a guessed box — a rough spot only. |
rooms[].area | Floor area in m², measured from the real outline (the value the app shows when you point at a floor). Present only for traced rooms. Absent means we genuinely don't know it — don't substitute width × depth. |
rooms[].sharedArea / sharedWith | merged rooms only: the area of the one open space the room is part of, and the other rooms sharing it. It belongs to the group, not to any one room — count it once, not per room. |
rooms[].size | Bounding size in meters — width × depth × height, centred on position. Exact when traced, otherwise a rough guess at the room's extent. |
rooms[].polygon | The exact floor outline as {x, z} points. Present only when outline is traced. |
sketchMapping | How to place model coordinates onto the original sketch image (present when the alignment is known). imageBox is the building's box in the image as 0–1 fractions (y down); metersSize is that box in meters. Draw point (x, z) at px = (imageBox.x + x / metersSize.width × imageBox.width) × imageWidth, py = (imageBox.y + (1 − z / metersSize.depth) × imageBox.height) × imageHeight. |
furniture[].elevation | Bottom of the piece above the floor — 0 for floor-standing, e.g. 1.0 for a wall TV. |
furniture[].hostWallId | Present on wall-hung pieces (wall TV, upper cabinet, range hood, wall art). |
furniture[].parentId | Present on parts of a bigger piece (drawer/door front on a cabinet, sink on a counter). Positions are already world coordinates — render them as-is. |
Errors: 401 bad or revoked key, 404 unknown project or no analyzed model yet, 429 rate limit (60 requests/minute per key).
Buildings with several floors#
A building is a stack of projects, one per floor, each with its own sketch, analysis and model. Make the bottom floor with POST /projects, then add each floor above it with POST /projects/{projectId}/floors. A new floor always goes on top; to change the order (say, a basement added last), use PUT /projects/{projectId}/floors/order. The order decides which plan is "the floor above" for the stairs below.
Stairs across floors. A plan usually draws the part of a staircase above the cut line dashed, and that part is easy to miss. On a floor of a building, the model fills in a staircase going up from the plan of the floor above, where the same stairs are drawn solid. Runs added this way carry "fromFloorAbove": true:
"stairs": [
{ "id": "stair_merged_0_0_stair_yolo_0", "start": { "x": 12.99, "y": 0, "z": 6.11 }, "end": { "x": 13.01, "y": 0.88, "z": 4.58 }, "width": 1.1, "riserCount": 5 },
{ "id": "stair_merged_0_0_stair_landing_0", "landing": true, "riserCount": 0, … },
{ "id": "stair_merged_0_0_stair_yolo_1", "start": { "x": 11.79, "y": 0.88, "z": 4.5 }, "end": { "x": 11.82, "y": 1.75, "z": 6.12 }, "width": 1.07, "riserCount": 5, "fromFloorAbove": true }
]Nothing is added on a project that stands alone, and runs that no plan shows are never made up. The floors are lined up the same way as in the app's stacked view.
GET /projects/{projectId}/texts#
The writing on the sketch, with each piece tied to the item it belongs to. Plans carry small codes and notes next to things: "D3" by a door, "W2" by a window, "new 100 mm block wall" by a wall, a room's name inside it. This tells you which door is the "D3", so your software can look D3 up in the plan's door list, price it, or order it.
{
"texts": [
{
"id": "text_1",
"text": "D3",
"kind": "tag",
"position": { "x": 4.2, "z": 1.8 },
"linkedTo": { "kind": "door", "id": "door_yolo_3" },
"confidence": 0.9
},
{
"id": "text_2",
"text": "See detail 4",
"kind": "note",
"position": { "x": 9.8, "z": 0.6 },
"linkedTo": null,
"confidence": null
}
],
"readAt": "2026-11-29T14:05:00.000Z"
}| Field | Meaning |
|---|---|
text | Exactly as written on the sketch, in its own language. |
kind | tag: a short code next to an item ("D3", "W2"). room_name: a room's name. note: any other written note. |
position | Where it is written, in meters, in the same x/z space as the model. |
linkedTo | The item it belongs to: kind is door, window, wall or room, and id is that item's id in the model's doors[], windows[], walls[] or rooms[]. null means no single item is clearly meant: we leave it unlinked rather than guess. |
confidence | 0–1 trust in the link. null when there is no link. |
How the links are made:
- Doors and windows: the plan is read with every door and window numbered, so a tag is tied to the door it is written next to, or joined to by a leader line. The farther the tag sits from that door, the lower the confidence (0.9 within 2 m, 0.7 within 4 m, 0.5 beyond).
- Room names: tied to the room whose name in the model contains it ("3220C" → the room "Office 3220C"), or to the room it is written inside. A space holding several names (for example an open kitchen and living room) is left unlinked, because we can't tell which name owns it.
- Notes about a wall: tied to the nearest wall within 1 m, only when that wall is clearly the nearest.
Good to know:
- Only on demand. The texts are not part of
GET /modeland are never read during an analysis. The plan is read only when you call this endpoint. - The first call for an analysis reads the sketch and takes up to about a minute. Later calls answer at once. Running a new analysis on the project reads the sketch again on the next call.
- It keeps up with changes. If you fix the scale or edit the model afterwards, positions and links follow, with no new read. A link to a door that has since been deleted becomes
null. - Left out on purpose: plain dimension numbers, grid-line bubbles, level marks and the title block. For those, look at the sketch itself (
GET /sketch). - Errors:
404unknown project or no analyzed model yet.422with codeSKETCH_TOO_HEAVYwhen the sketch is a PDF holding pictures too large to read; upload a lighter PDF or an image of the plan.
Scale: check it and fix it#
Every length and area in the model depends on one thing: how big the building really is. A sketch rarely says this outright, so the analysis works it out. If it gets the scale wrong by 10%, every room area is off by about 21%. The model tells you how the scale was found and how far to trust it, and you can correct it with one call.
Step 1: read scale in the model.
"scale": {
"source": "doors",
"confidence": 0.8,
"detected": { "source": "doors", "confidence": 0.8, "doorsMeasured": 10, "doorsAgreeing": 8 }
}source says where the size came from, in the order the analysis tries them:
source | How the size was found | confidence |
|---|---|---|
cad_file | Measured from the units inside the CAD file (DWG/DWFX). | 0.95 |
written_sizes | Read from the sizes written on the sketch. | 0.85 |
doors | Each door is taken as a standard width (0.80 m inside, 0.70 m into a bathroom, 0.95 m for the entrance). The size most doors agree on wins, so a double door or a wide opening doesn't set the scale. | Up to 0.9. Higher when more doors agree. |
ai_estimate | None of the above worked, so this is an estimate of the whole building's size. | 0.3 |
set_by_hand | Someone gave a real size, either in the app's calibrate tool or with POST /calibrate below. | 1 |
unknown | The project was analysed before this was recorded. Run the analysis again to get it. | null |
The doors confidence is the share of doors that agreed, weighted by how many agreed: 1 door counts 0.5, 2 doors 0.7, 3 doors 0.85, and 4 or more count in full. For example, 8 of 10 doors agreeing gives 0.8. A plan with unusual door sizes, or very few doors, gets a low score.
detected always keeps what the analysis found, even after someone calibrates. As a rule of thumb, below 0.7 check one real size before you trust the areas.
You don't multiply anything yourself. The model's numbers already use this scale, and after a fix they all change together.
Step 2 (optional): fix the scale with sizes you know.
POST /projects/{projectId}/calibrate#
Pick one or more items from the model whose real size you know, and send their ids with that size in meters:
- a wall: its real length
- a door or window: its real width
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"references": [
{"id": "wall_yolo_12", "realMeters": 4.20},
{"id": "door_yolo_3", "realMeters": 0.90}
]}' \
"https://sketch2space.com/api/v1/dev/projects/PROJECT_ID/calibrate"The whole building is resized so those items match: every wall, room, door, window and piece of furniture, on every floor of the building. The answer shows what changed and includes the new model, so you don't need another fetch:
{
"sizeChange": 0.79,
"references": [
{ "id": "wall_yolo_12", "kind": "wall", "before": 5.31, "given": 4.2, "after": 4.2 },
{ "id": "door_yolo_3", "kind": "door", "before": 1.14, "given": 0.9, "after": 0.9 }
],
"model": { … }
}sizeChange is how much every length changed (0.79 means 21% shorter). Areas change by that number squared. Afterwards the model's scale.source is set_by_hand with confidence 1.
Good to know:
- Long items are better. A 1 cm mistake on a 90 cm door makes every length in the building over 1% wrong. The same mistake on a 10 m wall makes them 0.1% wrong. Use the longest wall you're sure of. With several items, longer ones count more.
- Items must agree. If one item's size is more than 10% off from the rest, the call is refused with
400, nothing is changed, and the answer lists each item'sbeforeandgivenso you can spot the mistake. A wrong id, a size in feet, or a door's height sent as its width are the usual causes. - It adds up. Calibrating again starts from the current sizes. Sending the sizes the model already shows changes nothing (
sizeChange: 1). - It can be undone in the app with one undo, the same as the app's own calibrate tool.
- 1 to 20 items per call, sizes between 0.05 m and 2000 m. Wall ids and door/window ids come from
walls[],doors[]andwindows[]in the model. - Errors:
400bad input or sizes that disagree,404unknown project or no model yet,409an analysis is running.
3. Claude skill (all plans)#
Two commands — install the skill, then save your key next to it:
mkdir -p ~/.claude/skills/sketch2space-models
curl -o ~/.claude/skills/sketch2space-models/SKILL.md \
https://sketch2space.com/skills/sketch2space-models/SKILL.md
echo "s2s_your_key" >> ~/.claude/skills/sketch2space-models/key.txtThat's it — no environment variables or config to set. Now ask Claude things like "what's the total floor area of My house?" and it reads your key from that file, calls the REST API, and does the reasoning. Nothing extra runs on our side.
What you can ask it to do:
- Answer questions about a project: rooms, areas, walls, doors, windows, stairs, furniture, walking distances.
- Create, analyze and delete projects from a sketch you give it.
- Read the texts on the plan (tags like "D3", notes, room names), each tied to its door, window, wall or room.
- Check and fix the scale from a real size you know (a wall's length, a door's or window's width).
- Build a house with several floors: add floors on top of a building and sort them (e.g. "move the basement to the bottom"). Stairs drawn dashed on one floor's plan are filled in from the floor above.
Several accounts? Put one key per line in key.txt, each followed by a name and the account's email:
s2s_aaa Work [email protected]
s2s_bbb Home [email protected]With a single key the skill just uses it; with several it asks which account you mean (or picks the one you name, e.g. "in my work account").
Updates: an outdated copy of the skill keeps working, and is never refused. When we release a new version, every answer to an older copy carries an update note (the IMPORTANT_MESSAGE_TO_THE_AI_ASSISTANT field and the X-Sketch2Space-Skill-Update header), so Claude tells you to update. To update, re-run the curl line above, then start a new Claude session. (The MCP server needs nothing; it updates on our side.)
Your own scripts that call the REST API are never refused either. The only effect on them: for 12 hours after an outdated skill used the same key, their answers may also carry that extra note field. The rest of the answer is unchanged.
4. MCP server (paid plans)#
Point any MCP-capable AI tool at our server and it gets these tools:
list_projects— your projects.create_project(name)/delete_project(projectId)— manage projects (plan limits apply).add_floor(projectId, name)— add a floor on top of a building, the same asPOST /projects/{projectId}/floorsabove.order_floors(projectId, order)— put a building's floors in order, bottom first, the same asPUT /projects/{projectId}/floors/orderabove.upload_sketch(projectId, filename, mimeType, dataBase64, page?)— upload or replace the sketch (≤15MB). A multi-page PDF needspage— without it the tool answers with the page count so your AI can ask you which page to build.run_analysis(projectId)/analysis_status(projectId)— run the full pipeline and poll until done.get_model(projectId)— the same model JSON as the REST API.get_sketch(projectId)— the original sketch as an image, so your AI can look at the actual plan.route(projectId, fromX, fromZ, toX, toZ)— walking distance between two points (walls block, doors pass).calibrate(projectId, references)— fix the scale from real sizes, the same asPOST /calibrateabove.get_texts(projectId)— tags, notes and room names written on the plan, each tied to its door, window, wall or room, the same asGET /textsabove.ask(projectId, question)— ask in plain language; Sketch2Space's own AI answers using the model data and the sketch image, so your tool gets a short answer instead of the whole JSON. Capped per day by plan (paid: 25 questions/day, custom: 100/day). The same questions can be asked inside the app, where the answer also paints what it refers to — see Ask AI about your floor plan.
Connect from Claude Code:
claude mcp add --transport http sketch2space \
https://sketch2space.com/api/v1/mcp \
--header "Authorization: Bearer s2s_your_key"Endpoint: https://sketch2space.com/api/v1/mcp (Streamable HTTP). Free-plan keys receive 403 MCP_NOT_AVAILABLE.
Several accounts? An MCP connection carries one key, so add the server once per account under different names (e.g. sketch2space-work, sketch2space-home) — your AI tool then picks between them.
What's not included#
The custom lighting you see in the app is a display effect, not model data. Built-in furniture shapes stay in the app — the data gives you each piece's type, position, rotation, and size, and you render your own look for it.