Room Studio · Calculation
Full-plan material takeoff
Derive every room, sum room order quantities and pool paint gallons from total net wall area.
Room Studio has no public screen on htcalc.com. Its renovation handoff uses this planner for project costs. This HT Calc screen includes a Plus sample for visitors.
Example result · schemaVersion: 1 See output
- Cost per success
- 1 calculation credit
- Production plans
- Standard, Business, Scale, Enterprise
Plan allowances - Free sandbox
- Not available
Integration example
Make a request
Use a production key scoped to room-studio-plan-takeoff.
Keep the key on your server. A successful call uses 1 calculation credit.
Set HT_PRODUCTION_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.
import { randomUUID } from "node:crypto";
const key = process.env.HT_PRODUCTION_KEY;
if (!key) throw new Error("Set HT_PRODUCTION_KEY on your server.");
const endpoint = "https://calc.hasstechapi.com/v2/calc/room-studio-plan-takeoff";
const input = {
"rooms": [
{
"id": "A",
"label": "Hall",
"unit": "ft",
"height": 8,
"shape": {
"type": "rectangle",
"width": 10,
"depth": 12
},
"fixtureCount": 2,
"openings": [
{
"type": "door",
"width": 3,
"height": 7,
"wallIndex": 0
},
{
"type": "window",
"width": 2,
"height": 3,
"wallIndex": 1,
"sillHeight": 3
},
{
"type": "opening",
"width": 2,
"height": 7,
"wallIndex": 2
}
]
},
{
"id": "B",
"label": "Den",
"unit": "ft",
"height": 10,
"shape": {
"type": "rectangle",
"width": 6,
"depth": 4
}
}
]
};
const requestId = process.env.HT_REQUEST_ID || Date.now() + "." + randomUUID();
// Keep this ID to look up usage if the connection is interrupted.
console.error("Usage lookup ID:", requestId);
const response = await fetch(endpoint, {
method: "POST",
redirect: "error",
headers: {
"Authorization": "Bearer " + key,
"Content-Type": "application/json",
"Idempotency-Key": requestId
},
body: JSON.stringify(input)
});
if (!response.ok) {
const problem = await response.json().catch(() => null);
const code = problem?.error?.code || response.statusText;
const delay = response.headers.get("retry-after");
if (delay) console.error("Retry-After (seconds):", delay);
console.error("HTTP " + response.status + " " + code + ". Usage lookup ID: " + requestId);
if (Array.isArray(problem?.error?.details)) {
for (const issue of problem.error.details) console.error("Input issue:", JSON.stringify(issue));
}
process.exitCode = 1;
} else {
console.log(JSON.stringify(await response.json(), null, 2));
} cURL (shell)
(
set -eu
: "${HT_PRODUCTION_KEY:?Set HT_PRODUCTION_KEY on your server}"
request_id="${HT_REQUEST_ID:-}"
if [ -z "$request_id" ]; then
request_id=$(python3 -c 'import time, uuid; print(str(time.time_ns() // 1000000) + "." + str(uuid.uuid4()))')
fi
printf 'Usage lookup ID: %s\n' "$request_id" >&2
# On INVALID_INPUT, read error.details in the JSON response body.
curl --disable --silent --show-error --fail-with-body --include \
--request POST 'https://calc.hasstechapi.com/v2/calc/room-studio-plan-takeoff' \
--header "Authorization: Bearer $HT_PRODUCTION_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $request_id" \
--data-binary @- <<'HT_INPUT'
{
"rooms": [
{
"id": "A",
"label": "Hall",
"unit": "ft",
"height": 8,
"shape": {
"type": "rectangle",
"width": 10,
"depth": 12
},
"fixtureCount": 2,
"openings": [
{
"type": "door",
"width": 3,
"height": 7,
"wallIndex": 0
},
{
"type": "window",
"width": 2,
"height": 3,
"wallIndex": 1,
"sillHeight": 3
},
{
"type": "opening",
"width": 2,
"height": 7,
"wallIndex": 2
}
]
},
{
"id": "B",
"label": "Den",
"unit": "ft",
"height": 10,
"shape": {
"type": "rectangle",
"width": 6,
"depth": 4
}
}
]
}
HT_INPUT
) If your request fails
400 INVALID_INPUT-
Read
error.detailswhen present. Node prints each issue. cURL returns the JSON body. Eachpathpoints into your request. An empty path refers to the whole body.Check the accepted inputs for required fields, units and ranges. Send the corrected JSON as a new request.
401or403- Check that the server has the bearer key for the endpoint’s environment and that the key includes
room-studio-plan-takeoff. 429- Read the service error code, check your allowance, and wait for the
Retry-Afterinterval when supplied before trying again. - Lost response,
409or503 - Open Request lookup, select the same environment and enter the printed usage lookup ID. A settled ID has already consumed credits. To retry the same calculation, set
HT_REQUEST_IDto the original ID and reuse the same inputs. A settled request does not return its result again. Unset the variable for a new request, which can consume credits.
The usage lookup ID is the Idempotency-Key your server sends. The response’s x-request-id identifies the HTTP exchange for support.
Output
Example result
These values come from running this operation on the example inputs.
schemaVersion- 1
units- imperial
totals.schemaVersion- 1
How to interpret this result
- Ceilings have the same area as the wall-centerline floor polygon. Flooring includes 10% waste. Wall paint assumes two coats and 350 sq ft per gallon.
Full example response (JSON)
{
"status": "available",
"result": {
"schemaVersion": 1,
"units": "imperial",
"rooms": [
{
"schemaVersion": 1,
"roomId": "A",
"roomLabel": "Hall",
"units": "imperial",
"floorAreaSqft": 120,
"ceilingAreaSqft": 120,
"wallAreaGrossSqft": 352,
"openingsAreaSqft": 41,
"wallAreaNetSqft": 311,
"flooringAreaSqft": 120,
"flooringWithWasteSqft": 132,
"perimeterLf": 44,
"baseboardTrimLf": 39,
"crownMoldingLf": 44,
"doorCasingLf": 17,
"windowCasingLf": 10,
"doorCount": 1,
"windowCount": 1,
"openingCount": 1,
"fixtureCount": 2,
"avgCeilingHeightFt": 8,
"boundingBoxFt": {
"width": 10,
"depth": 12
},
"paintGallonsTwoCoats": 2
},
{
"schemaVersion": 1,
"roomId": "B",
"roomLabel": "Den",
"units": "imperial",
"floorAreaSqft": 24,
"ceilingAreaSqft": 24,
"wallAreaGrossSqft": 200,
"openingsAreaSqft": 0,
"wallAreaNetSqft": 200,
"flooringAreaSqft": 24,
"flooringWithWasteSqft": 27,
"perimeterLf": 20,
"baseboardTrimLf": 20,
"crownMoldingLf": 20,
"doorCasingLf": 0,
"windowCasingLf": 0,
"doorCount": 0,
"windowCount": 0,
"openingCount": 0,
"fixtureCount": 0,
"avgCeilingHeightFt": 10,
"boundingBoxFt": {
"width": 6,
"depth": 4
},
"paintGallonsTwoCoats": 2
}
],
"totals": {
"schemaVersion": 1,
"units": "imperial",
"roomCount": 2,
"floorAreaSqft": 144,
"ceilingAreaSqft": 144,
"wallAreaGrossSqft": 552,
"openingsAreaSqft": 41,
"wallAreaNetSqft": 511,
"flooringAreaSqft": 144,
"flooringWithWasteSqft": 159,
"perimeterLf": 64,
"baseboardTrimLf": 59,
"crownMoldingLf": 64,
"doorCasingLf": 17,
"windowCasingLf": 10,
"doorCount": 1,
"windowCount": 1,
"openingCount": 1,
"fixtureCount": 2,
"avgCeilingHeightFt": 8.3,
"paintGallonsTwoCoats": 3
}
},
"formulaVersion": "room-studio-v1",
"units": {
"length": "ft",
"area": "sq ft",
"trim": "linear ft",
"paint": "US gal"
},
"assumptions": [
"Ceilings have the same area as the wall-centerline floor polygon. Flooring includes 10% waste. Wall paint assumes two coats and 350 sq ft per gallon."
],
"warnings": [],
"creditCost": 1
}Request contract
Accepted inputs
Fields for this example. Expand the schema for all supported combinations and limits.
FieldType, units and limits
roomsRequiredRooms in caller order, each with a unique id. Shared walls count once per room face.
Min items 1 · Max items 12rooms[].idRequiredCaller-assigned stable room identifier, unique in the plan.
Min length 1 · Max length 80rooms[].labelRequiredDisplay label for the room.
Min length 1 · Max length 160rooms[].unitRequiredUnit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).
Allowed: "ft", "m"rooms[].heightOptionalCeiling height in input units; defaults to 8 feet if omitted.
Max 1000 · Greater than 0rooms[].shapeRequiredRectangle, right-angle perimeter walk, or measured ordered polygon.
rooms[].shape.typeRequiredrooms[].shape.widthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].shape.depthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openingsOptionalCaller-measured apertures. Missing list means none.
Min items 0 · Max items 32rooms[].openings[].typeRequiredA hinged door, window or uncased pass-through.
Allowed: "door", "window", "opening"rooms[].openings[].wallIndexRequiredZero-based host wall index in the room.
Min 0 · Max 63rooms[].openings[].widthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openings[].heightRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openings[].offsetOptionalOffset from the start of the host wall in input units. Defaults to 0.
Min 0 · Max 1000rooms[].openings[].sillHeightOptionalDistance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.
Min 0 · Max 1000rooms[].fixtureCountOptionalCount of caller-identified fixtures; defaults to 0.
Min 0 · Max 64Example request body (JSON)
{
"rooms": [
{
"id": "A",
"label": "Hall",
"unit": "ft",
"height": 8,
"shape": {
"type": "rectangle",
"width": 10,
"depth": 12
},
"fixtureCount": 2,
"openings": [
{
"type": "door",
"width": 3,
"height": 7,
"wallIndex": 0
},
{
"type": "window",
"width": 2,
"height": 3,
"wallIndex": 1,
"sillHeight": 3
},
{
"type": "opening",
"width": 2,
"height": 7,
"wallIndex": 2
}
]
},
{
"id": "B",
"label": "Den",
"unit": "ft",
"height": 10,
"shape": {
"type": "rectangle",
"width": 6,
"depth": 4
}
}
]
} Full JSON schema
{
"type": "object",
"properties": {
"rooms": {
"type": "array",
"description": "Rooms in caller order, each with a unique id. Shared walls count once per room face.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Caller-assigned stable room identifier, unique in the plan.",
"minLength": 1,
"maxLength": 80
},
"label": {
"type": "string",
"description": "Display label for the room.",
"minLength": 1,
"maxLength": 160
},
"unit": {
"type": "string",
"description": "Unit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).",
"enum": [
"ft",
"m"
]
},
"height": {
"type": "number",
"description": "Ceiling height in input units; defaults to 8 feet if omitted.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"shape": {
"description": "Rectangle, right-angle perimeter walk, or measured ordered polygon.",
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "rectangle"
},
"width": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"depth": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
}
},
"required": [
"type",
"width",
"depth"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "perimeter"
},
"segments": {
"type": "array",
"description": "Ordered wall lengths; start along positive X and turn after each wall.",
"items": {
"type": "object",
"properties": {
"length": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"turn": {
"type": "string",
"description": "Turn after the segment.",
"enum": [
"left",
"right"
]
}
},
"required": [
"length",
"turn"
],
"additionalProperties": false
},
"minItems": 3,
"maxItems": 64
}
},
"required": [
"type",
"segments"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "polygon"
},
"corners": {
"type": "array",
"description": "Ordered corners (clockwise or counterclockwise); omit the repeated final vertex. Wall i connects corner i to the next corner.",
"items": {
"type": "array",
"description": "Wall-start point [x,y] on the floor plane.",
"items": {
"type": "number",
"description": "Signed coordinate in room input units.",
"minimum": -1000,
"maximum": 1000
},
"minItems": 2,
"maxItems": 2
},
"minItems": 3,
"maxItems": 64
},
"wallHeights": {
"type": "array",
"description": "Optional per-wall heights in input units, one per corner. A zero wall height falls back to room height in the takeoff.",
"items": {
"type": "number",
"description": "Wall height in input units.",
"minimum": 0,
"maximum": 1000
},
"minItems": 3,
"maxItems": 64
}
},
"required": [
"type",
"corners"
],
"additionalProperties": false
}
]
},
"openings": {
"type": "array",
"description": "Caller-measured apertures. Missing list means none.",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "A hinged door, window or uncased pass-through.",
"enum": [
"door",
"window",
"opening"
]
},
"wallIndex": {
"type": "integer",
"description": "Zero-based host wall index in the room.",
"minimum": 0,
"maximum": 63
},
"width": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"height": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"offset": {
"type": "number",
"description": "Offset from the start of the host wall in input units. Defaults to 0.",
"minimum": 0,
"maximum": 1000
},
"sillHeight": {
"type": "number",
"description": "Distance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.",
"minimum": 0,
"maximum": 1000
}
},
"required": [
"type",
"wallIndex",
"width",
"height"
],
"additionalProperties": false
},
"minItems": 0,
"maxItems": 32
},
"fixtureCount": {
"type": "integer",
"description": "Count of caller-identified fixtures; defaults to 0.",
"minimum": 0,
"maximum": 64
}
},
"required": [
"id",
"label",
"unit",
"shape"
],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 12
}
},
"required": [
"rooms"
],
"additionalProperties": false
}Production endpoint: POST https://calc.hasstechapi.com/v2/calc/room-studio-plan-takeoff
Formula: room-studio-v1