API reference
Every curated route below wraps Moonraker with clean JSON in and out. Anything not listed here is still reachable through the raw passthrough, and anything Klipper pushes live is available over the websocket.
http://192.168.1.50:8080/api/temps.
Every response is JSON. Errors come back as { "error": "message" } with
a matching HTTP status - Moonraker's own error status/body is forwarded through
unchanged wherever possible.
Authentication & API Keys
EnderCTL supports both interactive 2FA session tokens and persistent API keys for external scripts and automations.
Attach your persistent API key to any HTTP request. API keys can be generated in the WebUI (System → API Keys & Authentication) or set globally via WRAPPER_API_KEY in .env.
Standard HTTP Bearer authorization. Accepts both persistent API keys and active 30-day 2FA session tokens generated upon mobile approval.
Returns whether 2FA is active and whether the current caller's credentials are valid.
Response
Lists configured API keys (masked prefixes, labels, creation dates).
Response
Generates a new persistent API key with a custom label.
Body
Response
Revokes an existing API key by ID.
Response
Health
Confirms the wrapper is running and shows which Moonraker host it's pointed at.
Response
Temperature
Extruder and bed heater readouts and targets.
Current temperature, target, and heater power for the nozzle and bed.
Response
Sets the nozzle target temperature (M104).
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| temp | number | yes | Target °C. Use 0 to turn the heater off. |
Example
Sets the bed target temperature (M140).
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| temp | number | yes | Target °C. Use 0 to turn the heater off. |
Example
Sets both the nozzle and bed target to 0. No body required.
Motion
Homing, jogging, extrusion, and the emergency stop.
Homes one or more axes (G28).
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| axes | string | no | e.g. "XY". Omit or send an empty string to home all axes. |
Moves the toolhead (G1). Any axis you omit stays put.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| x, y, z | number | no | Target position in mm (or delta, if relative). |
| feedrate | number | no | mm/min. Defaults to 3000. |
| relative | boolean | no | If true, x/y/z are deltas (G91); otherwise absolute (G90). |
Example - jog +1mm on X
Extrudes or retracts filament. Negative amounts retract.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| amount | number | yes | mm. Negative to retract. |
| feedrate | number | no | mm/min. Defaults to 300. |
Make sure the nozzle is at temperature first - Klipper will reject cold extrusion.
Current toolhead position and which axes are homed.
Response
Emergency stop. Immediately kills steppers and heaters through Moonraker's
/printer/emergency_stop. Requires a firmware restart to recover from.
No body required.
Fans
On this printer fan0 and MainBoardFan are raw
output_pin sections, not Klipper fan objects - they're driven
with SET_PIN, not M106. nozzle_fan is a
heater_fan, auto-controlled by extruder temp and exposed read-only.
Lists every configured fan and its current value.
Response
:name must be fan0 or MainBoardFan.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| value | number | yes | 0 to 1 (0% - 100%). |
Example
Sensors
Every temperature_sensor/temperature_fan plus the extruder and bed heater objects, in one call.
The raw list of every Klipper object currently available - useful for discovering anything you add to printer.cfg later.
Runs a resonance test using the ADXL345. This moves the toolhead - clear the bed first.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| axis | "x" | "y" | "all" | no | Defaults to "all". |
Macros
Every gcode_macro defined in printer.cfg and its includes.
Response
Runs a named macro, optionally with parameters.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| name | string | yes | Macro name, e.g. "START_PRINT". |
| params | object | no | Key/value pairs, sent as KEY=value. |
Example
Escape hatch for raw, possibly multi-line, G-code.
Body
| Param | Type | Required | Notes |
|---|---|---|---|
| script | string | yes | One or more G-code lines, separated by \n. |
Files & print jobs
Lists G-code files stored on the printer (the gcodes root).
Slicer-embedded metadata for a file: thumbnail list, estimated print time, filament used, slicer name/version - whatever the slicer wrote into the gcode header.
Proxies the slicer-embedded preview image as image/png, so the
webUI can show a model preview without the browser needing direct network
access to the printer's own Moonraker port. Returns 404 if the
file wasn't sliced with thumbnails enabled.
Query params
| Param | Type | Required | Notes |
|---|---|---|---|
| size | "small" | "large" | no | Picks the smallest or largest embedded thumbnail. Defaults to largest. |
Example
Parses the file's own gcode into a compact set of extrusion-move line
segments for the dashboard's live 3D preview: one line per extrusion
move, each tagged with the byte offset it occurs at (to match against
virtual_sdcard.file_position) and which layer it belongs to.
This is the actual toolpath, not the original 3D model - there's no
STL/3MF on the printer to reconstruct a solid mesh from.
Response
Limits & approximations
| What | Behavior |
|---|---|
| File size | Files over 80 MB return 413 - parsing is done in memory, and this keeps it fast and safe on small SBCs. |
| Very large toolpaths | Segments are downsampled (evenly, keeping order) to a 200,000 cap; downsampled: true flags this. |
| Layers | Inferred from Z increasing during an extrusion move - a heuristic, not a true per-object layer count. |
| Arcs (G2/G3) | Approximated as a straight chord to the endpoint. |
| Byte offsets | Assume \n line endings; CRLF files undercount by ~1 byte/line - fine for a progress heatmap, not exact. |
multipart/form-data upload of a single file.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| file | file | yes | Up to 500 MB. |
Example
Removes a file from the printer's gcodes folder.
Starts printing a file already on the printer.
Pauses the active print. No body required.
Resumes a paused print. No body required.
Cancels the active print. No body required.
System, power & lights
The "everything at once" snapshot: printer info, temps, position, and update-manager status in one call.
Moonraker + host machine system info (CPU, distro, network interfaces, etc).
Restarts the Klipper service. Interrupts any active print. No body required.
Restarts the MCU firmware connection. Interrupts any active print. No body required.
Lists power devices configured in moonraker.conf (empty until you add one).
:action is on or off. No body required.
Returns { lights: [] } today - no neopixel/output_pin light exists in
printer.cfg on this printer. Wire an LED strip to a spare GPIO, declare
it in printer.cfg, and add its name to hardware.lights in
src/config.js to light this endpoint up.
Raw passthrough
Mirrors the method, path, query params, and JSON body straight onto Moonraker's own REST API. This guarantees nothing Moonraker exposes is ever blocked here, even endpoints added by a future Moonraker or Creality-Helper-Script update that the curated routes above don't know about yet.
Example
Websocket
One persistent connection, fanned out to every client. Reconnects automatically to Moonraker if the printer drops off Wi-Fi or reboots.
Messages you'll receive
Any other Moonraker notification (klippy state changes, file-list changes, job-queue
events, power-device changes) is forwarded too, as { type: <method>, data: <params> },
so nothing is silently dropped.