# 3D Print Cost & Time Estimator API: STL Slicer to G-code (`jumblemog/3d-print-cost-estimator`) Actor

Slice STL, 3MF, OBJ and STEP models with PrusaSlicer and get print time, filament in grams and metres, cost per piece, layers, support material, slicer warnings, a layer preview picture and the G-code. 200+ real printer profiles (Prusa, Creality, Voron) or your own config. For quotes and AI agents.

- **URL**: https://apify.com/jumblemog/3d-print-cost-estimator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** Developer tools, AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 3D Print Cost & Time Estimator API: STL Slicer to G-code

**Send a 3D model, get back how long it takes to print, how much filament it uses and what it costs.** The model is really sliced, for the printer and material you name, so the numbers are the ones a slicer shows after you press Slice:

- **Print time** for one piece and for the whole order, from the slicer's own estimate for that printer's speeds and accelerations.
- **Filament** in grams, metres and cm³, split into walls, infill, solid layers and supports.
- **Cost**: material at your price per kg, machine time at your hourly rate, markup, setup fee and quantity, worked out per piece and in total.
- **A printability check**: whether the part fits the printer, the layer count, whether supports were needed, and the slicer's warnings (long bridges, loose lines, low bed adhesion).
- **A preview picture** of the sliced part, every printed line colored by what it is, like a slicer's preview.
- **The G-code**, if you want to print it.
- **244 real printers** by name (Prusa, Creality, Voron, Elegoo, Sovol, QIDI, AnkerMake and more), two generic ones, or your own PrusaSlicer config.

![The built-in example bracket sliced by this Actor for an Original Prusa MK4 in PETG: orange walls, red top layers, green support material inside the bore, a legend with each kind of line's share of the filament, and the caption 4 h 48 min, 85.9 g of PETG, 425 layers](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/3d-print-cost-estimator-example.png?signature=1QQoqK7ws66GcdiWsZfpK)

It slices with [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) 2.9, the open-source slicer, and uses the printer, print and filament profiles that ship with it.

It's made for:

- 3D printing services and web shops that want an instant quote when a customer uploads a model.
- Print farms that need time and filament per job for planning and stock.
- Makers who want to know what a model costs before downloading a slicer, or to compare printers, materials and layer heights.
- AI agents that are handed a model and asked "how long would this take to print, and what would it cost?"

### How to use it

1. Add **Links to 3D models** (STL, 3MF, OBJ, AMF or STEP, or a ZIP of them), or upload them. Write `example` to try the built-in bracket.
2. Pick the **Printer** (`generic`, `generic fast`, or a name such as `Original Prusa MK4S` or `Ender-3 V2`) and the **Material**.
3. Optionally set layer height, infill, supports, your filament price and your hourly rate.
4. Click **Start**. Each model is a row in the results, with its time, filament, cost and links to its preview and G-code.

#### What you can send

| You send | What happens |
|---|---|
| A link to an `.stl`, `.3mf`, `.obj`, `.amf`, `.step` or `.stp` file | One estimate |
| A link to a ZIP archive | One estimate per model in it |
| A GitHub file link, or a folder link (`https://github.com/user/repo/tree/main/models`) | The file, or every model in that folder |
| A Google Drive or Dropbox share link | The shared file |
| An uploaded file | The same as a link |
| `example` | The built-in bracket, 120 × 80 × 85 mm |

### Examples

All of these are real results for the built-in example.

| Input | Result |
|---|---|
| `{"modelUrls": ["example"]}` | `example-bracket: 6 h 15 min and 88.3 g of PLA on Generic (standard speed) (0.2 mm layers, 15% infill, with supports). 425 layers, 29.6 m of filament, 8.15 g of it in supports. Cost 2.21 USD.` |
| `{"modelUrls": ["example"], "printer": "generic fast"}` | The same filament in 2 h 59 min |
| `{"modelUrls": ["example"], "printer": "Original Prusa MK4", "material": "PETG", "ratePerHour": "2"}` | `4 h 48 min and 85.9 g of PETG on Original Prusa MK4 ... Cost 11.74 USD (2.15 USD material, 9.60 USD machine time).` |
| `{"modelUrls": ["example"], "printer": "Voron v2 300mm3", "material": "ABS", "nozzle": "0.6"}` | `2 h 36 min and 82.3 g of ABS on Voron v2 300mm3 (0.3 mm layers, 15% infill, with supports). 283 layers` |
| `{"modelUrls": ["example"], "supports": "none"}` | `5 h 44 min and 80.1 g of PLA ... The slicer warns: Floating bridge anchors, Long bridging extrusions; Consider enabling supports.` |

### How-to examples

#### How to get the print time and filament of an STL file

```json
{"modelUrls": ["https://example.com/part.stl"], "printer": "generic", "material": "PLA"}
```

The row has `printSeconds` and `printTime` (`"6 h 15 min"`), `filamentG`, `filamentM` and `filamentCm3`, `layers`, and `filamentByKind`, the grams in each kind of line. For the example: `{"walls": 19.88, "infill": 38.04, "solid layers": 22.17, "supports": 8.15, "skirt and brim": 0.05}`. `generic` is a standard-speed printer with a 0.4 mm nozzle, 0.2 mm layers, 2 walls and 15% infill. Use `generic fast` for an input-shaping or CoreXY machine.

#### How to price a 3D print for a customer

```json
{
  "modelUrls": ["example"], "printer": "Ender-3 V2", "layerHeight": "0.2", "infill": 30,
  "quantity": 10, "pricePerKg": "22", "ratePerHour": "1.5", "markupPercent": "20", "setupFee": "5", "currency": "EUR"
}
```

Result: `10 h 29 min and 128 g of PLA on Creality Ender-3 V2 (0.2 mm layers, 30% infill, with supports) ... 22.25 EUR a piece, 227.47 EUR for 10 (4 d 8 h 50 min of printing).` One piece is material (127.92 g at 22 EUR/kg = 2.81) plus machine time (10.48 h at 1.50 = 15.72), plus 20% markup. The total is ten pieces plus the 5 EUR setup fee. `materialCost`, `machineCost`, `costPerPiece` and `totalCost` are separate fields, so you can apply your own pricing rules instead.

#### How to estimate for a specific printer

```json
{"modelUrls": ["example"], "printer": "Original Prusa MK4", "material": "PETG", "layerHeight": "0.2"}
```

The row says which of the slicer's presets were used: `printPreset: "0.20mm QUALITY @MK4 0.4"` and `filamentPreset: "Generic PETG @PG"`, with the MK4's 250 × 210 × 220 mm build space in `bedMm`. Part of a name is enough when it is clear: `prusa mk4s`, `ender 3 v2`, `core one`, `sv06`, `neptune 3 pro`, `voron v2 350`. To see every name, run `{"listPrinters": true}`: it saves all 244 with their nozzle sizes as the `PRINTERS` record, and is free.

#### How to compare layer heights, materials or printers

Run the same model with one thing changed and compare `printSeconds` and `filamentG`. For the example bracket: a Prusa MINI in TPU at 0.15 mm takes 14 h 38 min, an Ender-3 V2 in PLA at 0.2 mm and 30% infill 10 h 29 min, a generic standard printer 6 h 15 min, an Original Prusa MK4 in PETG 4 h 48 min, a generic fast printer 2 h 59 min, and a Voron v2 with a 0.6 mm nozzle and 0.3 mm layers 2 h 36 min.

#### How to use your own PrusaSlicer profile

```json
{"modelUrls": ["https://example.com/part.stl"], "configUrl": "https://example.com/my-printer.ini"}
```

Export your settings from PrusaSlicer with File > Export > Export Config and link to the file (or paste it in `config`). Your printer, speeds and filament are used as they are, so the estimate matches what your own slicer shows. A G-code file that PrusaSlicer wrote works as a config too: its settings are read from the end of the file. For single changes use `settings` with the slicer's own names: `{"settings": {"fill_pattern": "gyroid", "top_solid_layers": 6, "perimeter_speed": 60}}`.

#### How to turn an STL into G-code through an API

```json
{"modelUrls": ["https://example.com/part.stl"], "printer": "Original Prusa MK4S", "material": "PETG", "outputs": ["gcode"]}
```

`gcodeUrl` links to the G-code, written for that printer with its own start and end sequence. Look at the preview and the warnings before you print a file nobody has looked at.

#### How to slice a model that is in inches, or lies the wrong way

```json
{"modelUrls": ["https://example.com/part-in-inches.stl"], "scale": "2540", "rotateX": "90"}
```

STL and OBJ files carry no unit and are read as millimetres, so a model drawn in inches comes out 25.4 times too small: `scale` 2540 fixes it (the Actor says so in `notes` when a model is under 10 mm). The model is printed as it lies in the file. `rotateX`, `rotateY` and `rotateZ` turn it first: laying a part on its flat side often removes the need for supports.

#### How to let an AI agent estimate a 3D print

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/3d-print-cost-estimator`. The agent passes the model's link, a printer and a material, and reads `summary`, `printTime`, `filamentG`, `totalCost`, `warnings` and `notes`. It can open `previewUrl` to see the sliced part.

### FAQ

**How accurate is the print time?**
It is PrusaSlicer's own estimate: it walks through every move of the G-code with the printer's speed and acceleration limits. It is as good as the profile. Prusa's own printers carry their firmware's real limits; other makers' profiles are contributed by the community and can be further off. Heating up and bed levelling before the print starts aren't included. The generic printers are typical machines, not yours, so treat them as a good first number.

**Is my printer supported? What about Bambu Lab?**
244 printers that PrusaSlicer has profiles for: Original Prusa (CORE One, MK4S, MK4, MK3.9, MK3.5, MK3S+, MINI+, XL), Creality (Ender-3 family, Ender-5, CR-10, Sermoon), Voron (Zero, v1, v2, Switchwire), RatRig, Elegoo Neptune, Sovol, QIDI, Artillery, AnkerMake, Anycubic, Snapmaker, FLSun, LulzBot, Ultimaker and others. Bambu Lab printers aren't among them, because their profiles live in Bambu Studio. For a Bambu Lab or any other missing printer use `generic fast` (or `generic`) with `bedSize`, or send your own config. Writing `Bambu Lab P1S` as the printer does this for you and says so in `notes`.

**Which materials can I pick?**
PLA, PETG, ABS, ASA, TPU, PC, PA (nylon), PVA, HIPS and PP. For a named printer the slicer's own filament preset for that printer is used (`filamentPreset` says which). Where it has none, generic temperatures, density and melting rate are used and a note says so. For a filled or unusual plastic send its `filamentDensity`.

**Does it choose the best orientation?**
No. The model is printed as it lies in the file, the way a slicer opens it. Turn it with `rotateX`, `rotateY` and `rotateZ`.

**What does `supports: auto` do?**
It adds support material only under overhangs that need it. A model without steep overhangs gets none, and `supports` in the row is then false. With `none`, the slicer's warnings tell you if parts of the model would print in the air.

**Can it estimate resin (SLA) prints or multi-color prints?**
No. Filament printers with one material per print only.

**Is the cost for several pieces the same as printing them together?**
`quantity` multiplies the single piece. Printing several on one plate saves a little time per piece (one warm-up, fewer start moves), so the total is a slight overestimate.

**What happens to my model?**
It is downloaded into the run, sliced and deleted. The preview and the G-code are saved in the run's own storage in your Apify account, and stay as long as your account keeps run data.

### Input

| Field | What it does |
|---|---|
| `modelUrls`, `uploads` | The models: links or uploaded files |
| `printer` | `generic` (default), `generic fast`, or a printer's name |
| `material` | PLA (default), PETG, ABS, ASA, TPU, PC, PA, PVA, HIPS, PP |
| `layerHeight` | Layer height in mm. Default: the printer's own (0.2 for the generic ones) |
| `infill` | Infill in percent. Default: the profile's (15 for the generic ones) |
| `supports` | `auto` (default: where needed), `buildplate` (only those standing on the bed) or `none` |
| `nozzle`, `walls`, `brim` | Nozzle diameter in mm, number of wall lines, brim width in mm |
| `quantity` | Number of pieces (default 1) |
| `pricePerKg`, `ratePerHour` | Filament price per kg (default 25) and machine rate per hour (default 0) |
| `setupFee`, `markupPercent`, `currency` | A fixed fee per order, a markup on each piece, and the currency's label (default USD) |
| `scale`, `rotateX`, `rotateY`, `rotateZ` | Size in percent and turns in degrees, applied before slicing |
| `bedSize` | The build space, such as `256x256x256`. Default 220x220x250 for the generic printers |
| `filamentDensity` | A density in g/cm³ instead of the material's own |
| `settings` | Any PrusaSlicer settings by their config names, applied last |
| `configUrl`, `config` | Your own PrusaSlicer config, as a link or as text |
| `outputs` | `preview` (default) and/or `gcode`. An empty list gives the numbers only |
| `imageWidth` | Width of the preview in pixels (default 1400) |
| `listPrinters` | Save the list of printers instead of slicing. Free |
| `timeoutSecs`, `maxModels` | Limits: seconds per model (default 600) and models per run (default 100) |

### Output

One row per model:

| Field | Meaning |
|---|---|
| `name`, `status`, `summary`, `error` | The model, `ok` or `failed`, the estimate in a sentence, or why it failed |
| `printSeconds`, `printTime`, `firstLayerSeconds` | Print time of one piece |
| `filamentG`, `filamentM`, `filamentCm3`, `filamentDensity` | Filament of one piece, and the density used |
| `filamentByKind`, `supportG` | Grams in walls, infill, solid layers, supports, skirt and brim |
| `materialCost`, `machineCost`, `costPerPiece`, `totalCost`, `currency` | The cost. `totalCost` is for the whole quantity, with the setup fee |
| `quantity`, `totalPrintSeconds`, `totalPrintTime`, `totalFilamentG` | Totals for the quantity |
| `printer`, `printerPreset`, `printPreset`, `filamentPreset` | The printer and the slicer presets that were used |
| `material`, `nozzleMm`, `layerHeightMm`, `infillPercent`, `walls`, `supports`, `supportsSetting` | The settings the slicer really used |
| `layers`, `heightMm` | The part's layers and the height of the last one |
| `sizeMm`, `volumeCm3`, `triangles`, `watertight`, `format` | The model as printed: size after scale and turns, volume, mesh facts |
| `bedMm`, `fitsBed` | The printer's build space. A model that doesn't fit is reported as failed, with what to do |
| `warnings`, `notes` | The slicer's warnings, and things worth knowing about this estimate |
| `previewUrl`, `gcodeUrl` | Links to the preview picture and the G-code |
| `slicer`, `sourceUrl`, `processingSeconds` | The slicer version, where the model came from, and the time taken |

The files are in the run's key-value store, named like `001-bracket-preview.png` and `001-bracket.gcode`. The first row is also saved as `OUTPUT`.

### How it works

1. **Settings**: for a named printer, the Actor reads PrusaSlicer's profile bundles the way the program's own preset picker does: the printer preset for your nozzle, the print preset closest to your layer height, and a filament preset of your material that the bundle marks as compatible. Your own fields are applied on top.
2. **Checking**: the model is loaded, scaled and turned, measured, and checked against the printer's build space.
3. **Slicing**: PrusaSlicer slices it and writes G-code with its time estimate and filament totals.
4. **Reading**: the Actor reads the totals, adds up the filament in each kind of line, and draws the preview from the G-code's own moves, layer on layer.

### Pricing

You pay one low price per model sliced, at the price shown on this page, with or without the preview and the G-code. Models that can't be sliced are never charged, and listing the printers is free. If you set a maximum cost per run, the Actor stops before a model that wouldn't fit.

### Speed

A typical part takes 3 to 8 seconds: the example bracket slices in about 3 seconds, a detailed 11 MB STL with 225,000 triangles in about 10. A run through the API adds a few seconds for the cloud container to start.

### Tips and limits

- **Start with the numbers only** (`"outputs": []`) when you estimate many models: the preview adds a second or two each.
- **Fine layers on big parts** make large G-code files and slow slicing. Give such runs more memory, which also gives them more CPU.
- **The time estimate** leaves out heat-up, bed levelling and filament changes.
- **One print per file**: several objects in one 3MF are sliced together as one print.
- **Not covered**: resin printers, multi-material prints, automatic orientation, and arranging many copies on one plate.
- **Limits**: 200 MB per download, 400 MB unpacked per ZIP, 200 models per ZIP.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `modelUrls`, `printer` and `material`, and read `summary`, `printSeconds`, `filamentG`, `totalCost`, `warnings` and the links. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~3d-print-cost-estimator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"modelUrls": ["https://example.com/part.stl"], "printer": "Original Prusa MK4S", "material": "PETG", "ratePerHour": "2"}'
```

`run-sync` instead returns the run's `OUTPUT`: the first model's row as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/3d-print-cost-estimator").call(run_input={
    "modelUrls": ["https://example.com/part.stl"], "printer": "generic fast", "material": "PLA",
    "quantity": 25, "pricePerKg": "22", "ratePerHour": "1.5",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"], item["printSeconds"], item["filamentG"], item["totalCost"], item["previewUrl"])
```

### Credits

- Slicing: [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, based on Slic3r by Alessandro Ranellucci (AGPL-3.0), unmodified, as packaged by Debian, with the printer profiles it ships. Its source code is at the link.
- Model reading for the size check: [trimesh](https://trimesh.org) (MIT). Preview drawing: [Pillow](https://python-pillow.org) and [NumPy](https://numpy.org).
- The example model is this Actor's own design.

# Actor input Schema

## `modelUrls` (type: `array`):

Links to STL, 3MF, OBJ, AMF or STEP models, or ZIP archives holding them (every model in a ZIP is one estimate). GitHub file and folder links, Google Drive and Dropbox share links work. Write `example` to try the built-in example bracket.

## `uploads` (type: `array`):

Upload STL, 3MF, OBJ, AMF or STEP models, or ZIP archives of them, from your computer.

## `printer` (type: `string`):

`generic` (a standard-speed printer, 220 × 220 × 250 mm), `generic fast` (an input-shaping or CoreXY machine such as a Bambu Lab), or the name of one of the 200+ printers PrusaSlicer has profiles for: `Original Prusa MK4`, `Prusa MINI`, `Creality Ender-3 V2`, `Voron v2 300mm3`, `Sovol SV06`, `Elegoo Neptune-3`, `AnkerMake M5`... Part of a name is enough when it is clear. Turn on 'List the printers' to get every name.

## `material` (type: `string`):

The plastic. For a named printer the slicer's own filament settings for that printer and material are used; where it has none, generic values are.

## `layerHeight` (type: `string`):

Such as 0.2. Thinner layers look finer and take longer. Left empty, the printer's default is used (0.2 mm for the generic printers with a 0.4 mm nozzle). For a named printer the slicer's print profile closest to this height is taken.

## `infill` (type: `integer`):

How full the inside is, 0 to 100. Left empty, the printer profile's own value is used (15% for the generic printers).

## `supports` (type: `string`):

Support material under overhangs. With 'Where the model needs them' a model without steep overhangs gets none.

## `nozzle` (type: `string`):

Nozzle diameter, such as 0.4 or 0.6. Left empty: 0.4. For a named printer it must be a nozzle the slicer has a setup for.

## `walls` (type: `integer`):

Number of wall lines (perimeters). Left empty, the profile's value is used (2 for the generic printers).

## `brim` (type: `string`):

Width of a brim around the first layer, in mm. Left empty, the profile's value (usually none).

## `quantity` (type: `integer`):

How many pieces. Time, filament and cost totals are the single piece times this number.

## `pricePerKg` (type: `string`):

What a kilogram of the filament costs, in your currency.

## `ratePerHour` (type: `string`):

What an hour of printing costs you or your customer (electricity, wear, margin). 0 leaves machine time out of the cost.

## `setupFee` (type: `string`):

A fixed amount added once to the total, whatever the quantity.

## `markupPercent` (type: `string`):

A percentage added on top of material and machine cost of each piece.

## `currency` (type: `string`):

Only a label for the summary and the result (USD, EUR, GBP...). Nothing is converted.

## `scale` (type: `string`):

Size of the model in percent. Model files carry no unit and are read as millimetres: use 2540 for a model drawn in inches, 100000 for one in metres.

## `rotateX` (type: `string`):

Tip the model before slicing, for example 90 to lay it on its back. The model is printed as it lies in the file otherwise.

## `rotateY` (type: `string`):

Tip the model around the Y axis before slicing.

## `rotateZ` (type: `string`):

Spin the model on the bed, for example 90 to fit a long part on a bed that is wider than deep.

## `bedSize` (type: `string`):

Width × depth × height of the printer's build space, such as 256x256x256. Used for the generic printers (default 220x220x250) and replaces a named printer's own.

## `filamentDensity` (type: `string`):

For a plastic that isn't in the list, or a filled one: its density, such as 1.31. Replaces the material's own for the weight.

## `settings` (type: `object`):

Any PrusaSlicer setting by its config name, applied last, such as {"fill_pattern": "gyroid", "top_solid_layers": 6, "perimeter_speed": 60}. Run PrusaSlicer with --help-fff for the names.

## `configUrl` (type: `string`):

A config exported from PrusaSlicer (File > Export > Export Config), or a G-code file PrusaSlicer wrote (its settings are read from the end). Your printer, speeds and filament are then used as they are; the fields above still apply on top.

## `config` (type: `string`):

The same as the link above, as text: lines such as `layer_height = 0.2`.

## `outputs` (type: `array`):

The numbers always come. Add the preview picture, the G-code, both or neither.

## `imageWidth` (type: `integer`):

Width of the preview picture.

## `listPrinters` (type: `boolean`):

Don't slice anything: save the names of all printers with profiles (and their nozzles) as the PRINTERS record of the run's key-value store. Free.

## `timeoutSecs` (type: `integer`):

A model that takes longer to slice is reported as failed and not charged.

## `maxModels` (type: `integer`):

A safety limit, for ZIP archives and folders with many models.

## Actor input object example

```json
{
  "modelUrls": [
    "example"
  ],
  "printer": "generic",
  "material": "PLA",
  "supports": "auto",
  "quantity": 1,
  "pricePerKg": "25",
  "ratePerHour": "0",
  "setupFee": "0",
  "markupPercent": "0",
  "currency": "USD",
  "scale": "100",
  "rotateX": "0",
  "rotateY": "0",
  "rotateZ": "0",
  "outputs": [
    "preview"
  ],
  "imageWidth": 1400,
  "listPrinters": false,
  "timeoutSecs": 600,
  "maxModels": 100
}
```

# Actor output Schema

## `results` (type: `string`):

One item per model: print time, filament, cost, layers, warnings and links to the preview and the G-code.

## `files` (type: `string`):

The preview pictures and G-code files in the run's key-value store (and the PRINTERS record when the printers were listed).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "modelUrls": [
        "example"
    ],
    "printer": "generic"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/3d-print-cost-estimator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "modelUrls": ["example"],
    "printer": "generic",
}

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/3d-print-cost-estimator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "modelUrls": [
    "example"
  ],
  "printer": "generic"
}' |
apify call jumblemog/3d-print-cost-estimator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/3d-print-cost-estimator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/a4Izpdem3GfDd6YlB/builds/IUsG2VQo56uKXNuDb/openapi.json
