Skip to content

FiberPath API Reference

The FastAPI service in fiberpath_api/ exposes thin wrappers around the core planning, simulation, validation, and streaming engines. All endpoints accept and return JSON and are designed for headless automation (GUI/HMI integrations, CI pipelines, etc.).

Planning

text POST /plan/from-file

Request body:

json { "path": "/absolute/path/to/input.wind", "verbose": false }

Fields:

  • path (required): Absolute path to .wind file
  • verbose (optional): Include detailed layer metrics in response (default: false)

See Axis Mapping Guide for format details.

Response body:

json { "commands": 1234, "output": "/absolute/path/to/input.gcode", "timeSeconds": 42.5, "towMeters": 8.1, "layers": [ { "index": 1, "wind_type": "helical", "commands": 456, "time_s": 12.3, "tow_m": 1.9 } ] }

Simulation

text POST /simulate/from-file

Request:

json { "path": "/absolute/path/to/output.gcode" }

Response:

json { "commands": 789, "moves": 300, "estimated_time_s": 95.2, "total_distance_mm": 8234.5, "tow_length_mm": 8100.0, "average_feed_rate_mmpm": 7200.0 }

Response Fields:

  • commands: Total G-code commands processed
  • moves: Number of movement commands (G0/G1)
  • estimated_time_s: Estimated execution time in seconds
  • total_distance_mm: Combined motion distance of all axes
  • tow_length_mm: Total fiber material used in millimeters
  • average_feed_rate_mmpm: Mean speed across all moves in mm/min

Validation

text POST /validate/from-file

Validates a .wind file against the schema without generating G-code.

Request:

json { "path": "/absolute/path/to/input.wind" }

Response (success):

json { "status": "ok", "path": "/absolute/path/to/input.wind" }

Response (validation error):

json { "status": "error", "detail": "Validation error description" }

HTTP status codes:

  • 200 OK: File is valid
  • 400 Bad Request: Validation failed (see detail field)

Streaming

text POST /stream/

Request:

json { "gcode": "; Parameters ...\nG0 X0 A0\n", "port": "COM5", "baud_rate": 250000, "dry_run": true }

Response:

json { "commands_streamed": 100, "total_commands": 100, "dry_run": true }

All endpoints return non-2xx responses (400/404/502) with a {"detail": "..."} payload when validation fails or the underlying engine reports an error. Use FastAPI's autogenerated docs at /docs for interactive exploration.