Floor Plan to 3D with the API

API guide

Build the floor plan to 3D flow with the Planner 5D API

The same flow as our demo, step by step: upload a plan, get an editable 3D project, furnish it, then export renders and a 360° walkthrough. Each step shows the result and the API calls that make it.

Examples use curl, the base URL in $P5D_API_BASE_URL and your API key in $P5D_API_TOKEN.

The flow in API calls

Four steps, from a plan image to exports

Every step runs on your server. Your app sends the calls, waits for each job, and shows the results in your own interface.

1Upload and recognisePlan image → Planner 5D project
The recognised project with walls, doors, windows and rooms
POST/recognition
GET/recognition
GET/projects/{key}/document
2FurnishOne call per room, in one style
The project furnished in Scandinavian style
GET/rooms/styles
POST/rooms/furnish
PUT/projects
3Show the projectEditable 2D/3D, in your page
The apartment as a Planner 5D 3D project
GET/projects/{key}/embedded-links
4ExportRenders and 360° walkthrough
A render of the bedroom
POST/projects/{key}/renders
POST/renders/{id}/start
GET/renders/{id}
MinutesRecognition job
About 20 s per roomFurnish proposal
InstantEmbed links
30–50 min per imageNative render jobs

Before you start

Four things every call has in common

Your API key

Send it as Authorization: Bearer. Keep it on your server. Never put it in a page, a link or a log.

Jobs take time

Long tasks return an ID. Save it, then poll the status with a growing wait (for example 10 s, 30 s, 1 min, 2 min).

Some results come on a queue

Furnish and CAD export return a queue name. Read the messages start → result → end from it.

Retry safely

Paid calls take a request_id. Reuse the same one after a timeout, so the job is not created or charged twice.

Step 1 of 4 · Upload and recognise

Turn the plan image into a Planner 5D project

AI finds the walls, doors, windows and rooms and saves them as a new project in your account. The result is structured data you can read, not only a picture.

The uploaded plan
The recognised project
Uploaded image → recognised project
  1. POST/recognition

    Send the file as Base64 text with the base64, prefix. Optional dimensions_info sets the scale: two points on the image and their real length in cm. You get a task id.

    Example request
    { printf '{"data":"base64,'; base64 < plan.png | tr -d '\n'
      printf '","dimensions_info":{"start":[120,840],"end":[620,840],"length_cm":500}}'; } > body.json
    
    curl -s -X POST "$P5D_API_BASE_URL/recognition" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      --data-binary @body.json
    # {"error":0,"id":12345}
  2. GET/recognition

    Find your task in the list and poll until status is finished. You get the new project key in project_hash.

    Example response item
    {"id":12345,"project_hash":"YOUR_PROJECT_KEY",
     "status":"finished",
     "job":{"kind":"recognition","status":"succeeded","terminal":true}}
  3. GET/projects/{key}/document

    Read the full project as JSON. Units are cm. You get the floor with its Room, Wall, Door and Window objects, room types and sizes.

    Example request
    curl -s "$P5D_API_BASE_URL/projects/$KEY/document" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" > project.json
    # Project → items[0] = Floor → Room (x, y, rtype, items: Wall…), Door, Window, Ns

Step 2 of 4 · Furnish

Furnish every room in one style

The furnish service fills one room at a time. Pick one style for the whole home, run it for each room, and save the results into the project.

The apartment furnished in Scandinavian style
Scandinavian style (style ID 23), all rooms
  1. GET/rooms/styles

    List the styles. Use only styles with used_in_ai_smart_wizard: true. Example: Scandinavian is 23.

  2. POST/rooms/furnish

    Send one Room object from the document, a room type and the style. Leave out id. You get a queue name.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/rooms/furnish" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      -d '{"room":[ {"className":"Room","x":3286.6,"y":3828.1,"rtype":10,"items":[…]} ],
           "room_type_id":2,"room_style_id":23}'
    # 201 {"queue":"…"}
  3. READqueue → result

    Read the queue. The result message has the furnished room: the room plus its furniture (Ns items). Nothing is saved yet.

  4. PUT/projects

    Add the furniture of every room to the document, then save the whole scene. Keep all fields you do not change. The last save wins.

    Example request
    jq -n --arg key "$KEY" --rawfile data furnished.json \
      '{key:$key, name:"Apartment, Scandinavian", data:$data}' > save.json
    
    curl -s -X PUT "$P5D_API_BASE_URL/projects" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      --data-binary @save.json
Time
About 20 s per room on the queue
Result
Several proposals per room. Your app picks one.

Step 3 of 4 · Editable 2D/3D project

Show the live project in your own page

The furnished apartment is a normal Planner 5D project. Embed it so users can look at it in 2D and 3D, or keep editing it.

The demo apartment as a Planner 5D 3D project
Explore in 3D

Opens the live project on planner5d.com

  1. GET/projects/{key}/embedded-links

    You get iframe HTML and view URLs for the default, 2D and 3D views. Put the iframe in your page. Example: the demo project in 3D.

    Example request
    curl -s "$P5D_API_BASE_URL/projects/$KEY/embedded-links" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json"
  2. PUT/projects

    Change walls, doors, furniture or materials from your own code, then export again.

Step 4 of 4 · Exports

Export renders and a walkthrough from the project

All native exports use one pattern: prepare the task, start it, then poll until it is finished. Native renders use your render quota, not AI Studio credits.

# the export pattern
POST /projects/{key}/renders   # prepare: kind = render | panorama | walkthrough → {"id":7504}
POST /renders/{id}/start       # start:   {"quality":"draft" | "hd" | "4k"}
GET  /renders/{id}             # poll until finished → image_url

Step 4 · Export a 360° walkthrough

One 360° image for each camera point

A walkthrough is a set of panoramas, one for each saved camera. Your page joins them into a tour with markers and a mini floor plan.

One 360° panorama of the living room, flat
One walkthrough point, 8192×4096 (shown flat)
  1. PUT/projects

    Add a camera to each room in the document, then save. A recognised project has no cameras.

  2. POST/projects/{key}/renders

    kind: "walkthrough" with 1–12 saved camera_ids. You get a render ID with one child per point.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/projects/$KEY/renders" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      -d '{"request_id":"apt-12-tour-v1","kind":"walkthrough",
           "camera_ids":["p144","p145"],"floor":0}'
  3. POST/renders/{id}/start

    Start it. Size is fixed at 8192×4096 for each point.

  4. GET/renders/{id}

    Poll the render and its children. You get an image_url for each point. Show them in a 360° viewer (for example Pannellum). Place the markers from the camera positions in the document.

Time
About 30–50 min per point. Points render one after another.
Output
Equirectangular JPG, 8192×4096, per room

Step 4 · Export renders

Photoreal views of each room

Set a camera for each view, render it natively, then improve it in AI Studio if you want.

Native render of the bedroom
The same render enhanced in AI Studio
Native render → enhanced in AI Studio
  1. POST/projects/{key}/renders

    kind: "render" with your own camera: from and to as [x, height, y] in cm, plus fov. Or use a saved camera.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/projects/$KEY/renders" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      -d '{"request_id":"apt-12-bedroom-v1","kind":"render","floor":0,
           "camera":{"from":[3420,160,3300],"to":[3700,120,3900],"fov":60},
           "light_ceiling":true}'
  2. POST/renders/{id}/start

    Choose {"quality":"4k"} (or hd, draft). Then poll GET /renders/{id} for the image_url.

  3. POST/generation-assets

    Optional enhance: upload the finished render as a file. You get an asset ID.

  4. POST/generations

    Run upscale (sharper, about 2K) or render-image (more photoreal) on the asset. Poll GET /generations/{jobId} for the result link.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/generations" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      -d '{"operation":"upscale","request_id":"apt-12-bedroom-up-v1",
           "source":"YOUR_ASSET_ID","count":1,"maximum_credits":20}'
Time
Native: 30–50 min per image. AI Studio: about 25 s.
Cost
Native: render quota. render-image: 6 credits.

Alternative flow · No 3D project

Only need a picture? One call from plan to visualization

AI Studio turns the plan image into a furnished, photoreal top view. Nothing is modelled in 3D, so you get an image and not an editable project.

The original plan
AI Studio result: a furnished top view
Plan image → floor-plan-3d result
  1. POST/generation-assets

    Upload the plan image (multipart field file). You get an asset ID.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/generation-assets" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -F "file=@plan.png;type=image/png"
  2. POST/generations/quote

    Optional: check the price first.

  3. POST/generations

    operation: "floor-plan-3d" with the asset as source. An instruction can set the look.

    Example request
    curl -s -X POST "$P5D_API_BASE_URL/generations" \
      -H "Authorization: Bearer $P5D_API_TOKEN" \
      -H "Accept: application/json, application/problem+json" \
      -H "Content-Type: application/json" \
      -d '{"operation":"floor-plan-3d","request_id":"apt-12-fp3d-v1",
           "source":"YOUR_ASSET_ID","instruction":"Scandinavian style, light oak floors",
           "count":1,"maximum_credits":20}'
  4. GET/generations/{jobId}

    Poll until succeeded. You get the image link. GET /generations/{jobId}/billing shows the credits charged.

Time
About 20 s
Cost
3 credits