You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All bodies are JSON. Unknown request fields are rejected (extra="forbid"). Most requests take
session_id (default "default", pattern ^[A-Za-z0-9_-]{1,40}$), and at most 16 sessions can exist.
(This is an example of the format, not a claim about a particular run.)
status is one of simulated | measured | ai_estimate. The v0.1 engine only ever emits simulated.
The other two values are reserved so that measured data and future AI estimates always stay distinguishable.
The Godot client rejects any state that contains non-simulated values.
A value of null means not finite or not available. Clients must show "Not available", never a placeholder.
reference_range and uncertainty are reserved, optional fields. They are not populated in v0.1.
Errors
HTTP
detail.error
When
422
validation_error
Malformed body, unknown field, unknown parameter id, value outside its operating bounds, non-adjustable parameter, *_initial parameter applied live
404
not_found / message
Unknown scenario, experiment, organ or session
409
simulation_error / running
Simulation failed (solver or invalid state), or step called while the real-time clock runs
Server-side real-time clock, speed simulated s per wall-clock s
POST
/api/v1/simulation/pause
{session_id?}
POST
/api/v1/simulation/reset
{session_id?}
Back to t = 0. Scenario events are kept; user live changes are discarded
POST
/api/v1/simulation/step
{session_id?, duration_s: (0, 604800]}
Rounded to whole sample intervals. Returns 409 while running
POST
/api/v1/simulation/change
{session_id?, parameters{}, inputs{}, label}
Live change at the current time. Only user_adjustable ids are accepted; *_initial ids are rejected. Logged as a user event so the run stays reproducible
B interpolated onto A's time grid: final values, final difference, max abs and RMS difference. Without experiment_b, compares with the live session
Future AI (contract only)
Method
Path
Notes
GET
/api/v1/ai/contract
JSON schemas of AIPredictionRequest / AIPredictionResponse (contract ai-contract-0.1)
POST
/api/v1/ai/predict
Validates the request body, then always 501 in v0.1
See docs/future_ai/ai_integration_api.md.
Typical client sequence
GET /health
GET /api/v1/variables, /api/v1/parameters, /api/v1/scenarios
POST /api/v1/scenarios/load {"scenario_id": "exercise_moderate"}
POST /api/v1/simulation/start {"speed": 10}
GET /api/v1/simulation/state (poll ~4 Hz) or WS /api/v1/simulation/stream
POST /api/v1/simulation/change {"inputs": {"input.workload_w": 150}}
POST /api/v1/simulation/pause
POST /api/v1/experiments/save {"name": "my run"}
POST /api/v1/data/export {"formats": ["csv", "json"]}
Storage schema
SQLite table experiments (see the docstring of app/storage/store.py): id, name, notes, created_at_utc, scenario_id, simulation_id, model_version, duration_s, config_json, metadata_json, timeseries_csv, data_type. data_type is always synthetic_simulation_output.
Export formats
CSV: header time_s,<variable ids…>, one row per sample. Units are in the metadata sidecar.
Metadata JSON: everything from /simulation/metadata, plus columns[{id, label, unit, source, status}]
and n_samples.