{
  "service": "rksp-gateway — Home Assistant scripts & scenes over HTTP (throwaway)",
  "auth": "every route except / and /health: header 'X-API-Key: <key>', 'Authorization: Bearer <key>', or query ?key=<key>",
  "endpoints": {
    "GET /health": "liveness, no key needed",
    "GET /lights": "the lights, their current state, and the script that drives each",
    "GET /scripts": "every HA script and the fields it takes",
    "GET /scripts/{id}": "one script's fields",
    "POST /scripts/{id}": "run it — JSON (or form) body = its fields",
    "GET /scripts/{id}/run?<field>=<value>&...": "run it via GET",
    "GET /scenes": "every HA scene",
    "GET /scenes/{id}": "one scene and the entities it sets",
    "POST /scenes/{id}": "activate it — optional {\"transition\": seconds}",
    "GET /scenes/{id}/run": "activate it via GET"
  },
  "examples": [
    "curl -X POST https://rksp-gateway.salut.uno/scripts/rksp_lamp -H 'X-API-Key: <key>' -H 'Content-Type: application/json' -d '{\"option\": \"brightness\", \"value\": 40}'",
    "https://rksp-gateway.salut.uno/scripts/rksp_lamp/run?option=color&value=%23ff8800&key=<key>",
    "https://rksp-gateway.salut.uno/scripts/rksp_lamp/run?option=state&value=off&key=<key>"
  ]
}