Beam Bench Docs

HTTP API

Drive Beam Bench from any HTTP client. Same surface the CLI talks to.

The HTTP API is the integration surface for Beam Bench. The desktop app, the CLI, and any external client all talk to the same routes. If you have a use case that needs Beam Bench in a non-CLI environment (web app, integration server, mobile app, your own tooling), use the API directly.

The API is shipped with the desktop app and runs in-process. There is no separate service to install.

Defaults and security

In the current build, the local API server runs by default with these settings:

  • Local API: on.
  • API Port: 5900.
  • Allow network devices to connect: on. The server binds to 0.0.0.0 and accepts connections from any device on your network.

This means a fresh install of Beam Bench, on a network you share with others (office, coworking space, conference Wi-Fi, an unsegmented home network with guest devices), exposes an unauthenticated API that can move the machine and fire the laser to anyone on that network.

If you do not want network exposure, change the defaults from Settings → General:

  1. Open the desktop app.
  2. Edit → Settings → General.
  3. Turn Allow network devices to connect off to bind to localhost only.
  4. Or turn Local API off entirely to stop the server.

Changes take effect immediately; no restart needed.

Base URL

http://<host>:5900/api/v1

<host> is localhost (or 127.0.0.1) when Allow network devices to connect is off. When it is on, the server is reachable at the machine's LAN IP from any device on the network.

The port is configurable in Settings → General; 5900 is the default.

Authentication

None. The API has no token, no key, no login.

  • With localhost binding, the OS-level access model is the boundary: any process on your machine can talk to the API.
  • With network binding (the default), anyone on the same network can talk to the API. Treat that like running an open SMB share. Do not run Beam Bench in network-binding mode on untrusted Wi-Fi.

Request format

All POST/PATCH/PUT bodies are JSON:

Content-Type: application/json

Query strings are flat key=value. Path segments are URL-encoded as usual.

Response envelope

Successful responses return the resource body directly, no wrapper:

{
  "field": "value",
  "...": "..."
}

Errors return a uniform envelope:

{
  "error": {
    "code": "InvalidInput",
    "message": "Human-readable summary of what went wrong.",
    "details": { "...optional structured context..." }
  }
}

error.code is one of:

CodeHTTPMeaning
NotFound404The requested resource does not exist.
InvalidInput400The request body or parameters were malformed or rejected.
InvalidState412The app is not in a state where this operation makes sense (e.g. no project open).
Busy409A conflicting operation is already in progress.
Conflict409Another writer changed the resource since you last read it.
StaleRevision412Your revision token is behind the current one. Re-read and retry.
MachineIo502The machine connection failed (disconnect, timeout, transport error).
Persistence500Disk write or read failed.
Internal500Unexpected server error. Report it as a bug.

Confirmation-required errors

A small set of operations can move the machine or fire the laser. Those endpoints require an explicit confirmation flag in the request body. If missing, the API returns 428 Precondition Required:

{
  "error_code": "CONFIRMATION_REQUIRED",
  "missing": ["confirm_motion"],
  "message": "This command can move the machine and requires explicit confirmation."
}

Re-send the request with the named flag set to true. The flags currently in use are confirm_motion, confirm_laser_on, confirm_raw_gcode, and confirm_air_assist.

Endpoint groups

PathWhat it covers
/api/v1/appApp-level info: version, uptime, capabilities.
/api/v1/agentAgent capability schema, state snapshot, and operating guide.
/api/v1/projectsOpen, save, close. Layers, objects, undo/redo.
/api/v1/projects/importImport SVG, DXF, PDF, AI, and raster images into a project.
/api/v1/exportRender a project to SVG, DXF, PDF, EPS, AI.
/api/v1/designDescribe the current design, render to PNG, apply transactional edits.
/api/v1/previewGenerate cut previews and stats.
/api/v1/jobsPreflight, run, dry-run, pause, resume, frame, stop.
/api/v1/machineConnect, disconnect, status, jog, home.
/api/v1/cameraDevices, state, capture, overlay (display, transform, render), calibration, alignment.
/api/v1/consoleSend raw G-code. Read recent console log.
/api/v1/macrosList, save, and run user macros.
/api/v1/materialsMaterial library: presets keyed by material and thickness.
/api/v1/profilesMachine profiles: create, list, apply.
/api/v1/assetsArt Library asset access.
/api/v1/vectorVector ops: convert, boolean, group, path.
/api/v1/eventsWebSocket stream of state changes and machine events.

Per-resource reference pages are a work in progress; consult the agent capability schema in the meantime.

Discover the live surface

The fastest way to see what your installed version exposes:

curl -s http://localhost:5900/api/v1/agent/capabilities | jq .

This returns the full capability schema, including every endpoint, its parameters, and its response shape. The schema is the authoritative description; this page is a guide to it.

For state introspection:

curl -s http://localhost:5900/api/v1/agent/state | jq .

For a written orientation on how to drive the app:

curl -s http://localhost:5900/api/v1/agent/guide

Versioning

All routes are under /api/v1. Breaking changes go in /api/v2 when they happen. Additive changes (new endpoints, new optional fields) ship in v1 without a version bump.

On this page