API Reference · v1.0

AVRENIX API

Programmatic access to all nine Avrenix engines. Integrate FENRIR's adversarial planning, HELIOS's ensemble forecasts, and STRIX's Monte Carlo simulation directly into your dispatch systems, trading platform, or SCADA integration.

Base URLhttps://api.avrenix.com/v1
AuthBearer JWT
FormatJSON / REST
AvailableFleet · Enterprise
Authentication

All API requests require a JWT bearer token. Obtain your token from the portal under Settings → API Keys. Tokens are scoped to your plan — Fleet tokens access FoM engines only; Enterprise tokens access all nine engines including PHALANX and TARSIS.

🔑

Include your token in every request as Authorization: Bearer <token>. Tokens expire after 24 hours. Use POST /auth/refresh with your refresh token to obtain a new access token without re-authenticating.

Request Header
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Content-Type:   application/json
Login — POST /api/auth/login
// Request
{
  "email":    "[email protected]",
  "password": "••••••••••••"
}

// Response
{
  "ok": true,
  "data": {
    "token":      "eyJhbGci...",
    "expires_in": 86400,
    "user": {
      "email": "[email protected]",
      "plan":  "fleet"
    }
  }
}
FENRIR — Adversarial Weather Engine

Runs the complete differentiators cycle: adversarial scenario generation, market microstructure analysis, causal attribution, grid personality update, and autonomous negotiation. Returns a synthesised dispatch recommendation with full engine outputs.

All FoM Plans
POST /api/fenrir/cycle Run full differentiators cycle
Parameters
FieldTypeDefaultDescription
site_idstring"default"Unique site identifier
battery_power_mwfloat50.0Rated battery power in MW
battery_capacity_mwhfloat200.0Usable energy capacity in MWh
current_socfloat0.65State of charge 0–1
current_pricefloatRequired. Spot price $/MWh
planned_dispatch_mwfloat45.0Planned dispatch MW this interval
directionstring"discharge""charge" | "discharge" | "idle"
horizon_hoursint4Planning horizon (1–48)
Example Request — illustrative values
{
  "site_id":              "site-001",
  "battery_power_mw":     100,
  "battery_capacity_mwh": 400,
  "current_soc":          0.75,
  "current_price":         80.00,
  "planned_dispatch_mw":  80,
  "direction":             "discharge",
  "horizon_hours":         4
}
Response Shape — illustrative values
{
  "ok": true,
  "data": {
    "cycle_id":                  "...",
    "recommended_dispatch_mw":   80.0,
    "recommended_direction":     "discharge",
    "confidence":               0.88,
    "estimated_revenue":         /* $ over horizon */,
    "regime":                    "peak",
    "adversarial_report":        { /* AdversarialReport */ },
    "differentiator_insights":  ["Grid regime: PEAK..."]
  }
}
HELIOS — Ensemble Forecast Engine

Four-model ensemble (LSTM, XGBoost, Prophet, TFT) with conformal prediction intervals guaranteeing calibrated coverage. Drift detection via ADWIN + PSI alerts when market regime shifts.

All FoM Plans
POST /api/helios/forecast Ensemble price/demand forecast
FieldTypeDefaultDescription
valuesfloat[]Required. Historical observations (min 24, recommend 168)
periodsint48Forecast horizon in intervals
weightsobjectnullPer-model weight overrides {"LSTM": 0.5, ...}
Response Shape — illustrative values
{
  "ensemble_forecast": [...],  // forecast horizon values
  "p10":               [...],  // lower prediction interval
  "p90":               [...],  // upper prediction interval
  "mape":              /* error on your data */,
  "coverage":          /* conformal interval coverage */,
  "models": {
    "LSTM":    { "weight": ..., "mape": ... },
    "XGBoost": { "weight": ..., "mape": ... }
  }
}
STRIX — Monte Carlo Theatre

Bayesian Monte Carlo simulation over stochastic price and load futures. Evaluates dispatch policies (Arbitrage-Opt, Risk-Aware CVaR, RL Aggressive) across thousands of sampled paths and returns Shapley attribution of P10/P50/P90 revenue.

Fleet Enterprise
POST /api/strix/submit Submit Monte Carlo simulation job
FieldTypeDefaultDescription
policystring"arbitrage""arbitrage" | "cvar" | "rl"
n_pathsint10000Monte Carlo path count (1k–50k)
horizon_daysint30Simulation horizon in days
battery_power_mwfloat50.0Battery power rating
battery_capacity_mwhfloat200.0Battery energy capacity
Response Shape — illustrative values
{
  "job_id":              "...",
  "p10_annual_revenue":  /* $ at 10th percentile */,
  "p50_annual_revenue":  /* $ at median */,
  "p90_annual_revenue":  /* $ at 90th percentile */,
  "paths_per_second":    /* observed sim throughput */,
  "shapley": {
    "forecast_accuracy":     ...,
    "regime_classification": ...,
    "soc_management":        ...,
    "ancillary_revenue":     ...
  }
}
PHALANX — Demand Charge Elimination

Probabilistic peak window forecasting for behind-the-meter facilities. Every candidate dispatch schedule is validated through STRIX before commitment — any schedule with peak miss probability above 5% is rejected. Demand-charge reduction is measured on your own billing data during a pilot.

Enterprise
POST /api/phalanx/risk Peak risk assessment for current interval
FieldTypeDefaultDescription
facility_idstring"default"Facility identifier
current_load_kwfloatRequired. Current facility load in kW
temperature_ffloat75.0Ambient temperature °F (weather-driven load)
hour_of_dayintRequired. Hour 0–23
days_remainingintRequired. Days left in billing period
Response Shape — illustrative values
{
  "peak_risk_probability": /* 0–1 */,
  "window_start":          "14:30",
  "window_end":            "16:00",
  "confidence":            /* 0–1 */,
  "recommended_action":    "discharge_full",
  "demand_charge_liability":/* $ exposure */
}
TARSIS — Tariff & Rate Intelligence

Joint optimisation across all tariff components — TOU energy charges, demand tiers, NEM export compensation, EV fleet coordination, and 12-month ratchet clauses — as a single objective function. 200+ utility rate structures supported.

Enterprise
POST /api/tarsis/schedule Optimal 24h dispatch across full tariff structure
FieldTypeDefaultDescription
facility_idstring"default"Facility identifier
tariffstring"PG&E-BDB"Tariff code from 200+ library (GET /tarsis/tariffs)
current_socfloat0.65Battery state of charge 0–1
monthintRequired. Billing month 1–12 (affects seasonal rates)
Response Shape — illustrative values
{
  "rate_breakdown": {
    "tou_savings":              /* $ */,
    "demand_savings":           /* $ */,
    "export_revenue":           /* $ */,
    "ev_coordination_savings":  /* $ */,
    "total_annual":             /* $ */
  },
  "solve_time_ms":  /* solver wall time */,
  "optimality_gap_pct": /* MILP gap */
}
Error Handling

All error responses follow the same envelope. HTTP status codes are used conventionally. Engine-level errors include the engine name in the error field.

Error Response
{
  "ok":    false,
  "error": "Invalid SOC value: must be between 0 and 1"
}

// HTTP Status Codes
400  Bad Request — validation error in request body
401  Unauthorized — missing or invalid token
403  Forbidden — plan does not include this engine
422  Unprocessable — parameter range violation
429  Rate limited — see X-RateLimit-Reset header
500  Engine error — see error field for detail
Rate Limits
PlanRequests / minSTRIX paths / day
Operator60
Fleet3005M
EnterprisePer agreementPer agreement

Rate limit headers are included on every response: X-RateLimit-Remaining and X-RateLimit-Reset. The Operator and Fleet figures are the target per-plan limits; Enterprise limits are set in the partner agreement rather than fixed here. These are the intended allocations, scoped per partner — not a validated throughput guarantee at scale.

System Endpoints
GET /api/health Gateway and all engine health
{
  "gateway": "ok",
  "engines": {
    "differentiators": "ok",
    "forecasting":     "ok",
    "simulation":      "ok",
    "phalanx":         "ok",
    "tarsis":          "ok"
  },
  "version": "1.0.0"
}
GET /api/status Per-engine uptime and latency
// illustrative response — telemetry fields populated once live
{
  "overall": "operational",
  "engines": [
    { "id": "helios", "status": "operational",
      "latency_ms": /* live p50 */, "uptime_30d": /* live % */ },
    ...
  ]
}