Skip to main content

LUX API Endpoints

The LUX API provides endpoints for daylight simulation and server health monitoring.

Quick Start

  1. Join the beta program to obtain an API token
  2. Call the API endpoints using Bearer authentication

Pricing

Commercial (Hosted): Using https://api-lux.upskiller.xyz/v1 requires an API token and is subject to usage fees.

Free (Self-Hosted): Deploy locally at no cost. See deployment guide.

Endpoints

Health Check

GET /

Check server health and availability.

Request

GET https://api-lux.upskiller.xyz/v2/

Response

{
"status": "ok",
"service": "lux-api",
"version": "1.0.0"
}

No authentication required for health check endpoint.

curl https://api-lux.upskiller.xyz/v2/

Calculate Horizon Angle

POST /horizon

Calculate the horizon angle - the angle measured upward from horizontal to the highest obstruction point.

Authentication Required: Include Authorization: Bearer YOUR_API_TOKEN header.

Request Body

{
"x": 0.0,
"y": 3.0,
"z": 0.0,
"rad_x": 0.0,
"rad_y": 0.0,
"mesh": [
[10.0, 0.0, -5.0],
[10.0, 5.0, -5.0],
[10.0, 0.0, 5.0]
]
}

Response

{
"status": "success",
"data": {
"obstruction_angle_degrees": 11.31,
"obstruction_angle_radians": 0.1974,
"highest_point": {
"x": 10.0,
"y": 5.0,
"z": -5.0
},
"projected_point_count": 6
}
}

See API Reference for complete parameter specifications.


Calculate Zenith Angle

POST /zenith

Calculate the zenith angle - the angle measured downward from vertical to the lowest overhead obstruction point.

Authentication Required: Include Authorization: Bearer YOUR_API_TOKEN header.

Request Body

Same parameters as /horizon endpoint.

Response

{
"status": "success",
"data": {
"obstruction_angle_degrees": 51.34,
"obstruction_angle_radians": 0.8961,
"highest_point": {
"x": 5.0,
"y": 7.0,
"z": -2.0
},
"projected_point_count": 6
}
}

See API Reference for complete parameter specifications.


Calculate Both Angles

POST /obstruction

Calculate both horizon and zenith angles in a single request.

Authentication Required: Include Authorization: Bearer YOUR_API_TOKEN header.

Request Body

Same parameters as individual angle endpoints.

Response

{
"status": "success",
"data": {
"horizon": {
"obstruction_angle_degrees": 11.31,
"obstruction_angle_radians": 0.1974,
"highest_point": {...},
"projected_point_count": 6
},
"zenith": {
"obstruction_angle_degrees": 78.69,
"obstruction_angle_radians": 1.3734,
"highest_point": {...},
"projected_point_count": 6
}
}
}

See API Reference for complete parameter specifications.


Execute Daylight Simulation

POST /run

Executes daylight simulation from room geometry and obstruction mesh.

Authentication Required: Include Authorization: Bearer YOUR_API_TOKEN header.

Request Body

{
"model_type": "df_default" | "da_default" | "df_custom" | "da_custom",
"parameters": {
"height_roof_over_floor": 2.7,
"floor_height_above_terrain": 3.0,
"room_polygon": [[0, 0], [5, 0], [5, 4], [0, 4]],
"windows": {
"window_id": {
"x1": -0.6, "y1": 0.0, "z1": 0.9,
"x2": 0.6, "y2": 0.0, "z2": 2.4,
"window_frame_ratio": 0.15
}
}
},
"mesh": [
[10, 0, 0],
[10, 0, 5],
[10, 10, 5],
[10, 10, 0]
]
}

Response

JSON object containing simulation results with base64-encoded numpy array and shape information.

See Parameters for complete parameter specifications and API Reference for detailed documentation.

Example Requests

curl -X POST https://api-lux.upskiller.xyz/v2/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"model_type": "df_default",
"parameters": {
"height_roof_over_floor": 2.7,
"floor_height_above_terrain": 3.0,
"room_polygon": [[0, 0], [5, 0], [5, 4], [0, 4]],
"windows": {
"main_window": {
"x1": -0.6, "y1": 0.0, "z1": 0.9,
"x2": 0.6, "y2": 0.0, "z2": 2.4,
"window_frame_ratio": 0.15
}
}
},
"mesh": [
[10, 0, 0],
[10, 0, 5],
[10, 10, 5],
[10, 10, 0]
]
}'

See complete schema: Request Schema

Error Responses

All endpoints return JSON errors with appropriate status codes:

{
"error": "Error message description"
}

See Response Format for detailed error documentation.

Rate Limits

Hosted API has no enforced rate limits currently. Subject to change as service scales.

Next Steps

API Reference - Complete parameter documentation

Authentication - Detailed authentication guide