MaximaLabsOpen app

REST & WebSockets API

Async job endpoints (`POST /api/simulations/{id}/run`) plus a WebSocket status channel fed by worker → Redis pub/sub → API forwarding, so a solve's completion reaches an open connection without polling.

apirestwebsocket
Concept

Every solve is an async job — the API enqueues it through ARQ and returns immediately; the worker process is the only place that imports the solver. A WebSocket status channel, fed by the worker publishing to Redis pub/sub, forwards the finished result the moment it's ready — no polling required (though polling still works).

Execution
POST /api/simulations                       # create from a flowsheet JSON
GET|PUT /api/simulations/{id}                # fetch or update
POST /api/simulations/{id}/run               # enqueue a solve (async worker)
GET /api/simulations/{id}/status             # poll, or subscribe over WebSocket
GET /api/simulations/{id}/streams            # solved stream table (SI units)
POST /api/ai/chat                            # AI copilot — generate / diagnose / advise
GET /api/components · /api/thermo-packages   # available components & thermo models
402Free-plan usage quota exceeded on run/optimize/sensitivity — checked before the job is even enqueued.