Room Studio · Calculation
Room material cost and renovation budget
Price measured material rows with caller-supplied unit costs and prepare renovation and rehab budget figures.
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 · total: 606 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-material-cost.
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-material-cost";
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
}
}
],
"prices": [
{
"roomId": "A",
"material": "flooring",
"unitCost": 2.5,
"selected": true
},
{
"roomId": "A",
"material": "wall-paint",
"unitCost": 0.5,
"selected": true
},
{
"roomId": "A",
"material": "ceiling-paint",
"unitCost": 2,
"selected": false
},
{
"roomId": "A",
"material": "baseboard",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "door-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "window-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "B",
"material": "flooring",
"unitCost": 2,
"selected": true
}
]
};
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-material-cost' \
--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
}
}
],
"prices": [
{
"roomId": "A",
"material": "flooring",
"unitCost": 2.5,
"selected": true
},
{
"roomId": "A",
"material": "wall-paint",
"unitCost": 0.5,
"selected": true
},
{
"roomId": "A",
"material": "ceiling-paint",
"unitCost": 2,
"selected": false
},
{
"roomId": "A",
"material": "baseboard",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "door-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "window-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "B",
"material": "flooring",
"unitCost": 2,
"selected": true
}
]
}
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-material-cost. 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.
total- 606
renovationBudget- 1000
contingencyRate- 10
Result warnings
- 3 selected material line(s) have no caller price. They contribute $0; the subtotal is not a complete priced estimate.
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.
- Missing unit prices are zero. Round each extended price to whole USD, split the selected line into material and labor, and round 110% of total up to a $500 budget.
Full example response (JSON)
{
"status": "available",
"result": {
"rows": [
{
"roomId": "A",
"material": "flooring",
"name": "Flooring — Hall (incl. 10% waste)",
"category": "Materials",
"quantity": 132,
"unit": "sq ft",
"unitCost": 2.5,
"selected": true,
"extended": 330
},
{
"roomId": "A",
"material": "wall-paint",
"name": "Interior paint — Hall walls (2 coats, ~2 gal)",
"category": "Materials",
"quantity": 311,
"unit": "sq ft",
"unitCost": 0.5,
"selected": true,
"extended": 156
},
{
"roomId": "A",
"material": "ceiling-paint",
"name": "Interior paint — Hall ceiling",
"category": "Materials",
"quantity": 120,
"unit": "sq ft",
"unitCost": 2,
"selected": false,
"extended": 240
},
{
"roomId": "A",
"material": "baseboard",
"name": "Baseboard — Hall",
"category": "Materials",
"quantity": 39,
"unit": "lin ft",
"unitCost": 1,
"selected": true,
"extended": 39
},
{
"roomId": "A",
"material": "door-casing",
"name": "Door casing — Hall (1 door)",
"category": "Materials",
"quantity": 17,
"unit": "lin ft",
"unitCost": 1,
"selected": true,
"extended": 17
},
{
"roomId": "A",
"material": "window-casing",
"name": "Window casing — Hall (1 window)",
"category": "Materials",
"quantity": 10,
"unit": "lin ft",
"unitCost": 1,
"selected": true,
"extended": 10
},
{
"roomId": "B",
"material": "flooring",
"name": "Flooring — Den (incl. 10% waste)",
"category": "Materials",
"quantity": 27,
"unit": "sq ft",
"unitCost": 2,
"selected": true,
"extended": 54
},
{
"roomId": "B",
"material": "wall-paint",
"name": "Interior paint — Den walls (2 coats, ~2 gal)",
"category": "Materials",
"quantity": 200,
"unit": "sq ft",
"unitCost": 0,
"selected": true,
"extended": 0
},
{
"roomId": "B",
"material": "ceiling-paint",
"name": "Interior paint — Den ceiling",
"category": "Materials",
"quantity": 24,
"unit": "sq ft",
"unitCost": 0,
"selected": true,
"extended": 0
},
{
"roomId": "B",
"material": "baseboard",
"name": "Baseboard — Den",
"category": "Materials",
"quantity": 20,
"unit": "lin ft",
"unitCost": 0,
"selected": true,
"extended": 0
}
],
"selectedItems": [
{
"roomId": "A",
"material": "flooring",
"name": "Flooring — Hall (incl. 10% waste)",
"category": "Materials",
"quantity": 132,
"unit": "sq ft",
"estimatedCost": 330,
"materialCost": 165,
"laborCost": 165
},
{
"roomId": "A",
"material": "wall-paint",
"name": "Interior paint — Hall walls (2 coats, ~2 gal)",
"category": "Materials",
"quantity": 311,
"unit": "sq ft",
"estimatedCost": 156,
"materialCost": 78,
"laborCost": 78
},
{
"roomId": "A",
"material": "baseboard",
"name": "Baseboard — Hall",
"category": "Materials",
"quantity": 39,
"unit": "lin ft",
"estimatedCost": 39,
"materialCost": 20,
"laborCost": 19
},
{
"roomId": "A",
"material": "door-casing",
"name": "Door casing — Hall (1 door)",
"category": "Materials",
"quantity": 17,
"unit": "lin ft",
"estimatedCost": 17,
"materialCost": 9,
"laborCost": 8
},
{
"roomId": "A",
"material": "window-casing",
"name": "Window casing — Hall (1 window)",
"category": "Materials",
"quantity": 10,
"unit": "lin ft",
"estimatedCost": 10,
"materialCost": 5,
"laborCost": 5
},
{
"roomId": "B",
"material": "flooring",
"name": "Flooring — Den (incl. 10% waste)",
"category": "Materials",
"quantity": 27,
"unit": "sq ft",
"estimatedCost": 54,
"materialCost": 27,
"laborCost": 27
},
{
"roomId": "B",
"material": "wall-paint",
"name": "Interior paint — Den walls (2 coats, ~2 gal)",
"category": "Materials",
"quantity": 200,
"unit": "sq ft",
"estimatedCost": 0,
"materialCost": 0,
"laborCost": 0
},
{
"roomId": "B",
"material": "ceiling-paint",
"name": "Interior paint — Den ceiling",
"category": "Materials",
"quantity": 24,
"unit": "sq ft",
"estimatedCost": 0,
"materialCost": 0,
"laborCost": 0
},
{
"roomId": "B",
"material": "baseboard",
"name": "Baseboard — Den",
"category": "Materials",
"quantity": 20,
"unit": "lin ft",
"estimatedCost": 0,
"materialCost": 0,
"laborCost": 0
}
],
"total": 606,
"renovationBudget": 1000,
"contingencyRate": 10,
"fixFlipRehabCosts": 606,
"subjectSqft": 144
},
"formulaVersion": "room-studio-v1",
"units": {
"money": "USD",
"unitCost": "USD per printed row unit",
"subjectSqft": "sq ft"
},
"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.",
"Missing unit prices are zero. Round each extended price to whole USD, split the selected line into material and labor, and round 110% of total up to a $500 budget."
],
"warnings": [
"3 selected material line(s) have no caller price. They contribute $0; the subtotal is not a complete priced estimate."
],
"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 64pricesOptionalOne optional price/selection per existing room and material. Omitted rows are included at $0.
Min items 0 · Max items 72prices[].roomIdRequiredCaller-assigned stable room identifier, unique in the plan.
Min length 1 · Max length 80prices[].materialRequiredTakeoff line type.
Allowed: "flooring", "wall-paint", "ceiling-paint", "baseboard", "door-casing", "window-casing"prices[].unitCostRequiredCaller USD price per printed row unit (sq ft or lin ft).
Min 0 · Max 100000prices[].selectedOptionalInclude this row in totals. Defaults to true.
Example 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
}
}
],
"prices": [
{
"roomId": "A",
"material": "flooring",
"unitCost": 2.5,
"selected": true
},
{
"roomId": "A",
"material": "wall-paint",
"unitCost": 0.5,
"selected": true
},
{
"roomId": "A",
"material": "ceiling-paint",
"unitCost": 2,
"selected": false
},
{
"roomId": "A",
"material": "baseboard",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "door-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "A",
"material": "window-casing",
"unitCost": 1,
"selected": true
},
{
"roomId": "B",
"material": "flooring",
"unitCost": 2,
"selected": true
}
]
} 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
},
"prices": {
"type": "array",
"description": "One optional price/selection per existing room and material. Omitted rows are included at $0.",
"items": {
"type": "object",
"properties": {
"roomId": {
"type": "string",
"description": "Caller-assigned stable room identifier, unique in the plan.",
"minLength": 1,
"maxLength": 80
},
"material": {
"type": "string",
"description": "Takeoff line type.",
"enum": [
"flooring",
"wall-paint",
"ceiling-paint",
"baseboard",
"door-casing",
"window-casing"
]
},
"unitCost": {
"type": "number",
"description": "Caller USD price per printed row unit (sq ft or lin ft).",
"minimum": 0,
"maximum": 100000
},
"selected": {
"type": "boolean",
"description": "Include this row in totals. Defaults to true."
}
},
"required": [
"roomId",
"material",
"unitCost"
],
"additionalProperties": false
},
"minItems": 0,
"maxItems": 72
}
},
"required": [
"rooms"
],
"additionalProperties": false
}Production endpoint: POST https://calc.hasstechapi.com/v2/calc/room-studio-material-cost
Formula: room-studio-v1