Platform APIs
HyperionX has several API layers. This page is an API overview for developers, script authors, and agent integrations. It is reference material, not a learning path and not the product roadmap.
Use this page to understand the API families. Use HyperionX API Spec for the target contracts. Use Code Lab Learning Path when the goal is to learn how to build scripts.
API Layers
| API Layer | Status | Purpose |
|---|---|---|
| Code Lab Runtime API | Current | In-process C# indicators, strategies, bar types, optimizers, commissions, money management modules, and addons. |
| Provider API Layer | Current | Maps broker/exchange/simulation/playback providers into HyperionX instruments, candles, accounts, orders, and positions. |
| Chart AI Context API | Current | Read-only chart snapshot used by the in-app AI assistant. |
| Local Agent HTTP API | Current, partial | Rion localhost API for chart context, candles, indicators, signals, drawings, economic news, orders, positions, Code Lab actions, validator/optimizer actions, and guarded sim actions. |
| CLI API | Planned | Terminal-friendly wrapper around local APIs and Code Lab diagnostics. |
| Permissioned Action API | Current, sim-only | Controlled Rion actions for Hyperion Sim order placement, cancel, modify, close, and flatten. Live trading remains planned and locked. |
Code Lab Runtime API
Current Code Lab scripts run in-process and use HyperionX assemblies:
HyperionX.Core.dllHyperionX.Chart.dllHyperionX.Model.dllHyperionX.DB.dllHyperionX.SDK.dll
Primary script base areas:
HyperionX.Core.DataCalc.ScriptBaseHyperionX.Core.DataCalc.IndicatorBaseHyperionX.Core.DataCalc.StrategyBaseHyperionX.Core.DataCalc.Draw
Public script authors should use the generated Indicator and Strategy base classes in the HyperionX.Custom namespaces rather than deriving directly from lower-level internal classes.
Provider API Layer
Providers translate external systems into the HyperionX model.
Provider adapters should map:
- Connection state.
- Instrument metadata.
- Historical data.
- Live market data.
- Market depth where available.
- Account balances.
- Orders.
- Order states.
- Positions.
- Executions.
- Leverage and margin settings where supported.
Provider adapters should not leak provider-specific implementation details into chart UI or Code Lab unless the feature is intentionally exposed.
Chart AI Context API
Current status: implemented in-app, read-only.
The chart AI context exposes safe chart state:
- Candles.
- Visible candles.
- Indicator metadata.
- Strategy metadata.
- Chart Trader state.
It intentionally does not expose:
- Credentials.
- API keys.
- Wallet keys.
- Raw filesystem access.
- Direct order submission.
Current Local Agent API
The current local agent API exposes chart, Code Lab, research-tool, and guarded simulation action context over localhost for Rion.
Current runtime:
http://127.0.0.1:5217
The desktop app falls back through ports 5217 to 5226 if the default port is already in use.
Current rules:
- Bind to localhost only.
- Read-only endpoints are available for chart and platform context.
- Trading actions require the Rion setting, Hyperion Sim, and confirmed execution.
- Redact secret-like values.
- Include build/version metadata.
- Keep live trading disabled unless explicitly enabled.
Planned hardening:
- Per-session token.
- Explicit permission scopes.
- Multi-chart IDs.
- Live streaming.
- CLI wrapper.
Current Read Endpoints
GET /health
GET /api/v1/rion/health
GET /api/v1/rion/capabilities
GET /api/v1/rion/state
GET /api/v1/rion/chart
GET /api/v1/rion/candles?scope=analysis|recent|visible&limit=120
GET /api/v1/rion/indicators
GET /api/v1/rion/signals
GET /api/v1/rion/drawings
GET /api/v1/rion/news?scope=upcoming|today|week|all|past&limit=50&minImpact=0..3&countries=USD
GET /api/v1/rion/chart-trader
GET /api/v1/rion/orders
GET /api/v1/rion/positions
GET /api/v1/rion/scripts
GET /api/v1/rion/strategy-tools
GET /api/v1/rion/validator/status
GET /api/v1/rion/optimizer/status
GET /api/v1/rion/context
GET /api/v1/rion/memory
Current Action Endpoints
POST /api/v1/rion/action
POST /api/v1/rion/validator/action
POST /api/v1/rion/optimizer/action
POST /api/v1/rion/code-lab/action
POST /api/v1/rion/drawings/action
POST /api/v1/rion/trading/action
These endpoints support Rion workflows without requiring an agent to scrape UI controls.
Current drawing actions:
GET /api/v1/rion/drawingsreturns drawing objects on the active chart.POST /api/v1/rion/drawings/actioncreates, lists, or removes active-chart drawings.- Supported action values include
list_drawings,clear_agent_drawings,clear_all_drawings,draw_levels,draw_high_low_range,draw_london_range, anddraw_support_resistance. - Rion-created drawings are tagged with the
RION:prefix soclear_agent_drawingsremoves Rion drawings without deleting manual user drawings. clear_all_drawingsrequiresclearAllDrawings: trueand should not be used by default.
Example drawing action:
{
"action": "draw_london_range",
"scope": "recent",
"sessionStart": "02:00",
"sessionEnd": "05:00",
"replaceExistingAgentDrawings": true,
"drawLabels": true
}
Current economic news endpoint:
GET /api/v1/rion/newsreturns events from the same shared economic calendar service used by the News window and NewsEcon indicator.- Query parameters:
scope,limit,minImpact,countries,search, andrefreshHours. scopesupportsupcoming,today,week,all, andpast.minImpactuses0to3, where3is high impact.
Example news request:
GET /api/v1/rion/news?scope=upcoming&limit=20&minImpact=2&countries=USD
Current Code Lab actions:
- Open Code Lab.
- List scripts.
- Compile custom scripts.
- Return Code Lab status.
Current validator/optimizer actions:
- Open.
- Create/setup from active chart.
- Run.
- Cancel/stop.
- Status.
Current trading actions:
- Place Hyperion Sim buy/sell market, ask, bid, limit, and stop orders.
- Cancel working orders.
- Modify price or quantity.
- Close position.
- Flatten.
Trading actions are blocked unless the user enables Rion sim trading actions and confirms execution.
Planned CLI
A CLI can wrap the same local APIs.
Example future commands:
hx chart list
hx chart active --json
hx chart snapshot --chart active --bars 120 --json
hx chart visible --chart active --json
hx codelab build
hx codelab validate-script ./MyIndicator.cs
hx workspace status
JSON output should be the default for agent workflows. Human-readable output can be optional.
Permissioned Action APIs
Action APIs should be staged by risk.
| Stage | Example | Rule |
|---|---|---|
| Read-only | Chart snapshot | Allowed with token. |
| Diagnostics | Code Lab build | Allowed with token and workspace permission. |
| Draft | Prepare order ticket | Does not submit order. |
| Simulation | Submit sim order | Requires simulation mode permission. |
| Live | Submit live order | Requires explicit enablement, confirmation, risk limits, and audit log. |
Compatibility Rules
Public APIs should avoid private UI objects and fragile implementation details.
Stable public direction:
- Code Lab scripts through documented C# namespaces.
- Read-only chart snapshots through local agent APIs.
- Provider data through HyperionX provider abstractions.
- Trading actions only through permissioned, audited tools.
- Versioned API contracts so agents can check compatibility.