{"openapi":"3.1.0","info":{"title":"AlpaTrade API","description":"AlpaTrade's production REST API for research, backtesting, validation, paper trading,\nreconciliation, reporting, and the primary LangChain DeepAgents assistant.\n\nUse `Authorization: Bearer <JWT>` for user clients. Trusted services may use\n`X-API-Key`; include `X-User-Id` only when acting on behalf of a specific user.\nAll order and autonomy endpoints are paper-only.","contact":{"name":"Predictive Labs","url":"https://alpatrade.chat/developers"},"license":{"name":"MIT","identifier":"MIT"},"version":"0.13.0"},"servers":[{"url":"https://api.alpatrade.chat","description":"Production"}],"paths":{"/":{"get":{"tags":["meta"],"summary":"Api Info","description":"Human- and machine-readable API discovery document.","operationId":"api_info__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiInfoResponse"}}}}},"security":[]}},"/v2/agents":{"get":{"tags":["agent-invocation"],"summary":"Discover callable agents and their skills","description":"Machine-readable catalogue of every supported agent, its canonical endpoint, skills, access boundary, execution model, and safety level. Direct browser visits are redirected to the formatted ReDoc reference; API clients continue to receive this typed JSON document.","operationId":"v2_agent_catalog_v2_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCatalogResponse"},"example":{"agents":[{"slug":"deep-agent","name":"DeepAgent Assistant","category":"assistant","description":"Primary LangChain DeepAgents harness with research and broker tools.","method":"POST","path":"/v2/agents/chat/invoke","access":"authenticated","execution":"synchronous","safety":"paper_only","skills":["Portfolio and position analysis","Market news and company research","Backtest and reporting tool routing","Paper-account workflow assistance"]},{"slug":"deep-agent-stream","name":"DeepAgent Assistant (SSE)","category":"assistant","description":"Streaming DeepAgents chat with token, route, and tool events.","method":"POST","path":"/v2/chat","access":"public","execution":"streaming","safety":"paper_only","skills":["Token-by-token conversational responses","Agent routing events","Tool execution events","Conversation-thread continuity"]},{"slug":"premarket","name":"Premarket Agent","category":"research","description":"Read-only premarket scan and ranked mover intelligence.","method":"POST","path":"/v2/agents/premarket/invoke","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Premarket mover discovery","Catalyst and news synthesis","Candidate ranking","Saved-scan retrieval"]},{"slug":"alpha-growth","name":"Alpha Growth Agent","category":"research","description":"Evidence-backed growth-company research report.","method":"POST","path":"/v2/agents/alpha-growth/invoke","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Growth-quality assessment","Fundamental evidence collection","Catalyst and risk analysis","Persistent research reports"]},{"slug":"alpha-value","name":"Alpha Value Agent","category":"research","description":"Evidence-backed value-company research report.","method":"POST","path":"/v2/agents/alpha-value/invoke","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Valuation and margin-of-safety review","Fundamental evidence collection","Catalyst and risk analysis","Persistent research reports"]},{"slug":"alpha-compare","name":"Alpha Comparison Agent","category":"research","description":"Growth and value views generated from one shared evidence collection.","method":"POST","path":"/v2/agents/alpha-compare/invoke","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Shared-evidence company research","Growth-versus-value comparison","Thesis conflict identification","Paired persistent reports"]},{"slug":"backtest","name":"Backtest Agent","category":"analysis","description":"Run the parameter-grid backtest and return the best configuration.","method":"POST","path":"/v2/backtest","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Strategy parameter sweeps","Historical performance analysis","Risk and drawdown metrics","Best-configuration selection"]},{"slug":"validator","name":"Validation Agent","category":"analysis","description":"Validate stored backtest or paper trades against market data.","method":"POST","path":"/v2/validate","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Trade-price verification","Anomaly detection","Fill correction checks","Validation suggestions"]},{"slug":"reporter","name":"Report Agent","category":"analysis","description":"Return run summaries, detail, P&L, and ranked strategies.","method":"GET","path":"/v2/report","access":"authenticated","execution":"synchronous","safety":"read_only","skills":["Run summary reporting","P&L breakdowns","Strategy ranking","Performance metric retrieval"]},{"slug":"paper-trader","name":"Paper Trade Agent","category":"trading","description":"Start a durable paper-trading subprocess and return immediately.","method":"POST","path":"/v2/paper","access":"authenticated","execution":"asynchronous","safety":"paper_only","skills":["Durable paper-strategy execution","Configurable polling and duration","PDT-aware trade controls","Background run monitoring"]},{"slug":"reconciler","name":"Reconciliation Agent","category":"trading","description":"Compare the position ledger with the linked Alpaca paper account.","method":"POST","path":"/v2/reconcile","access":"authenticated","execution":"synchronous","safety":"paper_only","skills":["Position-ledger reconciliation","Trade mismatch detection","Missing and extra fill checks","Broker-versus-database P&L comparison"]},{"slug":"orchestrator","name":"Five-Agent Orchestrator","category":"orchestration","description":"Run backtest, validation, paper trading, and reporting as one workflow.","method":"POST","path":"/v2/full","access":"authenticated","execution":"synchronous","safety":"orchestration","skills":["Multi-agent workflow coordination","Backtest-to-paper promotion","Phase status aggregation","End-to-end run reporting"]},{"slug":"autonomy-scout","name":"Autonomy Scout","category":"orchestration","description":"Scan candidates and enqueue the durable paper-only agent pipeline.","method":"POST","path":"/v2/agents/autonomy-scout/invoke","access":"authenticated","execution":"asynchronous","safety":"paper_only","skills":["Market candidate scouting","Strategy-aware candidate ranking","Durable autonomy-run enqueueing","Paper-only account isolation"]}],"total":13}}}},"307":{"description":"Browser navigation to the formatted API reference"}},"security":[]}},"/auth/register":{"post":{"tags":["auth"],"summary":"Auth Register","description":"Register a new user account.","operationId":"auth_register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/auth/login":{"post":{"tags":["auth"],"summary":"Auth Login","description":"Authenticate and receive a JWT token.","operationId":"auth_login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/runs":{"get":{"tags":["data"],"summary":"V2 Runs","description":"List recent orchestrator runs.","operationId":"v2_runs_v2_runs_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/trades":{"get":{"tags":["data"],"summary":"V2 Trades","description":"Query trades with optional filters.","operationId":"v2_trades_v2_trades_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"symbol","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/report":{"get":{"tags":["agent-invocation"],"summary":"Invoke Report Agent","description":"List run summaries (performance overview).\n\n### Agent skills\n\n- Run summary reporting\n- P&L breakdowns\n- Strategy ranking\n- Performance metric retrieval\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_report_summary_v2_report_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"strategy","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReportSummaryItem"},"title":"Response V2 Report Summary V2 Report Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-agent-slug":"reporter","x-agent-category":"analysis","x-agent-skills":["Run summary reporting","P&L breakdowns","Strategy ranking","Performance metric retrieval"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/report/{run_id}":{"get":{"tags":["data"],"summary":"V2 Report Detail","description":"Detailed performance report for a single run.","operationId":"v2_report_detail_v2_report__run_id__get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/top":{"get":{"tags":["data"],"summary":"V2 Top","description":"Rank strategy slugs by average performance.","operationId":"v2_top_v2_top_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"strategy","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TopStrategyItem"},"title":"Response V2 Top V2 Top Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/logs":{"get":{"tags":["data"],"summary":"V2 Logs","description":"Read paper trading log tail.","operationId":"v2_logs_v2_logs_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"lines","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Lines"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/pnl/{run_id}":{"get":{"tags":["data"],"summary":"V2 Pnl","description":"P&L breakdown for a specific run — per-symbol and daily.","operationId":"v2_pnl_v2_pnl__run_id__get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PnlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/positions":{"get":{"tags":["data"],"summary":"V2 Positions","description":"Return live paper positions, or query historical positions by run/status.\n\nThe default request used by the mobile Portfolio screen reads Alpaca so\nprices and unrealized P&L are current. Requests for a specific run or for\nnon-open history continue to use the database ledger.","operationId":"v2_positions_v2_positions_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'open' or 'closed'","title":"Status"},"description":"'open' or 'closed'"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/status":{"get":{"tags":["agents"],"summary":"V2 Status","description":"Current orchestrator / agent status.","operationId":"v2_status_v2_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/v2/stop":{"post":{"tags":["agents"],"summary":"V2 Stop","description":"Stop a running background agent (subprocess or in-memory task).","operationId":"v2_stop_v2_stop_post","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Specific run_id to stop. If omitted, stops the most recent agent.","title":"Run Id"},"description":"Specific run_id to stop. If omitted, stops the most recent agent."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/backtest":{"post":{"tags":["agent-invocation"],"summary":"Invoke Backtest Agent","description":"Run a parameterized backtest. Synchronous — may take minutes.\n\n### Agent skills\n\n- Strategy parameter sweeps\n- Historical performance analysis\n- Risk and drawdown metrics\n- Best-configuration selection\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_backtest_v2_backtest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"backtest","x-agent-category":"analysis","x-agent-skills":["Strategy parameter sweeps","Historical performance analysis","Risk and drawdown metrics","Best-configuration selection"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/validate":{"post":{"tags":["agent-invocation"],"summary":"Invoke Validation Agent","description":"Validate trades for a given run. Synchronous.\n\n### Agent skills\n\n- Trade-price verification\n- Anomaly detection\n- Fill correction checks\n- Validation suggestions\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_validate_v2_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"validator","x-agent-category":"analysis","x-agent-skills":["Trade-price verification","Anomaly detection","Fill correction checks","Validation suggestions"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/paper":{"post":{"tags":["agent-invocation"],"summary":"Invoke Paper Trade Agent","description":"Start paper trading as an autonomous subprocess. Returns immediately.\n\n### Agent skills\n\n- Durable paper-strategy execution\n- Configurable polling and duration\n- PDT-aware trade controls\n- Background run monitoring\n\n**Execution:** `asynchronous`  \n**Access:** `authenticated`  \n**Safety:** `paper_only`","operationId":"v2_paper_v2_paper_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaperRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaperStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"paper-trader","x-agent-category":"trading","x-agent-skills":["Durable paper-strategy execution","Configurable polling and duration","PDT-aware trade controls","Background run monitoring"],"x-agent-execution":"asynchronous","x-agent-safety":"paper_only"}},"/v2/hermes/backtests":{"post":{"tags":["hermes"],"summary":"Hermes Backtest","description":"Queue an owned backtest and return immediately.","operationId":"hermes_backtest_v2_hermes_backtests_post","parameters":[{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HermesBacktestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs":{"get":{"tags":["hermes"],"summary":"Hermes Jobs","description":"List queued, running, and completed jobs owned by this user.","operationId":"hermes_jobs_v2_hermes_jobs_get","parameters":[{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs/{job_id}":{"get":{"tags":["hermes"],"summary":"Hermes Job","description":"Inspect one job only when it belongs to the delegated user.","operationId":"hermes_job_v2_hermes_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/candidates":{"get":{"tags":["hermes"],"summary":"Hermes Candidates","description":"List only the delegated user's saved candidates.","operationId":"hermes_candidates_v2_hermes_candidates_get","parameters":[{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/runs/{run_id}":{"get":{"tags":["hermes"],"summary":"Hermes Run","description":"Inspect one run only when it belongs to the delegated user.","operationId":"hermes_run_v2_hermes_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/candidates/{candidate_id}/paper":{"post":{"tags":["hermes"],"summary":"Hermes Candidate Paper","description":"Queue owned candidate parameters for paper trading; live is not exposed.","operationId":"hermes_candidate_paper_v2_hermes_candidates__candidate_id__paper_post","parameters":[{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string","title":"Candidate Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HermesPaperRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs/{job_id}/pause":{"post":{"tags":["hermes"],"summary":"Hermes Pause Paper Job","description":"Pause one active paper job owned by the delegated user.","operationId":"hermes_pause_paper_job_v2_hermes_jobs__job_id__pause_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs/{job_id}/resume":{"post":{"tags":["hermes"],"summary":"Hermes Resume Paper Job","description":"Resume one paused paper job owned by the delegated user.","operationId":"hermes_resume_paper_job_v2_hermes_jobs__job_id__resume_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs/{job_id}/stop":{"post":{"tags":["hermes"],"summary":"Hermes Stop Paper Job","description":"Request a cooperative stop for one owned paper job.","operationId":"hermes_stop_paper_job_v2_hermes_jobs__job_id__stop_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/advice":{"get":{"tags":["hermes"],"summary":"Hermes Advice","description":"List only portfolio and entry/exit advice owned by the delegated user.","operationId":"hermes_advice_v2_hermes_advice_get","parameters":[{"name":"job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/candidates/{candidate_id}/portfolio":{"post":{"tags":["hermes"],"summary":"Hermes Construct Portfolio","description":"Persist paper-only portfolio construction advice for an owned candidate.","operationId":"hermes_construct_portfolio_v2_hermes_candidates__candidate_id__portfolio_post","parameters":[{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string","title":"Candidate Id"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/hermes/jobs/{job_id}/notifications/{channel}":{"post":{"tags":["hermes"],"summary":"Hermes Notifications","description":"Set advice delivery for one active paper job owned by this user.","operationId":"hermes_notifications_v2_hermes_jobs__job_id__notifications__channel__post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"channel","in":"path","required":true,"schema":{"type":"string","title":"Channel"}},{"name":"X-Hermes-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Key"}},{"name":"X-Hermes-Delegation","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hermes-Delegation"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/full":{"post":{"tags":["agent-invocation"],"summary":"Invoke Five-Agent Orchestrator","description":"Run full cycle: backtest -> validate -> paper -> validate. Synchronous — long-running.\n\n### Agent skills\n\n- Multi-agent workflow coordination\n- Backtest-to-paper promotion\n- Phase status aggregation\n- End-to-end run reporting\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `orchestration`","operationId":"v2_full_v2_full_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullCycleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FullCycleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"orchestrator","x-agent-category":"orchestration","x-agent-skills":["Multi-agent workflow coordination","Backtest-to-paper promotion","Phase status aggregation","End-to-end run reporting"],"x-agent-execution":"synchronous","x-agent-safety":"orchestration"}},"/v2/reconcile":{"post":{"tags":["agent-invocation"],"summary":"Invoke Reconciliation Agent","description":"Reconcile DB positions vs Alpaca holdings. Synchronous.\n\n### Agent skills\n\n- Position-ledger reconciliation\n- Trade mismatch detection\n- Missing and extra fill checks\n- Broker-versus-database P&L comparison\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `paper_only`","operationId":"v2_reconcile_v2_reconcile_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"reconciler","x-agent-category":"trading","x-agent-skills":["Position-ledger reconciliation","Trade mismatch detection","Missing and extra fill checks","Broker-versus-database P&L comparison"],"x-agent-execution":"synchronous","x-agent-safety":"paper_only"}},"/v2/agents/chat/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke DeepAgent Assistant","description":"Run the same DeepAgents harness as web/mobile without requiring SSE parsing.\n\n### Agent skills\n\n- Portfolio and position analysis\n- Market news and company research\n- Backtest and reporting tool routing\n- Paper-account workflow assistance\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `paper_only`","operationId":"v2_invoke_chat_v2_agents_chat_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"deep-agent","x-agent-category":"assistant","x-agent-skills":["Portfolio and position analysis","Market news and company research","Backtest and reporting tool routing","Paper-account workflow assistance"],"x-agent-execution":"synchronous","x-agent-safety":"paper_only"}},"/v2/agents/premarket/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke Premarket Agent","description":"Run the read-only Premarket Agent.\n\n### Agent skills\n\n- Premarket mover discovery\n- Catalyst and news synthesis\n- Candidate ranking\n- Saved-scan retrieval\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_invoke_premarket_v2_agents_premarket_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PremarketAgentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PremarketAgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"premarket","x-agent-category":"research","x-agent-skills":["Premarket mover discovery","Catalyst and news synthesis","Candidate ranking","Saved-scan retrieval"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/agents/alpha-growth/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke Alpha Growth Agent","description":"Run a read-only Growth methodology report.\n\n### Agent skills\n\n- Growth-quality assessment\n- Fundamental evidence collection\n- Catalyst and risk analysis\n- Persistent research reports\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_invoke_alpha_growth_v2_agents_alpha_growth_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaResearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaResearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"alpha-growth","x-agent-category":"research","x-agent-skills":["Growth-quality assessment","Fundamental evidence collection","Catalyst and risk analysis","Persistent research reports"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/agents/alpha-value/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke Alpha Value Agent","description":"Run a read-only Value methodology report.\n\n### Agent skills\n\n- Valuation and margin-of-safety review\n- Fundamental evidence collection\n- Catalyst and risk analysis\n- Persistent research reports\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_invoke_alpha_value_v2_agents_alpha_value_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaResearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaResearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"alpha-value","x-agent-category":"research","x-agent-skills":["Valuation and margin-of-safety review","Fundamental evidence collection","Catalyst and risk analysis","Persistent research reports"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/agents/alpha-compare/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke Alpha Comparison Agent","description":"Run Growth and Value agents over a shared evidence collection.\n\n### Agent skills\n\n- Shared-evidence company research\n- Growth-versus-value comparison\n- Thesis conflict identification\n- Paired persistent reports\n\n**Execution:** `synchronous`  \n**Access:** `authenticated`  \n**Safety:** `read_only`","operationId":"v2_invoke_alpha_compare_v2_agents_alpha_compare_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaResearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlphaComparisonResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"alpha-compare","x-agent-category":"research","x-agent-skills":["Shared-evidence company research","Growth-versus-value comparison","Thesis conflict identification","Paired persistent reports"],"x-agent-execution":"synchronous","x-agent-safety":"read_only"}},"/v2/agents/autonomy-scout/invoke":{"post":{"tags":["agent-invocation"],"summary":"Invoke Autonomy Scout","description":"Scan candidates and enqueue the durable paper-only autonomy pipeline.\n\n### Agent skills\n\n- Market candidate scouting\n- Strategy-aware candidate ranking\n- Durable autonomy-run enqueueing\n- Paper-only account isolation\n\n**Execution:** `asynchronous`  \n**Access:** `authenticated`  \n**Safety:** `paper_only`","operationId":"v2_invoke_autonomy_scout_v2_agents_autonomy_scout_invoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyScoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyScoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"x-agent-slug":"autonomy-scout","x-agent-category":"orchestration","x-agent-skills":["Market candidate scouting","Strategy-aware candidate ranking","Durable autonomy-run enqueueing","Paper-only account isolation"],"x-agent-execution":"asynchronous","x-agent-safety":"paper_only"}},"/health":{"get":{"tags":["meta"],"summary":"Liveness check","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[]}},"/cmd":{"post":{"tags":["legacy"],"summary":"Cmd","description":"Execute an arbitrary CLI command (returns markdown).","operationId":"cmd_cmd_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CmdRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/runs":{"get":{"tags":["legacy"],"summary":"Runs","operationId":"runs_runs_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trades":{"get":{"tags":["legacy"],"summary":"Trades","operationId":"trades_trades_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/report":{"get":{"tags":["legacy"],"summary":"Report","operationId":"report_report_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"strategy","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/top":{"get":{"tags":["legacy"],"summary":"Top","operationId":"top_top_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"strategy","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/backtest":{"post":{"tags":["legacy"],"summary":"Backtest","operationId":"backtest_backtest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/paper":{"post":{"tags":["legacy"],"summary":"Paper","operationId":"paper_paper_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaperRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/status":{"get":{"tags":["legacy"],"summary":"Status","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/news":{"get":{"tags":["market"],"summary":"News","operationId":"news_news_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"ticker","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticker"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/price":{"get":{"tags":["market"],"summary":"Price","operationId":"price_price_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"ticker","in":"query","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/profile":{"get":{"tags":["market"],"summary":"Profile","operationId":"profile_profile_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"ticker","in":"query","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/movers":{"get":{"tags":["market"],"summary":"Movers","operationId":"movers_movers_get","security":[{"BearerAuth":[]},{"ServiceApiKey":[]}],"parameters":[{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat":{"get":{"summary":"Chat Stream","description":"SSE endpoint for streaming chat responses (legacy).","operationId":"chat_stream_chat_get","parameters":[{"name":"question","in":"query","required":true,"schema":{"type":"string","title":"Question"}},{"name":"thread_id","in":"query","required":false,"schema":{"type":"string","default":"api_default","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v2/chat":{"post":{"tags":["agent-invocation"],"summary":"Stream DeepAgent Assistant (SSE)","description":"Streaming chat for the mobile app — the SAME router as the web chat.\n\nAuth: optional `Authorization: Bearer <JWT>` (authed users trade under their own\nlinked Alpaca account; anonymous falls back to the server's paper keys).\n\nBody (JSON or form-encoded): `msg` (or `message`), `thread_id` (or `sid`).\n\nResponse: `text/event-stream` with named SSE events —\n  session · agent_route · token · tool_start · tool_end · error · done\n(`data:` is JSON). This matches the web chat event contract.\n\n### Agent skills\n\n- Token-by-token conversational responses\n- Agent routing events\n- Tool execution events\n- Conversation-thread continuity\n\n**Execution:** `streaming`  \n**Access:** `public`  \n**Safety:** `paper_only`","operationId":"v2_chat_v2_chat_post","requestBody":{"content":{"application/json":{"schema":{"properties":{"msg":{"type":"string","description":"The user message / prompt.","example":"Show me my positions"},"thread_id":{"type":"string","description":"Conversation id for history continuity.","example":"mobile-1"}},"type":"object","required":["msg"]}},"application/x-www-form-urlencoded":{"schema":{"properties":{"msg":{"type":"string"},"thread_id":{"type":"string"}},"type":"object","required":["msg"]}}},"required":true},"responses":{"200":{"description":"Server-Sent Events stream. Each event is `event: <type>` + `data: <json>`. Types: session · agent_route · token · tool_start · tool_end · error · done. `token.text` chunks concatenate into the assistant reply (markdown).","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"type":"string"},"example":"event: session\\ndata: {\"sid\": \"mobile-1\"}\\n\\nevent: token\\ndata: {\"text\": \"MSFT position: 2 shares\"}\\n\\nevent: done\\ndata: {}\\n\\n"}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]},{}],"x-agent-slug":"deep-agent-stream","x-agent-category":"assistant","x-agent-skills":["Token-by-token conversational responses","Agent routing events","Tool execution events","Conversation-thread continuity"],"x-agent-execution":"streaming","x-agent-safety":"paper_only"}},"/v2/order":{"post":{"tags":["trading"],"summary":"Place a PAPER order (market or limit)","description":"Place a **paper** (simulated) market or limit order on the primary paper\naccount linked to the authenticated user. No real money. For a limit order set `order_type=limit` and\n`limit_price`. Returns the created order id + status.","operationId":"v2_order_v2_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BearerAuth":[]},{"ServiceApiKey":[]}]}},"/install.sh":{"get":{"summary":"Install Sh","operationId":"install_sh_install_sh_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[]}}},"components":{"schemas":{"AgentCatalogResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentDescriptor"},"type":"array","title":"Agents"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["agents","total"],"title":"AgentCatalogResponse"},"AgentChatRequest":{"properties":{"message":{"type":"string","maxLength":20000,"minLength":1,"title":"Message"},"thread_id":{"type":"string","maxLength":200,"minLength":1,"title":"Thread Id","default":"service_default"}},"type":"object","required":["message"],"title":"AgentChatRequest","examples":[{"message":"Summarize my open positions","thread_id":"portfolio-review-1"}]},"AgentChatResponse":{"properties":{"thread_id":{"type":"string","title":"Thread Id"},"response":{"type":"string","title":"Response"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"tools_used":{"items":{"type":"string"},"type":"array","title":"Tools Used"}},"type":"object","required":["thread_id","response"],"title":"AgentChatResponse"},"AgentDescriptor":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"category":{"type":"string","enum":["assistant","research","analysis","trading","orchestration"],"title":"Category"},"description":{"type":"string","title":"Description"},"method":{"type":"string","enum":["GET","POST"],"title":"Method"},"path":{"type":"string","title":"Path"},"access":{"type":"string","enum":["authenticated","public"],"title":"Access","default":"authenticated"},"execution":{"type":"string","enum":["synchronous","asynchronous","streaming"],"title":"Execution"},"safety":{"type":"string","enum":["read_only","paper_only","orchestration"],"title":"Safety"},"skills":{"items":{"type":"string"},"type":"array","title":"Skills","description":"Stable, human-readable capabilities exposed by this agent."}},"type":"object","required":["slug","name","category","description","method","path","execution","safety","skills"],"title":"AgentDescriptor"},"AgentStatus":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"current_task":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Task"}},"type":"object","required":["name","status"],"title":"AgentStatus"},"AlphaComparisonResponse":{"properties":{"ticker":{"type":"string","title":"Ticker"},"status":{"type":"string","title":"Status"},"growth":{"$ref":"#/components/schemas/AlphaResearchResponse"},"value":{"$ref":"#/components/schemas/AlphaResearchResponse"}},"type":"object","required":["ticker","status","growth","value"],"title":"AlphaComparisonResponse"},"AlphaResearchRequest":{"properties":{"ticker":{"type":"string","maxLength":16,"minLength":1,"title":"Ticker","examples":["AAPL"]}},"type":"object","required":["ticker"],"title":"AlphaResearchRequest"},"AlphaResearchResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"mode":{"type":"string","enum":["growth","value"],"title":"Mode"},"ticker":{"type":"string","title":"Ticker"},"status":{"type":"string","title":"Status"},"report":{"type":"string","title":"Report"},"saved":{"type":"boolean","title":"Saved"},"persistence_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persistence Warning"}},"type":"object","required":["run_id","mode","ticker","status","report","saved"],"title":"AlphaResearchResponse"},"ApiInfoResponse":{"properties":{"name":{"type":"string","title":"Name"},"version":{"type":"string","title":"Version"},"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"links":{"$ref":"#/components/schemas/ApiLinks"}},"type":"object","required":["name","version","links"],"title":"ApiInfoResponse"},"ApiLinks":{"properties":{"swagger":{"type":"string","title":"Swagger"},"redoc":{"type":"string","title":"Redoc"},"openapi":{"type":"string","title":"Openapi"},"health":{"type":"string","title":"Health"},"agents":{"type":"string","title":"Agents"}},"type":"object","required":["swagger","redoc","openapi","health","agents"],"title":"ApiLinks"},"ApiResponse":{"properties":{"result":{"type":"string","title":"Result"},"status":{"type":"string","title":"Status"}},"type":"object","required":["result","status"],"title":"ApiResponse","description":"Legacy response wrapper (markdown string)."},"AuthRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"AuthRequest"},"AuthResponse":{"properties":{"token":{"type":"string","title":"Token"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"}},"type":"object","required":["token","user_id","email"],"title":"AuthResponse"},"AutonomyScoutRequest":{"properties":{"strategy":{"type":"string","title":"Strategy","description":"Strategy slug or registered strategy name","default":"btd"},"limit":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Limit","default":5},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Owned paper account UUID"}},"type":"object","title":"AutonomyScoutRequest"},"AutonomyScoutResponse":{"properties":{"status":{"type":"string","enum":["queued","no_candidates"],"title":"Status"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"paper_only":{"type":"boolean","title":"Paper Only","default":true}},"type":"object","required":["status"],"title":"AutonomyScoutResponse"},"BacktestRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Specific AlpaTrade account_id snippet to run the backtest under (optional)"},"lookback":{"type":"string","title":"Lookback","description":"Lookback period, e.g. '3m', '6m', '1y'","default":"3m"},"symbols":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbols","description":"Comma-separated symbols, e.g. 'AAPL,MSFT'"},"strategy":{"type":"string","title":"Strategy","description":"Strategy name: buy_the_dip, vix, momentum, box_wedge","default":"buy_the_dip"},"capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capital","description":"Initial capital in USD"},"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours","description":"'regular' or 'extended'"},"intraday_exit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Intraday Exit","description":"Use 5-min intraday bars for TP/SL exits"},"pdt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdt","description":"Enforce PDT rule (default True, set False for >$25k accounts)"}},"type":"object","title":"BacktestRequest","examples":[{"capital":10000,"lookback":"3m","strategy":"buy_the_dip"}]},"BacktestResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"strategy":{"type":"string","title":"Strategy"},"total_variations":{"type":"integer","title":"Total Variations","default":0},"best_config":{"anyOf":[{"$ref":"#/components/schemas/BestConfig"},{"type":"null"}]},"status":{"type":"string","title":"Status","default":"completed"}},"type":"object","required":["run_id","strategy"],"title":"BacktestResponse"},"BestConfig":{"properties":{"sharpe_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sharpe Ratio"},"total_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Return"},"annualized_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualized Return"},"total_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pnl"},"win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate"},"total_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Trades"},"max_drawdown":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Drawdown"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"}},"type":"object","title":"BestConfig"},"CmdRequest":{"properties":{"command":{"type":"string","title":"Command"}},"type":"object","required":["command"],"title":"CmdRequest"},"DailyPnl":{"properties":{"date":{"type":"string","title":"Date"},"pnl":{"type":"number","title":"Pnl","default":0},"trade_count":{"type":"integer","title":"Trade Count","default":0}},"type":"object","required":["date"],"title":"DailyPnl"},"FullCyclePhase":{"properties":{"status":{"type":"string","title":"Status"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["status"],"title":"FullCyclePhase"},"FullCycleRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"lookback":{"type":"string","title":"Lookback","default":"3m"},"duration":{"type":"string","title":"Duration","default":"7d"},"symbols":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbols"},"strategy":{"type":"string","title":"Strategy","default":"buy_the_dip"},"capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capital"},"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours"},"intraday_exit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Intraday Exit"},"pdt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdt"},"poll":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Poll"}},"type":"object","title":"FullCycleRequest"},"FullCycleResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"phases":{"additionalProperties":{"$ref":"#/components/schemas/FullCyclePhase"},"type":"object","title":"Phases"}},"type":"object","required":["run_id","status"],"title":"FullCycleResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HermesBacktestRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Specific AlpaTrade account_id snippet to run the backtest under (optional)"},"lookback":{"type":"string","title":"Lookback","description":"Lookback period, e.g. '3m', '6m', '1y'","default":"3m"},"symbols":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbols","description":"Comma-separated symbols, e.g. 'AAPL,MSFT'"},"strategy":{"type":"string","title":"Strategy","description":"Strategy name: buy_the_dip, vix, momentum, box_wedge","default":"buy_the_dip"},"capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capital","description":"Initial capital in USD"},"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours","description":"'regular' or 'extended'"},"intraday_exit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Intraday Exit","description":"Use 5-min intraday bars for TP/SL exits"},"pdt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdt","description":"Enforce PDT rule (default True, set False for >$25k accounts)"},"objective":{"additionalProperties":true,"type":"object","title":"Objective"}},"type":"object","title":"HermesBacktestRequest","description":"Backtest request accepted by the restricted Hermes broker.","examples":[{"capital":10000,"lookback":"3m","strategy":"buy_the_dip"}]},"HermesPaperRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"duration":{"type":"string","title":"Duration","default":"7d"},"poll":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Poll"},"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours"},"email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email"},"pdt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdt"},"notification_channel":{"type":"string","title":"Notification Channel","description":"Hermes advice delivery: in_app, email, both, or none","default":"in_app"}},"type":"object","title":"HermesPaperRequest","description":"Start a saved candidate in paper mode only."},"LogsResponse":{"properties":{"lines":{"items":{"type":"string"},"type":"array","title":"Lines"},"total_lines":{"type":"integer","title":"Total Lines"}},"type":"object","required":["lines","total_lines"],"title":"LogsResponse"},"OrderRequest":{"properties":{"symbol":{"type":"string","maxLength":16,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9.-]*$","title":"Symbol","examples":["AAPL"]},"qty":{"type":"number","exclusiveMinimum":0.0,"title":"Qty","examples":[1]},"side":{"type":"string","enum":["buy","sell"],"title":"Side","default":"buy","examples":["buy"]},"order_type":{"type":"string","enum":["market","limit"],"title":"Order Type","default":"market","examples":["limit"]},"limit_price":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Limit Price","description":"Required for a limit order.","examples":[180.0]},"time_in_force":{"type":"string","enum":["day","gtc"],"title":"Time In Force","default":"day","examples":["day"]}},"type":"object","required":["symbol","qty"],"title":"OrderRequest"},"OrderResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"qty":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Qty"},"side":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Side"},"order_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Type"},"limit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit Price"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"paper":{"type":"boolean","title":"Paper","default":true},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ok"],"title":"OrderResponse"},"PaperRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Specific AlpaTrade account_id UUID to paper trade under (optional)"},"duration":{"type":"string","title":"Duration","description":"Paper trading duration, e.g. '1h', '7d', '1m'","default":"7d"},"symbols":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbols"},"strategy":{"type":"string","title":"Strategy","default":"buy_the_dip"},"poll":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Poll","description":"Poll interval in seconds"},"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours"},"email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email","description":"Send daily P&L email reports"},"pdt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdt"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params","description":"Validated strategy parameters (used by scoped agent promotion)"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"agent_framework":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Framework"},"source_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Run Id"}},"type":"object","title":"PaperRequest","examples":[{"duration":"7d","strategy":"buy_the_dip"}]},"PaperStartResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status","default":"started"},"strategy":{"type":"string","title":"Strategy"},"symbols":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Symbols"},"duration":{"type":"string","title":"Duration"},"poll_interval":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Poll Interval"}},"type":"object","required":["run_id","strategy","duration"],"title":"PaperStartResponse"},"PnlResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"total_pnl":{"type":"number","title":"Total Pnl","default":0},"total_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Return"},"total_fees":{"type":"number","title":"Total Fees","default":0},"win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate"},"winning_trades":{"type":"integer","title":"Winning Trades","default":0},"losing_trades":{"type":"integer","title":"Losing Trades","default":0},"total_trades":{"type":"integer","title":"Total Trades","default":0},"sharpe_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sharpe Ratio"},"per_symbol":{"items":{"$ref":"#/components/schemas/PnlSymbolBreakdown"},"type":"array","title":"Per Symbol"},"daily_pnl":{"items":{"$ref":"#/components/schemas/DailyPnl"},"type":"array","title":"Daily Pnl"}},"type":"object","required":["run_id"],"title":"PnlResponse"},"PnlSymbolBreakdown":{"properties":{"symbol":{"type":"string","title":"Symbol"},"total_pnl":{"type":"number","title":"Total Pnl","default":0},"total_fees":{"type":"number","title":"Total Fees","default":0},"trade_count":{"type":"integer","title":"Trade Count","default":0},"win_count":{"type":"integer","title":"Win Count","default":0},"loss_count":{"type":"integer","title":"Loss Count","default":0},"avg_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Pnl"}},"type":"object","required":["symbol"],"title":"PnlSymbolBreakdown"},"PositionItem":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"run_id":{"type":"string","title":"Run Id"},"symbol":{"type":"string","title":"Symbol"},"side":{"type":"string","title":"Side"},"shares":{"type":"number","title":"Shares"},"avg_entry_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Entry Price"},"current_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Price"},"market_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Value"},"unrealized_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unrealized Pnl"},"unrealized_pnl_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unrealized Pnl Pct"},"cost_basis":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Basis"},"status":{"type":"string","title":"Status","default":"open"},"opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opened At"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"}},"type":"object","required":["run_id","symbol","side","shares"],"title":"PositionItem"},"PositionsResponse":{"properties":{"positions":{"items":{"$ref":"#/components/schemas/PositionItem"},"type":"array","title":"Positions"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["positions","total"],"title":"PositionsResponse"},"PremarketAgentRequest":{"properties":{"refresh":{"type":"boolean","title":"Refresh","description":"Fetch a new scan instead of using the latest saved report","default":false},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":10}},"type":"object","title":"PremarketAgentRequest"},"PremarketAgentResponse":{"properties":{"agent":{"type":"string","title":"Agent"},"status":{"type":"string","title":"Status"},"report":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Report"},"top":{"additionalProperties":true,"type":"object","title":"Top"}},"type":"object","required":["agent","status"],"title":"PremarketAgentResponse"},"ReconcileRequest":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"window_days":{"type":"integer","title":"Window Days","description":"Number of days to reconcile","default":7}},"type":"object","title":"ReconcileRequest"},"ReconcileResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"total_issues":{"type":"integer","title":"Total Issues","default":0},"position_mismatches":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Position Mismatches"},"trade_mismatches":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trade Mismatches"},"pnl_comparison":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Pnl Comparison"},"missing_trades":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Missing Trades"},"extra_trades":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Extra Trades"}},"type":"object","required":["run_id","status"],"title":"ReconcileResponse"},"RegisterRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ReportDetail":{"properties":{"run_id":{"type":"string","title":"Run Id"},"mode":{"type":"string","title":"Mode"},"strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"},"strategy_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Slug"},"status":{"type":"string","title":"Status"},"initial_capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Initial Capital"},"final_capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Final Capital"},"total_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pnl"},"total_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Return"},"annualized_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualized Return"},"sharpe_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sharpe Ratio"},"max_drawdown":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Drawdown"},"win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Win Rate"},"total_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Trades"},"winning_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Winning Trades"},"losing_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Losing Trades"},"data_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data Start"},"data_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data End"},"run_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Run Date"}},"type":"object","required":["run_id","mode","status"],"title":"ReportDetail"},"ReportSummaryItem":{"properties":{"run_id":{"type":"string","title":"Run Id"},"mode":{"type":"string","title":"Mode"},"strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"},"strategy_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Slug"},"status":{"type":"string","title":"Status"},"initial_capital":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Initial Capital"},"total_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pnl"},"total_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Return"},"annualized_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Annualized Return"},"sharpe_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sharpe Ratio"},"total_trades":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Trades"},"data_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data Start"},"data_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Data End"},"run_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Run Date"}},"type":"object","required":["run_id","mode","status"],"title":"ReportSummaryItem"},"RunItem":{"properties":{"run_id":{"type":"string","title":"Run Id"},"mode":{"type":"string","title":"Mode"},"strategy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy"},"strategy_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strategy Slug"},"status":{"type":"string","title":"Status"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["run_id","mode","status"],"title":"RunItem"},"RunsResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/RunItem"},"type":"array","title":"Runs"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["runs","total"],"title":"RunsResponse"},"StatusResponse":{"properties":{"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"status":{"type":"string","title":"Status"},"agents":{"items":{"$ref":"#/components/schemas/AgentStatus"},"type":"array","title":"Agents"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"elapsed_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Elapsed Seconds"},"best_config":{"anyOf":[{"$ref":"#/components/schemas/BestConfig"},{"type":"null"}]}},"type":"object","required":["status"],"title":"StatusResponse"},"StopResponse":{"properties":{"stopped":{"type":"boolean","title":"Stopped"},"message":{"type":"string","title":"Message"}},"type":"object","required":["stopped","message"],"title":"StopResponse"},"TopStrategyItem":{"properties":{"strategy_slug":{"type":"string","title":"Strategy Slug"},"avg_sharpe":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sharpe"},"avg_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Return"},"avg_ann_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Ann Return"},"avg_win_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Win Rate"},"avg_drawdown":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Drawdown"},"total_trades":{"type":"integer","title":"Total Trades","default":0},"total_runs":{"type":"integer","title":"Total Runs","default":0},"avg_pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Pnl"}},"type":"object","required":["strategy_slug"],"title":"TopStrategyItem"},"TradeItem":{"properties":{"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"run_id":{"type":"string","title":"Run Id"},"trade_type":{"type":"string","title":"Trade Type"},"symbol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symbol"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"shares":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Shares"},"entry_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Entry Time"},"exit_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Exit Time"},"entry_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Entry Price"},"exit_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Exit Price"},"target_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Price"},"stop_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stop Price"},"hit_target":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hit Target"},"hit_stop":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hit Stop"},"pnl":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pnl"},"pnl_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pnl Pct"},"total_fees":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Fees"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["run_id","trade_type"],"title":"TradeItem"},"TradesResponse":{"properties":{"trades":{"items":{"$ref":"#/components/schemas/TradeItem"},"type":"array","title":"Trades"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["trades","total"],"title":"TradesResponse"},"ValidateRequest":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"UUID of the run to validate"},"source":{"type":"string","title":"Source","description":"'backtest' or 'paper'","default":"backtest"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Optional account override"}},"type":"object","required":["run_id"],"title":"ValidateRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"total_trades_checked":{"type":"integer","title":"Total Trades Checked","default":0},"anomalies_found":{"type":"integer","title":"Anomalies Found","default":0},"anomalies_corrected":{"type":"integer","title":"Anomalies Corrected","default":0},"iterations_used":{"type":"integer","title":"Iterations Used","default":0},"suggestions":{"items":{"type":"string"},"type":"array","title":"Suggestions"}},"type":"object","required":["run_id","status"],"title":"ValidationResponse"}},"securitySchemes":{"BearerAuth":{"type":"http","description":"User JWT returned by POST /auth/login or /auth/register.","scheme":"bearer"},"ServiceApiKey":{"type":"apiKey","description":"Trusted service key. Add X-User-Id for tenant-scoped endpoints.","in":"header","name":"X-API-Key"}}},"tags":[{"name":"meta","description":"API discovery and health","x-displayName":"Platform"},{"name":"auth","description":"User registration and login","x-displayName":"Authentication"},{"name":"agents","description":"Agent lifecycle — status and cancellation","x-displayName":"Agent lifecycle"},{"name":"agent-invocation","description":"Typed service-to-service invocation for the primary DeepAgent and specialist research/autonomy agents. Each operation documents its skills, execution model, access boundary, and safety level.","x-displayName":"Agent skills & invocation"},{"name":"chat","description":"DeepAgents chat, as JSON or Server-Sent Events","x-displayName":"Chat"},{"name":"data","description":"Query runs, trades, reports, P&L","x-displayName":"Data & reporting"},{"name":"market","description":"Market data — news, prices, profiles, movers","x-displayName":"Market data"},{"name":"trading","description":"Paper-only order placement","x-displayName":"Paper trading"},{"name":"legacy","description":"Legacy endpoints (markdown responses via CommandProcessor)","x-displayName":"Legacy API"}],"externalDocs":{"description":"AlpaTrade developer portal and integration guide","url":"https://alpatrade.chat/developers"},"x-tagGroups":[{"name":"Agent APIs","tags":["agent-invocation","agents","chat"]},{"name":"Trading and data","tags":["trading","data","market"]},{"name":"Platform","tags":["auth","meta"]},{"name":"Compatibility","tags":["legacy"]}]}