estimate_cost
Calculate a 3D print job's material and electricity cost from an already-sliced G-code file, using filament totals and printer power settings.
Instructions
Estimate the cost of a print job from a G-code file (already-sliced only).
For STL/OBJ files, use ``slice_and_estimate`` instead — it slices
and estimates in one step.
The slicer's own ``filament used`` totals are the filament
figures when the file carries them; otherwise Kiln counts the
extruding moves itself. ``estimate.filament_source`` says which,
and a ``warnings`` entry names both numbers when Kiln's count
sits more than 5% from the slicer's total.
Each filament is priced as the material the file was sliced
for; ``estimate.filaments`` lists them and
``estimate.material_source`` says where the material came from.
When Kiln's servers answer, the estimate also
carries a ``cost_intelligence`` field; what it holds depends on
the tier.
Args:
file_path: Path to the G-code file.
material: Filament material (PLA, PETG, ABS, TPU, ASA, NYLON,
PC, …). Leave empty to use what the file was sliced
for, PLA when it names nothing; a named material prices
every filament.
electricity_rate: Cost per kWh in USD (default 0.12).
printer_wattage: Printer power consumption in watts (default 200).
printer_id: Optional registered printer the print is for;
passed on with the file when kiln-pro is asked.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>"
},
"name": "estimate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| material | No | Filament material (PLA, PETG, ABS, TPU, ASA, NYLON, PC, …). Leave empty to use what the file was sliced for, PLA when it names nothing; a named material prices every filament. Default: "". | |
| file_path | Yes | Path to the G-code file. | |
| printer_id | No | Optional registered printer the print is for; passed on with the file when kiln-pro is asked. Default: "". | |
| printer_wattage | No | Printer power consumption in watts (default 200). Default: 200.0. | |
| electricity_rate | No | Cost per kWh in USD (default 0.12). Default: 0.12. |