OpenSkyLabOpenSkyLab

API Reference

REST API & WebSocket

All endpoints are served from a single Axum server on port 7624. REST for commands, WebSocket for real-time events.

base URLs
HTTP:  http://localhost:7624/api/v1
WS:    ws://localhost:7624/ws

Authentication

Local access (default): no authentication required. For remote access, pass the token in the Authorization header.

request header
Authorization: Bearer <token>
# Token saved in ~/.config/openskylab/config.toml

Mount

Mount Control
GET
/mount/status

Current RA/DEC, Alt/Az, tracking mode, slewing state, pier side, time to flip

POST
/mount/gotobody: { ra, dec }

Slew to J2000 coordinates (ra in hours, dec in degrees)

POST
/mount/syncbody: { ra, dec }

Sync mount position to solved coordinates

POST
/mount/park

Park the mount at configured park position

POST
/mount/unpark

Unpark and resume tracking

POST
/mount/trackingbody: { mode: "sidereal"|"lunar"|"solar"|"off" }

Set tracking mode

POST
/mount/abort

Emergency stop all mount movement

GET
/mount/alignment

List alignment points in the pointing model

POST
/mount/alignment/addbody: AlignPoint

Add a solved alignment point

POST
/mount/alignment/clear

Clear all alignment points

Camera

Camera Control
GET
/camera/status

Sensor info, cooler status, current exposure progress

POST
/camera/exposebody: ExposureParams

Start an exposure (duration, gain, offset, binning, frame type)

POST
/camera/abort

Abort current exposure

GET
/camera/frame/latest

Download the most recent captured frame

POST
/camera/coolerbody: { enabled, target_c }

Set cooler on/off and target temperature

POST
/camera/livestack/start

Start live stacking incoming frames

POST
/camera/livestack/stop

Stop live stacking

POST
/camera/livestack/reset

Clear accumulated stack

GET
/camera/livestack

Current live stack status and preview

Focuser

Focuser Control
GET
/focuser/status

Position, temperature, moving state, max position

POST
/focuser/movebody: { position }

Move to absolute position (steps)

POST
/focuser/move-relbody: { steps }

Move relative (positive = out, negative = in)

POST
/focuser/autofocus

Start V-curve autofocus routine

Guiding (PHD2)

Guiding Control
GET
/guiding/status

Guide state, RMS RA/DEC, star position, calibration state

POST
/guiding/start

Start autoguiding (connects to PHD2)

POST
/guiding/stop

Stop autoguiding

POST
/guiding/ditherbody: { pixels, settle_time }

Dither by N pixels, wait for settle

Sequencer

Sequence Management
GET
/sequences

List all saved sequences

POST
/sequencesbody: Sequence

Create a new sequence

GET
/sequences/{id}

Get sequence by ID

DELETE
/sequences/{id}

Delete a sequence

Sequencer Control
GET
/sequencer/status

Current state, step, frame, elapsed time, ETA

POST
/sequencer/startbody: { sequence_id }

Start running a sequence

POST
/sequencer/pause

Pause after current exposure

POST
/sequencer/resume

Resume paused sequence

POST
/sequencer/abort

Abort and discard remaining

GET
/sequencer/checkpoint

Get recovery checkpoint (for crash resume)

Scheduler

Observation Planning
GET
/scheduler/plans

List observation plans

POST
/scheduler/plansbody: SchedulerPlan

Create a multi-target plan

GET
/scheduler/status

Scheduler state, current target, progress

POST
/scheduler/start

Start automated observation

POST
/scheduler/pause

Pause scheduler

POST
/scheduler/resume

Resume scheduler

POST
/scheduler/abort

Abort and park

POST
/scheduler/skip-target

Skip current target, move to next

Plate Solver

Plate Solving
POST
/solver/solvebody: { image_path, ra_hint?, dec_hint? }

Solve a FITS image. Uses ASTAP, falls back to astrometry.net

GET
/solver/result/{id}

Get solve result (RA, DEC, position angle, pixel scale)

GET
/solver/indexes

List available ASTAP and astrometry.net databases

POST
/solver/download-indexbody: { database }

Download a solver database

More Endpoints

Additional endpoint groups include: filter wheel, rotator, flat panel, dome, weather, catalog, mosaic, profiles, templates, cloud sync, HiPS tiles, calibration library, polar alignment, telemetry, license, ASCOM bridge, and logs. See the OpenAPI 3.1 spec for the complete reference.

WebSocket Events

Connect to ws://localhost:7624/ws for real-time events. All events follow this shape:

event shape
interface WsEvent {
  type: string;      // e.g. "mount.status"
  ts: number;        // Unix milliseconds
  data: unknown;     // type-specific payload
}

Event Types

EventFrequencyDescription
mount.status10Hz / 1HzPosition, tracking state (fast when slewing)
camera.frame_readyOn completeFrame downloaded and saved
camera.expose_progress1HzExposure progress percentage
guiding.stats_update1HzRA/DEC RMS, corrections
guiding.state_changedOn changeGuiding, Paused, Lost, Calibrating
sequencer.step_changedOn changeNew step/filter/target started
sequencer.frame_savedPer frameFrame saved with HFR, star count
solver.resultOn solveSolve result with coordinates
device.connectedOn connectDevice connected event
device.disconnectedOn disconnectDevice disconnected event
weather.update60sWeather conditions
scheduler.target_startedOn changeNew observation target
scheduler.safety_alertOn eventWeather unsafe, stopping
dome.shutter_changedOn changeShutter state transition
polar_alignment.error_computedOn computeAlt/Az error in arcmin
alertOn eventinfo, warning, error, critical