{"openapi":"3.1.0","info":{"title":"TradingRay AI Agent API","version":"1.0.0","description":"Authenticated API for chart analysis, visual PNG snapshots, technical drawings, Radar screener, Demo trading, and Historical Simulator control."},"servers":[{"url":"https://tradingray.com/node-api"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key starting with trk_"},"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"paths":{"/agent/v1/tools":{"get":{"operationId":"listTools","summary":"List permitted tools for the current API key","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"responses":{"200":{"description":"Permitted tools list"}}}},"/agent/v1/chart/image":{"get":{"operationId":"getChartImagePng","summary":"Return raw PNG image of the chart","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"parameters":[{"name":"symbol","in":"query","schema":{"type":"string"}},{"name":"tf","in":"query","schema":{"type":"string","default":"1h"}},{"name":"source","in":"query","schema":{"type":"string","enum":["auto","live","server"],"default":"auto"}},{"name":"bars","in":"query","schema":{"type":"integer","default":120}}],"responses":{"200":{"description":"PNG binary image","content":{"image/png":{"schema":{"type":"string","format":"binary"}}}}}}},"/agent/v1/market_catalogue":{"post":{"operationId":"market_catalogue","summary":"List tradable markets in TradingRay with latest price, 24h % change, and 24h volume. Supports filtering by query, assetClass, and sorting.","x-required-scope":"market:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","description":"Optional ticker/symbol filter substring (e.g. BTC, SOL, XAU)"},"asset_class":{"type":"string","enum":["all","crypto","tradfi"],"default":"all"},"sort":{"type":"string","enum":["volume","gainers","losers"],"default":"volume"},"limit":{"type":"integer","minimum":1,"maximum":100,"default":25},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/chart_analysis":{"post":{"operationId":"chart_analysis","summary":"Fetch OHLCV candles plus server-computed technical indicators (RSI14, EMA9/20/50/200, SMA20/50, MACD, Bollinger Bands, ATR14, VWAP), market structure (swings, BOS, unfilled FVGs, Volume Profile POC/VAH/VAL), funding, orderbook top levels, user drawings, and open demo positions.","x-required-scope":"market:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","default":"BTCUSDT","description":"Market symbol, e.g. BTCUSDT, ETHUSDT, XAUUSDT"},"tf":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","12h","1d","1w","1M"],"default":"1h"},"bars":{"type":"integer","minimum":30,"maximum":250,"default":120},"exchange":{"type":"string","description":"Optional exchange hint (binance_futures, bybit, mexc)"},"include_candles":{"type":"boolean","default":true},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/chart_image":{"post":{"operationId":"chart_image","summary":"Render or capture a visual PNG chart image (candlesticks, volume, EMA20/50, RSI14, drawings, open positions). Uses the live browser/app canvas when open and matching, or renders a crisp server-side PNG.","x-required-scope":"market:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","description":"Market symbol (optional when source=live or app chart is active)"},"tf":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","12h","1d","1w","1M"],"default":"1h"},"bars":{"type":"integer","minimum":30,"maximum":200,"default":120},"source":{"type":"string","enum":["auto","live","server"],"default":"auto"},"chart_id":{"type":"string","description":"Optional target chart tab id when capturing live app screenshot"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/radar_get":{"post":{"operationId":"radar_get","summary":"Read real-time TradingRay Radar screener data: pinned pumps/dumps, active coins, liquidations, RSI/volatility summary, funding rates, and recent radar events.","x-required-scope":"market:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"exchange":{"type":"string","default":"binance_futures","description":"Exchange id, e.g. binance_futures, bybit, mexc"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/alerts_list":{"post":{"operationId":"alerts_list","summary":"List the user’s saved chart drawings/alert levels and recent triggered alert notifications.","x-required-scope":"alerts:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","description":"Optional symbol filter"},"active_only":{"type":"boolean","default":false},"include_notifications":{"type":"boolean","default":true},"categories":{"type":"array","items":{"type":"string","enum":["positions","ta"]}},"limit":{"type":"integer","minimum":1,"maximum":50,"default":25},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/chart_draw":{"post":{"operationId":"chart_draw","summary":"Draw a technical level, trendline, zone, channel, fibo, or arrow on the user’s chart (and optionally arm an alert). Syncs immediately to open CrypSpy charts.","x-required-scope":"alerts:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["symbol","type"],"properties":{"symbol":{"type":"string","description":"Market symbol, e.g. BTCUSDT"},"tf":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","12h","1d","1w","1M"],"default":"1h"},"type":{"type":"string","enum":["hlinemax","hline","line","reqt","paralel","fibo","arrow"]},"price":{"type":"number","description":"Shortcut price for hlinemax / hline when points is omitted"},"time":{"type":"integer","description":"Optional Unix seconds timestamp for shortcut point"},"points":{"type":"array","items":{"type":"object","required":["time","price"],"properties":{"time":{"type":"integer"},"price":{"type":"number"}}}},"trigger":{"type":"boolean","default":false,"description":"Enable price-cross alert notification for this drawing"},"message":{"type":"string","description":"Short label / alert message (max 200 chars)"},"text":{"type":"string","description":"Optional note displayed on chart (max 200 chars)"},"color":{"type":"integer","minimum":0,"maximum":20},"opacity":{"type":"number","minimum":0.1,"maximum":1},"weight":{"type":"integer","minimum":1,"maximum":4},"style":{"type":"integer","minimum":0,"maximum":2},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/chart_drawing_delete":{"post":{"operationId":"chart_drawing_delete","summary":"Delete saved chart drawing(s) by id, ids list (max 20), or for a single symbol (requires confirm_symbol matching symbol).","x-required-scope":"alerts:write","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Single drawing/alert id to delete"},"ids":{"type":"array","items":{"type":"integer"},"maxItems":20},"symbol":{"type":"string","description":"Optional symbol to delete all drawings on that symbol"},"confirm_symbol":{"type":"string","description":"Must equal symbol when deleting all drawings for a symbol"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/demo_state":{"post":{"operationId":"demo_state","summary":"Read the user’s live Demo trading account state: balance, equity, available margin, open positions, pending orders, and recent trade history.","x-required-scope":"demo:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","description":"Optional USDT futures symbol to refresh quote for"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/demo_order":{"post":{"operationId":"demo_order","summary":"Place a live Demo futures order (market, limit, or trigger) subject to the API key’s risk guardrails. Supports client_order_id for idempotency.","x-required-scope":"demo:trade","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["symbol","side","amount"],"properties":{"symbol":{"type":"string","description":"USDT futures symbol, e.g. BTCUSDT"},"side":{"type":"string","enum":["long","short","1","-1"],"description":"long (1) or short (-1)"},"kind":{"type":"string","enum":["market","limit","trigger"],"default":"market"},"unit":{"type":"string","enum":["margin","usdt","coin"],"default":"margin"},"amount":{"type":"number","exclusiveMinimum":0},"leverage":{"type":"integer","minimum":1,"maximum":1000},"margin_mode":{"type":"string","enum":["isolated","cross"],"default":"isolated"},"price":{"type":"number","description":"Required for limit or trigger orders"},"tp":{"type":"number","description":"Optional Take Profit price"},"sl":{"type":"number","description":"Optional Stop Loss price"},"be_at_roi":{"type":"number","description":"Optional breakeven trigger ROI %"},"be_at_price":{"type":"number","description":"Optional breakeven trigger price"},"be_offset":{"type":"number","default":0},"trail_at":{"type":"number","description":"Optional trailing activation ROI %"},"trail_gap":{"type":"number","description":"Optional trailing callback ROI %"},"client_order_id":{"type":"string","description":"Optional idempotency key (max 64 chars)"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/demo_position_manage":{"post":{"operationId":"demo_position_manage","summary":"Manage existing live Demo positions, pending orders, and account trading settings: close, close_all, cancel order, move_order, protect (update TP/SL/BE/trailing), move_protection, or order_settings (configure leverage, margin_mode isolated/cross, position_mode separate/average, and auto_tp_roi).","x-required-scope":"demo:trade","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["close","close_all","cancel","move_order","protect","move_protection","order_settings"]},"id":{"type":"integer","description":"Position or order ID (required except for close_all and order_settings)"},"percent":{"type":"number","minimum":0.01,"maximum":100,"default":100,"description":"Percent to close (for action=close)"},"price":{"type":"number","description":"Target price for move_order or move_protection"},"level":{"type":"string","enum":["tp","sl","be","trailAt","trailing","new"],"description":"Protection level for move_protection"},"tp":{"type":"number"},"sl":{"type":"number"},"be_at_roi":{"type":"number"},"be_at_price":{"type":"number"},"be_offset":{"type":"number"},"trail_at":{"type":"number"},"trail_gap":{"type":"number"},"breakeven":{"type":"boolean"},"symbol":{"type":"string"},"leverage":{"type":"integer","minimum":1,"maximum":1000},"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"Margin mode: isolated or cross (for action=order_settings)"},"position_mode":{"type":"string","enum":["separate","average"],"description":"Position accounting mode for action=order_settings: separate (independent positions) or average (DCA / scale into one position per market & side)"},"auto_tp_roi":{"type":"integer","enum":[0,50,100,200,300],"description":"Default auto Take Profit ROI % (0 = disabled) for action=order_settings"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/app_state":{"post":{"operationId":"app_state","summary":"Inspect the user’s currently open CrypSpy browser/mobile app state: active sidebar section, open chart tabs, symbols, timeframes, active indicators, and simulator status.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/app_navigate":{"post":{"operationId":"app_navigate","summary":"Freely control the open CrypSpy UI on live markets and Demo: switch sidebar section (coins, radar, demo, alerts, ideas, ranking), switch active chart symbol, exchange, and timeframe, switch chart tab, or change multi-chart grid layout. When Simulator is active on the target chart, use simulator_control(action=\"next_round\" or \"exit\") instead.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"section":{"type":"string","enum":["coins","radar","demo","alerts","ideas","ranking"]},"symbol":{"type":"string"},"tf":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","12h","1d","1w","1M"]},"exchange":{"type":"string"},"chart_id":{"type":"string"},"layout":{"type":"integer","minimum":1,"maximum":8},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/simulator_start":{"post":{"operationId":"simulator_start","summary":"Launch the blind Historical Trading Simulator in the open CrypSpy app (smart random asset & historical setup, masked ticker SIM-N and relative timestamps) with smooth human-speed playback and return visible candles + indicators without leaking future candles.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"tf":{"type":"string","enum":["1m","5m","15m","30m","1h"],"default":"1h"},"speed":{"type":"number","minimum":1,"maximum":4,"default":2,"description":"Smooth human-like playback speed (1x..4x)"},"auto_play":{"type":"boolean","default":true},"chart_id":{"type":"string"},"force":{"type":"boolean","default":true,"description":"Close any open simulator session before starting"},"include_candles":{"type":"boolean","default":true},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/simulator_state":{"post":{"operationId":"simulator_state","summary":"Read current Historical Simulator state (masked SIM-N ticker, relative timestamps, candles revealed so far, playback status, simulator balance/equity/positions/orders, and computed indicators). Zero future-candle lookahead.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"chart_id":{"type":"string"},"include_candles":{"type":"boolean","default":true},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/simulator_control":{"post":{"operationId":"simulator_control","summary":"You decide the pace of the Historical Simulator: pause anytime to inspect charts and plan entries, play to resume, change smooth playback speed (1x..4x), deal next_round (optionally switching tf), or exit back to live charts. Stepping/rewinding candles is disabled.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["play","pause","speed","next_round","exit"]},"tf":{"type":"string","enum":["1m","5m","15m","30m","1h"],"description":"Optional timeframe (1m..1h) when action=next_round"},"speed":{"type":"number","minimum":1,"maximum":4,"description":"Smooth human-like playback speed multiplier (1x..4x) for action=speed"},"auto_play":{"type":"boolean"},"force":{"type":"boolean","default":true},"chart_id":{"type":"string"},"include_candles":{"type":"boolean","default":true},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/simulator_trade":{"post":{"operationId":"simulator_trade","summary":"Full trading suite inside the Historical Simulator: configure account settings (order_settings: margin_mode isolated/cross, position_mode separate/average, leverage, auto_tp_roi), place market/limit/trigger orders (margin/usdt/coin units, TP/SL, auto-breakeven BE, trailing stop), scale/average or stack separate trades, partial or full close, close_all, cancel, move_order, protect (including breakeven), and move_protection — enforced by API key risk limits. Trades render Entry/TP/SL lines natively on chart.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["action"],"properties":{"action":{"type":"string","enum":["order","close","close_all","cancel","move_order","protect","move_protection","order_settings"]},"chart_id":{"type":"string"},"side":{"type":"string","enum":["long","short","1","-1"]},"kind":{"type":"string","enum":["market","limit","trigger"],"default":"market"},"unit":{"type":"string","enum":["margin","usdt","coin"],"default":"margin"},"amount":{"type":"number"},"leverage":{"type":"integer","minimum":1,"maximum":1000},"margin_mode":{"type":"string","enum":["isolated","cross"],"description":"Margin mode (isolated or cross); omit on action=order to use configured account setting"},"position_mode":{"type":"string","enum":["separate","average"],"description":"Position accounting mode for action=order_settings: separate (independent positions) or average (DCA / scale into one position per market & side)"},"auto_tp_roi":{"type":"integer","enum":[0,50,100,200,300],"description":"Default auto Take Profit ROI % (0 = disabled) for action=order_settings"},"price":{"type":"number"},"id":{"type":"integer"},"percent":{"type":"number","minimum":0.01,"maximum":100},"level":{"type":"string","enum":["tp","sl","be","trailAt","trailing","new"]},"tp":{"type":"number"},"sl":{"type":"number"},"be_at_roi":{"type":"number"},"be_at_price":{"type":"number"},"be_offset":{"type":"number"},"trail_at":{"type":"number"},"trail_gap":{"type":"number"},"breakeven":{"type":"boolean"},"auto_play":{"type":"boolean","default":true},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/simulator_draw":{"post":{"operationId":"simulator_draw","summary":"Draw a temporary technical figure (level, trendline, zone, channel, fibo, arrow) on the active Historical Simulator chart using CrypSpy native drawing style by default.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"chart_id":{"type":"string"},"type":{"type":"string","enum":["hlinemax","hline","line","reqt","paralel","fibo","arrow"]},"price":{"type":"number"},"time":{"type":"integer"},"points":{"type":"array","items":{"type":"object","required":["time","price"],"properties":{"time":{"type":"integer"},"price":{"type":"number"}}}},"color":{"type":"integer","minimum":0,"maximum":20},"opacity":{"type":"number","minimum":0.1,"maximum":1},"weight":{"type":"integer","minimum":1,"maximum":4},"style":{"type":"integer","minimum":0,"maximum":2},"text":{"type":"string"},"message":{"type":"string"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/chart_indicators":{"post":{"operationId":"chart_indicators","summary":"Manage technical indicators on any open CrypSpy chart (live, Demo, or Simulator): browse available catalog, inspect installed indicators + settings, add indicators (ma, ema, bb, rsi, macd, stoch, atr, cci, williams_r, supertrend, donchian, vwap, vp, smc, smccontext, wyckoff, autopatterns, candlestickpatterns, supportresistance, orderbook, etc.), update parameters (period, colors in #RRGGBB, width, height, ob/os, fastPeriod/slowPeriod/signalPeriod, multiplier, SMC/pattern toggles), remove by uid/type, or clear.","x-required-scope":"app:control","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["list","catalog","add","update","remove","clear"],"default":"list"},"chart_id":{"type":"string","description":"Optional target chart tab id (defaults to active chart)"},"type":{"type":"string","description":"Indicator type (e.g. ema, ma, bb, rsi, macd, supertrend, smc, smccontext, wyckoff, autopatterns, vp, vwap, orderbook)"},"uid":{"type":"string","description":"Installed indicator instance id (e.g. i3) when updating or removing a specific instance"},"settings":{"type":"object","additionalProperties":true,"description":"Indicator parameters object, e.g. { period: 50, color: \"#FFD700\", width: 2 } or { fastPeriod: 12, slowPeriod: 26, signalPeriod: 9 } or { ob: 75, os: 25, showDivergences: true }"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}},"/agent/v1/agent_events":{"post":{"operationId":"agent_events","summary":"Read or wait (long-poll) for real-time trading, simulator game-outcome, and alert events filtered by your API key scopes: limit/trigger fills, TP/SL/breakeven/trailing triggers, liquidations, simulator round win/loss outcomes, end-of-candles/game-finished results, and price alert triggers.","x-required-scope":"alerts:read","security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"since_seq":{"type":"integer","minimum":0,"description":"Return events strictly newer than this seq cursor (defaults to last seen cursor for this key)"},"categories":{"type":"array","items":{"type":"string","enum":["simulator","demo","alerts"]},"description":"Optional event category filter"},"limit":{"type":"integer","minimum":1,"maximum":50,"default":25},"wait_seconds":{"type":"number","minimum":0,"maximum":20,"default":0,"description":"Optional real-time wait in seconds; returns immediately as soon as any matching event arrives"},"thought":{"type":"string","maxLength":240,"description":"Optional short 1-sentence comment for the live top ticker explaining what you are doing and why"}}}}}},"responses":{"200":{"description":"Success JSON envelope { ok: true, data }"},"401":{"description":"Missing or invalid API key"},"403":{"description":"Missing scope or risk guardrail limit"}}}}}}