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.
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.
Authorization: Bearer <token> # Token saved in ~/.config/openskylab/config.toml
Mount
/mount/statusCurrent RA/DEC, Alt/Az, tracking mode, slewing state, pier side, time to flip
/mount/gotobody: { ra, dec }Slew to J2000 coordinates (ra in hours, dec in degrees)
/mount/syncbody: { ra, dec }Sync mount position to solved coordinates
/mount/parkPark the mount at configured park position
/mount/unparkUnpark and resume tracking
/mount/trackingbody: { mode: "sidereal"|"lunar"|"solar"|"off" }Set tracking mode
/mount/abortEmergency stop all mount movement
/mount/alignmentList alignment points in the pointing model
/mount/alignment/addbody: AlignPointAdd a solved alignment point
/mount/alignment/clearClear all alignment points
Camera
/camera/statusSensor info, cooler status, current exposure progress
/camera/exposebody: ExposureParamsStart an exposure (duration, gain, offset, binning, frame type)
/camera/abortAbort current exposure
/camera/frame/latestDownload the most recent captured frame
/camera/coolerbody: { enabled, target_c }Set cooler on/off and target temperature
/camera/livestack/startStart live stacking incoming frames
/camera/livestack/stopStop live stacking
/camera/livestack/resetClear accumulated stack
/camera/livestackCurrent live stack status and preview
Focuser
/focuser/statusPosition, temperature, moving state, max position
/focuser/movebody: { position }Move to absolute position (steps)
/focuser/move-relbody: { steps }Move relative (positive = out, negative = in)
/focuser/autofocusStart V-curve autofocus routine
Guiding (PHD2)
/guiding/statusGuide state, RMS RA/DEC, star position, calibration state
/guiding/startStart autoguiding (connects to PHD2)
/guiding/stopStop autoguiding
/guiding/ditherbody: { pixels, settle_time }Dither by N pixels, wait for settle
Sequencer
/sequencesList all saved sequences
/sequencesbody: SequenceCreate a new sequence
/sequences/{id}Get sequence by ID
/sequences/{id}Delete a sequence
/sequencer/statusCurrent state, step, frame, elapsed time, ETA
/sequencer/startbody: { sequence_id }Start running a sequence
/sequencer/pausePause after current exposure
/sequencer/resumeResume paused sequence
/sequencer/abortAbort and discard remaining
/sequencer/checkpointGet recovery checkpoint (for crash resume)
Scheduler
/scheduler/plansList observation plans
/scheduler/plansbody: SchedulerPlanCreate a multi-target plan
/scheduler/statusScheduler state, current target, progress
/scheduler/startStart automated observation
/scheduler/pausePause scheduler
/scheduler/resumeResume scheduler
/scheduler/abortAbort and park
/scheduler/skip-targetSkip current target, move to next
Plate Solver
/solver/solvebody: { image_path, ra_hint?, dec_hint? }Solve a FITS image. Uses ASTAP, falls back to astrometry.net
/solver/result/{id}Get solve result (RA, DEC, position angle, pixel scale)
/solver/indexesList available ASTAP and astrometry.net databases
/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:
interface WsEvent {
type: string; // e.g. "mount.status"
ts: number; // Unix milliseconds
data: unknown; // type-specific payload
}Event Types
| Event | Frequency | Description |
|---|---|---|
| mount.status | 10Hz / 1Hz | Position, tracking state (fast when slewing) |
| camera.frame_ready | On complete | Frame downloaded and saved |
| camera.expose_progress | 1Hz | Exposure progress percentage |
| guiding.stats_update | 1Hz | RA/DEC RMS, corrections |
| guiding.state_changed | On change | Guiding, Paused, Lost, Calibrating |
| sequencer.step_changed | On change | New step/filter/target started |
| sequencer.frame_saved | Per frame | Frame saved with HFR, star count |
| solver.result | On solve | Solve result with coordinates |
| device.connected | On connect | Device connected event |
| device.disconnected | On disconnect | Device disconnected event |
| weather.update | 60s | Weather conditions |
| scheduler.target_started | On change | New observation target |
| scheduler.safety_alert | On event | Weather unsafe, stopping |
| dome.shutter_changed | On change | Shutter state transition |
| polar_alignment.error_computed | On compute | Alt/Az error in arcmin |
| alert | On event | info, warning, error, critical |
