{"openapi":"3.1.0","info":{"title":"Foresea Intelligence API","description":"\n## Overview\n\nThe **Foresea Intelligence API** turns market questions, linked evidence, and\nprediction-market prices into probabilistic forecasts that can sit behind\ntrading dashboards, alerting systems, and research workflows.\n\nIt supports binary, multiple-choice, numeric, and date forecasts. Each response\nincludes a structured **rationale**, typed forecast fields, optional evidence\nsources fetched from live news, and optional market-edge analysis when you pass\na market-implied probability.\n\n---\n\n## Quick start\n\n```bash\ncurl -X POST https://foresea.ink/predict \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"question\": \"Will the Fed cut rates before September 30, 2026?\",\n    \"question_type\": \"binary\",\n    \"market_platform\": \"Polymarket\",\n    \"market_probability\": 0.54,\n    \"variant\": \"variant0_neutral_baseline\"\n  }'\n```\n\n---\n\n## Question types\n\nUse `question_type` when your client already knows the shape of the question.\nIf omitted, the model will try to infer it.\n\n| Type | Response shape |\n|---|---|\n| `binary` | `predicted_answer` is `Yes`/`No`; `confidence` is 0–1 |\n| `multiple_choice` | `options` contains per-option probabilities; `predicted_answer` is the top option |\n| `numeric` | `range_forecast` contains `p10`, `p50`, `p90`, and optional `unit` |\n| `date` | `range_forecast` contains date percentiles |\n\nFor multiple-choice forecasts, pass `options` when the answer set is known.\n\n---\n\n## Prediction-market context\n\nPass `market_probability` when you know the current market-implied probability\nfor the target outcome. For binary markets this defaults to the `Yes` side; set\n`market_outcome` to compare against `No` or a named multiple-choice outcome.\n\nForesea returns `market_analysis` with model probability, market probability,\npercentage-point edge, and a stance (`model_above_market`, `model_below_market`,\n`in_line`, or `not_comparable`).\n\n---\n\n## Trading execution\n\nForesea can preview and submit guarded orders for Kalshi and Polymarket:\n\n| Endpoint | Purpose |\n|---|---|\n| `GET /trading/accounts` | Return configured/not-configured server-account status without exposing secrets |\n| `POST /trading/accounts/check` | Validate caller-supplied own-account (BYO) credentials without storing them |\n| `POST /trading/preview` | Normalize and validate an order without placing it |\n| `POST /trading/orders` | Submit a live order after explicit confirmation |\n\nLive trading is disabled unless `FORESEA_ENABLE_TRADING=true`. Every live order\nrequires a signed-in user session, `execute=true`, and the exact confirmation\nphrase `PLACE REAL ORDER`. Market/IOC/FOK-style orders are separately blocked\nunless `FORESEA_ALLOW_MARKET_ORDERS=true`.\n\nExchange credentials come from a shared server account (environment variables /\nSecret Manager mounts) or an authenticated user's **encrypted account\nconnection**. The connection endpoint accepts a user's credentials once, validates\nthem with a unique data-encryption key wrapped by Cloud KMS, and never returns\nthem to the browser. Inline `venue_credentials` are rejected on public preview\nand order calls; encrypted own-account trading remains gated by\n`FORESEA_ENABLE_BYO_TRADING=true` (independent of `FORESEA_ENABLE_TRADING`).\n\n`/agent/analyze` may return a directional recommendation, but it never places an\norder. Use `/trading/preview` first, review the normalized order, then call\n`/trading/orders` only when you intend to submit a real order.\n\n---\n\n## Prompt variants\n\nThe `variant` field controls how the LLM is prompted. Choose the variant that\nbest matches the information you have available:\n\n| Variant key | Focus |\n|---|---|\n| `variant0_neutral_baseline` | Control — no extra framing (default) |\n| `variant1_predicted_event` | State the concrete predicted event |\n| `variant2_key_attribute` | Highlight time / quantity / actor |\n| `variant3_reasoning_type` | Specify reasoning type (speculation, expert forecast…) |\n| `variant4_credibility` | Ground rationale in source credibility scores |\n| `variant5_key_conditions` | List 2–4 conditions that must hold |\n| `variant6_step_by_step_reasoning` | Produce 2–3 numbered reasoning steps |\n| `variant7_uncertainty_language` | Require uncertainty hedging words |\n| `variant8_temporal_anchors` | Anchor reasoning to specific dates |\n\n---\n\n## Rate limiting\n\n**`RATE_LIMIT_PER_MIN` requests per minute per IP address (default 60).** Exceeding this returns `429 Too Many Requests`\nwith a `Retry-After: 60` header.\n\n**`PREDICT_RATE_LIMIT_PER_MIN` LLM calls per minute per IP (default 10).** Applies to `/predict` and `/agent/analyze`\non top of the global limit — these endpoints are expensive so they get a tighter per-IP cap.\n\n---\n\n## Authentication\n\nWhen the server is configured with `API_KEY`, all prediction endpoints require:\n\n```\nX-API-Key: <your-key>\n```\n\nThe `/health` endpoint is always unauthenticated. Per-user endpoints such as\nRAG, chat history, and trading require an `Authorization: Bearer <session-token>`\nheader returned by the sign-in endpoints.\n","contact":{"name":"Pareel Amre","url":"https://foresea.ink/","email":"pareel.amre@gmail.com"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"1.0.0"},"paths":{"/pr-agent":{"get":{"tags":["Agents"],"summary":"Foresea PR agent outreach packet","description":"Agent-readable Foresea introduction material for opt-in outreach.","operationId":"pr_agent_packet_pr_agent_get","parameters":[{"name":"audience","in":"query","required":false,"schema":{"type":"string","default":"agent","title":"Audience"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/track-record/digest":{"get":{"tags":["System"],"summary":"Shareable track-record summary","description":"A short, shareable markdown summary of the live track record — ready to\npost (a weekly recap). Built from the resolved-forecast aggregate so it\nnever overstates.","operationId":"track_record_digest_track_record_digest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/analytics/export.parquet":{"get":{"tags":["Analytics"],"summary":"Export Foresea datasets as compressed Parquet","description":"Export Foresea live edge opportunities or track record datasets as high-performance columnar Parquet files.","operationId":"analytics_export_parquet_analytics_export_parquet_get","parameters":[{"name":"dataset","in":"query","required":false,"schema":{"type":"string","description":"Dataset to export: 'edge_board' or 'models_comparison'","default":"edge_board","title":"Dataset"},"description":"Dataset to export: 'edge_board' or 'models_comparison'"},{"name":"compression","in":"query","required":false,"schema":{"type":"string","description":"Parquet compression codec: 'ZSTD', 'SNAPPY', 'GZIP'","default":"ZSTD","title":"Compression"},"description":"Parquet compression codec: 'ZSTD', 'SNAPPY', 'GZIP'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/benchmark/score":{"post":{"tags":["System"],"summary":"Score a set of resolved forecasts","description":"Grade any forecaster's resolved predictions: Brier score, accuracy, ECE\n(calibration), and — when market prices are supplied — skill vs the market.\nLets you benchmark an LLM, a person, or another model against the same yardstick\nForesea grades itself on.","operationId":"benchmark_score_benchmark_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Benchmark Score Benchmark Score Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/track-record":{"get":{"tags":["System"],"summary":"Public forecasting track record","description":"Return Foresea's resolved-forecast track record.\n\nOnce the live, point-in-time record has resolved forecasts, this returns it\n(forecasts made on live Polymarket/Kalshi markets and scored at resolution,\nwith skill-vs-market). Until then it falls back to the static backtest of\n`gpt-oss-120b` against published Metaculus outcomes: accuracy, Brier score,\ncalibration (ECE), a reliability curve, and a sample of resolved forecasts.","operationId":"track_record_track_record_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/edge-board":{"get":{"tags":["System"],"summary":"Live model-vs-market edge board","description":"Where Foresea's evidence-based fair probability most disagrees with the\nmarket price right now — and whether that kind of disagreement has paid.\n\n- ``edge_board``: open markets ranked by live disagreement, each tagged with\n  the resolved track record of gaps that size (``track_record.skill_significant``\n  flags disagreements our own history has proven beat the market).\n- ``by_edge``: realized skill-vs-market bucketed by disagreement size — the\n  proof of whether bigger gaps actually resolved in the model's favour.\n- ``lead_lag``: whether the market has historically moved *toward* the model\n  after a disagreement (the model leading the price).\n- ``paper_pnl``: hypothetical paper-trading return of betting the edge over\n  resolved snapshots (flat / edge-weighted / validated-only). Paper only — no\n  fees or slippage; not live trading.","operationId":"edge_board_edge_board_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/fund/board":{"get":{"tags":["System"],"summary":"Foresea Fund: one paper portfolio run by models","description":"The Foresea Fund (paper only; docs/fund.md): account value, positions across event\ncontracts, futures and perps, every trade with its grounded note and evidence, P&L split by\nthe analyst that caused it, and the signals it passed on with the reason. Empty until the\nfund's first cycle has published.","operationId":"fund_board_fund_board_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent-trading/board":{"get":{"tags":["System"],"summary":"Agentic shadow-trading board (paper only)","description":"SCADS-hosted models given real tool-use trading agency -- unlike the\n``/edge-board`` Kelly-sizing ledgers (a probability sized by a fixed\nformula after the fact), each model here decides for itself whether and\nhow much to trade with genuine cash/position accounting, real risk\nguards, and the same bounded ReAct tool loop PredictionArena-style\nagentic boards use. Shadow (paper) trading only -- no real money is ever\nplaced; see ``scripts/agent_trading_tick.py`` for the enforcement.\n\n- ``leaderboard``: one row per model -- account value, cash, realized/\n  unrealized P&L, return %, win rate over settled markets, open\n  positions, trade count.\n- ``equity_curves``: per-model cash-only book-value curve (see\n  ``agent_trading_stats.agent_equity_curve`` for exactly what this\n  approximates and why) plus Sharpe/max-drawdown computed over it.\n- ``recent_activity``: a merged, newest-first transparency feed of\n  trades, settlements, per-cycle theses, and notes across every model.\n- ``eligibility``: per model, whether its shadow track record currently\n  clears a conservative, adjustable bar (settled trades, Sharpe,\n  drawdown -- see ``agent_trading_stats.compute_promotion_eligibility``).\n  Purely observational: nothing reads this to grant any capability.\n- ``forecast_learning``: final-outcome Brier diagnostics, including up to\n  four source-labelled weather cohorts per model. These are descriptive\n  calibration signals, never sizing overrides.\n- ``weather_operations``: bounded recent counts from source-verified\n  weather candidates through research, forecast, paper trade, and final\n  resolution. It is operational coverage, not a performance claim.\n- ``model_health``: per model cycle heartbeat and account-ledger freshness.\n  This separates a completed no-trade turn from a delayed, stale, or\n  unverified model ledger.\n- ``operational_health``: bounded roll-up of provider degradation versus\n  ledger-maintenance attention, without obscuring individual model status.","operationId":"agent_trading_board_agent_trading_board_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent-trading/audits":{"get":{"tags":["System"],"summary":"On-demand audit records for Agentic paper trades","description":"Read the GitHub-backed audit trail without loading it into the board.\n\nRecent records come from a compact GitHub index.  If a retained record is\nno longer there, callers can supply its model ID to look it up in the\nmodel's monthly GitHub archive.  Records never represent exchange orders\nor real-money execution.","operationId":"agent_trading_audits_agent_trading_audits_get","parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9_.:-]+$"},{"type":"null"}],"description":"Optional Agentic model identifier","title":"Agent Id"},"description":"Optional Agentic model identifier"},{"name":"action_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Fa-f0-9-]+$"},{"type":"null"}],"description":"Optional immutable paper-ledger action identifier","title":"Action Id"},"description":"Optional immutable paper-ledger action identifier"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feed/latest":{"get":{"tags":["Feed"],"summary":"Unified Foresea Alpha & Autonomous Agent Feed","description":"Retrieve the latest unified Foresea feed combining calibrated prediction market\nedge alerts, autonomous agent trades & theses, and leaderboard standings.","operationId":"feed_latest_route_feed_latest_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Maximum feed items to return","default":10,"title":"Limit"},"description":"Maximum feed items to return"},{"name":"min_edge","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Minimum model-vs-market edge threshold","default":0.05,"title":"Min Edge"},"description":"Minimum model-vs-market edge threshold"},{"name":"min_credibility","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Minimum credibility grade threshold","default":0.6,"title":"Min Credibility"},"description":"Minimum credibility grade threshold"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feed/stream":{"get":{"tags":["Feed"],"summary":"Live Server-Sent Events stream of Foresea Alpha & Agent Feed","description":"Server-Sent Events (SSE) stream providing real-time feed updates and heartbeats.","operationId":"feed_stream_feed_stream_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"min_edge","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"default":0.05,"title":"Min Edge"}},{"name":"heartbeat_interval","in":"query","required":false,"schema":{"type":"number","maximum":60.0,"minimum":5.0,"default":15.0,"title":"Heartbeat Interval"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/history":{"get":{"tags":["System"],"summary":"Get historical forecast snapshots for a market","description":"Retrieve historical forecasts for a given market (platform + ident).","operationId":"market_history_market_history_get","parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Platform"}},{"name":"ident","in":"query","required":true,"schema":{"type":"string","maxLength":200,"title":"Ident"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market History Market History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/explain-shift":{"post":{"tags":["System"],"summary":"Explain the temporal shift in model odds","description":"Compare the latest forecast snapshot to the previous one and explain the probability shift using the default LLM.","operationId":"explain_shift_market_explain_shift_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplainShiftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Explain Shift Market Explain Shift Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/live-prices":{"get":{"tags":["System"],"summary":"Real-time market prices for tracked open markets","description":"Current market prices fetched directly from Polymarket/Kalshi for every\nmarket currently on the edge board. Used by the frontend to refresh market\nprices in real time without re-running model forecasts.\n\nReturns ``{prices: {ident: probability}, generated_at}``. Cached 30 s.","operationId":"live_prices_live_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/crypto-5m/equity":{"get":{"tags":["System"],"summary":"5-minute crypto strategy paper equity curves","description":"Paper equity curves for live-collected BTC/ETH/SOL 5-minute strategy candidates.\n\n``hours`` caps the replay window (up to ~3 years); ``hours=0`` returns the\nfull since-inception history so long-term durability is visible.","operationId":"crypto_5m_equity_crypto_5m_equity_get","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"number","maximum":26280.0,"minimum":0.0,"default":72.0,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/crypto-5m/kalshi-edge":{"get":{"tags":["System"],"summary":"Real Kalshi BTC model-vs-market calibration + paper equity","description":"Real-instrument view: model probability vs live Kalshi BTC bid/ask, scored\non the venue's own settlement. Served from the tick-committed payload (raw\nGitHub copy → bundled fallback) so it refreshes without a redeploy.","operationId":"crypto_5m_kalshi_edge_crypto_5m_kalshi_edge_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/track-record/pending-markets":{"get":{"tags":["System"],"summary":"Agent-enrolled markets awaiting tracking","description":"Markets that agents forecast against (via /predict or /agent/analyze) that\naren't yet in the live track record. The track-record Action pulls these and\nseeds them so they get tracked + scored. Token-gated (`X-Track-Token`).","operationId":"pending_markets_track_record_pending_markets_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Pending Markets Track Record Pending Markets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/track-record/mark-enrolled":{"post":{"tags":["System"],"summary":"Mark agent-enrolled markets as tracked","description":"Flip `enrolled=True` on markets the Action has started tracking (so they\nleave the pending queue), and prune old tracked/stale pointers. Token-gated.","operationId":"mark_enrolled_track_record_mark_enrolled_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkEnrolledRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mark Enrolled Track Record Mark Enrolled Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["System"],"summary":"Health check","description":"Returns `{\"status\": \"ok\"}` when the server is running.\n\nUse this endpoint for liveness probes and uptime monitoring.\nIt does **not** verify that the LLM provider is reachable.","operationId":"health_health_get","responses":{"200":{"description":"Service status.","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"},"example":{"status":"ok"}}}}}}},"/ready":{"get":{"tags":["System"],"summary":"Readiness check","description":"Returns 200 when the server is initialised and accepting traffic, 503\notherwise (still booting, misconfigured, or draining on shutdown).\n\nUnlike `/health` (liveness), this verifies the forecasting provider is\nconfigured — use it for load-balancer readiness routing.","operationId":"ready_ready_get","responses":{"200":{"description":"Whether the service is ready to serve traffic.","content":{"application/json":{"schema":{}}}}}}},"/analytics/visit":{"post":{"tags":["System"],"summary":"Record a privacy-preserving page visit","description":"Record one page visit with optional, non-reversible account attribution.\n\nStores no raw IP address. Unique visitors are estimated with a salted hash\nof IP address and user agent.","operationId":"record_visit_analytics_visit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Record Visit Analytics Visit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/event":{"post":{"tags":["System"],"summary":"Record product engagement event","description":"Record a lightweight product event with optional private attribution.","operationId":"record_analytics_event_analytics_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsEventRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Record Analytics Event Analytics Event Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/summary":{"get":{"tags":["System"],"summary":"Analytics Summary","description":"Return basic page-visit counts.\n\nIf `API_KEY` is configured, this endpoint requires `X-API-Key`.\n\nCounts are persisted in Cloud Datastore when available (survive deploys /\ninstance recycles); otherwise they come from the local ephemeral DuckDB.","operationId":"analytics_summary_analytics_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummary"}}}}}}},"/analytics/events/summary":{"get":{"tags":["System"],"summary":"Analytics Events Summary","description":"Return product-event counts for the last 30 days.\n\nIf `API_KEY` is configured, this endpoint requires `X-API-Key`.","operationId":"analytics_events_summary_analytics_events_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsEventSummary"}}}}}}},"/analytics/events/recent":{"get":{"tags":["System"],"summary":"Recent privacy-preserving product activity feed","description":"Return the most recent product events without exposing PII.","operationId":"recent_analytics_events_analytics_events_recent_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max events to return","default":20,"title":"Limit"},"description":"Max events to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecentAnalyticsEventsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/users":{"get":{"tags":["System"],"summary":"List registered users and verified email IDs for operators","description":"Return the list of registered accounts and verified email IDs for operators.","operationId":"list_registered_users_analytics_users_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Max users to return","default":500,"title":"Limit"},"description":"Max users to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/export":{"get":{"tags":["System"],"summary":"Export aggregate privacy-preserving analytics summary and registered users in CSV format","description":"Export 30-day aggregate traffic, event counts, and (for operators) registered users in CSV format.","operationId":"export_analytics_csv_analytics_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/analytics/dashboard":{"get":{"tags":["System"],"summary":"Live Operator Activity & Attribution Dashboard","description":"Operator dashboard for real-time Foresea activity and attribution monitoring.","operationId":"analytics_dashboard_analytics_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/forecasts/share":{"post":{"tags":["System"],"summary":"Share Forecast","description":"Create a public, intentionally shared forecast page.","operationId":"share_forecast_forecasts_share_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedForecastResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"post":{"tags":["System"],"summary":"Submit user feedback","description":"Accept feedback from the UI and forward it by email.","operationId":"submit_feedback_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Submit Feedback Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/polymarket":{"get":{"tags":["Markets"],"summary":"Fetch a Polymarket market","description":"Fetch a live Polymarket quote by market `slug` (or numeric `id`).\n\nThe result is normalised so `probability` can be passed to `/predict` as\n`market_probability` (with `market_platform=\"Polymarket\"`) to compute an edge.","operationId":"market_polymarket_markets_polymarket_get","parameters":[{"name":"slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}},{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketQuote"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/kalshi":{"get":{"tags":["Markets"],"summary":"Fetch a Kalshi market","description":"Fetch a live Kalshi quote by market `ticker` (e.g. `KXFED-26SEP-C`).","operationId":"market_kalshi_markets_kalshi_get","parameters":[{"name":"ticker","in":"query","required":true,"schema":{"type":"string","title":"Ticker"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketQuote"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/batch":{"get":{"tags":["Markets"],"summary":"Current state for N markets in one call","description":"Fetch current price/volume for up to 50 markets in one call, so a watchlist\ncheck doesn't need N sequential tool calls. Every quote carries `fetched_at`\nand `age_seconds` -- the freshness signal to make your own trust call on,\nsince both venues rate-limit hard and a quote can otherwise look fresh when\nit isn't. One bad ref returns an error on that entry only; the rest of the\nbatch still succeeds.","operationId":"market_batch_market_batch_get","parameters":[{"name":"refs","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"description":"Repeat this param per market: \"platform:ident\" or \"platform:ident:extra\" (extra = Kalshi series_ticker or Polymarket CLOB token_id, adds order book + candles). Up to 50 refs.","title":"Refs"},"description":"Repeat this param per market: \"platform:ident\" or \"platform:ident:extra\" (extra = Kalshi series_ticker or Polymarket CLOB token_id, adds order book + candles). Up to 50 refs."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchQuoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/radar":{"get":{"tags":["Markets"],"summary":"Live Foresea market radar","description":"Return a cached list of live markets with notable model-vs-market gaps.","operationId":"radar_radar_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":12,"title":"Limit"}},{"name":"include_track_record","in":"query","required":false,"schema":{"type":"boolean","description":"Include the track-record ledger blocks. They are 96% of this response and unrelated to the radar markets; pass false when you only want the markets. Defaults true so existing callers are unaffected.","default":true,"title":"Include Track Record"},"description":"Include the track-record ledger blocks. They are 96% of this response and unrelated to the radar markets; pass false when you only want the markets. Defaults true so existing callers are unaffected."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RadarResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/radar/delta":{"get":{"tags":["Markets"],"summary":"Lightweight delta updates for Foresea market radar","description":"Return only modified markets and new activity since the client's last poll timestamp.","operationId":"radar_delta_radar_delta_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO timestamp of client's last poll update","title":"Since"},"description":"ISO timestamp of client's last poll update"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/radar/stream":{"get":{"tags":["Markets"],"summary":"Live Server-Sent Events stream for Foresea market radar","description":"Server-Sent Events (SSE) stream providing real-time radar snapshots, delta updates, and heartbeats.","operationId":"radar_stream_radar_stream_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":12,"title":"Limit"}},{"name":"include_track_record","in":"query","required":false,"schema":{"type":"boolean","description":"Include track record blocks in snapshot","default":false,"title":"Include Track Record"},"description":"Include track record blocks in snapshot"},{"name":"heartbeat_interval","in":"query","required":false,"schema":{"type":"number","maximum":60.0,"minimum":5.0,"default":15.0,"title":"Heartbeat Interval"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/exchange-status":{"get":{"tags":["Markets"],"summary":"Operational status and schedule of exchanges","description":"Get Kalshi and prediction exchange operational status and schedule.","operationId":"market_exchange_status_market_exchange_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Market Exchange Status Market Exchange Status Get"}}}}}}},"/market/orderbook":{"get":{"tags":["Markets"],"summary":"Fetch real-time orderbook bids and asks","description":"Fetch live bids/asks orderbook depth.","operationId":"market_orderbook_route_market_orderbook_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","description":"Venue: 'kalshi' or 'polymarket'","default":"kalshi","title":"Platform"},"description":"Venue: 'kalshi' or 'polymarket'"},{"name":"ident","in":"query","required":true,"schema":{"type":"string","description":"Market ticker or token_id","title":"Ident"},"description":"Market ticker or token_id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Orderbook Route Market Orderbook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/trades":{"get":{"tags":["Markets"],"summary":"Recent executed trade tape","description":"Fetch executed prints/trade tape.","operationId":"market_trades_route_market_trades_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","description":"Venue: 'kalshi' or 'polymarket'","default":"kalshi","title":"Platform"},"description":"Venue: 'kalshi' or 'polymarket'"},{"name":"ident","in":"query","required":true,"schema":{"type":"string","description":"Market ticker or token_id","title":"Ident"},"description":"Market ticker or token_id"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max trades to return","default":20,"title":"Limit"},"description":"Max trades to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Trades Route Market Trades Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/leaderboard":{"get":{"tags":["Markets"],"summary":"Top trader rankings and volume leaders","description":"Fetch trader rankings and volume leaders.","operationId":"market_leaderboard_route_market_leaderboard_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max leaders to return","default":20,"title":"Limit"},"description":"Max leaders to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Leaderboard Route Market Leaderboard Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/tags":{"get":{"tags":["Markets"],"summary":"Categorization tags for a market","description":"Fetch market tags and categorization metadata.","operationId":"market_tags_route_market_tags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Market Tags Route Market Tags Get"}}}}}}},"/market/price-history":{"get":{"tags":["Markets"],"summary":"Candlestick OHLCV price history","description":"Fetch historical OHLCV candlestick bars.","operationId":"market_price_history_route_market_price_history_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","description":"Venue: 'kalshi' or 'polymarket'","default":"kalshi","title":"Platform"},"description":"Venue: 'kalshi' or 'polymarket'"},{"name":"ident","in":"query","required":true,"schema":{"type":"string","description":"Market ticker or token_id","title":"Ident"},"description":"Market ticker or token_id"},{"name":"series_ticker","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Series ticker for Kalshi","title":"Series Ticker"},"description":"Series ticker for Kalshi"},{"name":"start_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Start Ts"}},{"name":"end_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"End Ts"}},{"name":"period_interval","in":"query","required":false,"schema":{"type":"integer","description":"Kalshi candle minutes: 1, 60, or 1440","default":60,"title":"Period Interval"},"description":"Kalshi candle minutes: 1, 60, or 1440"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Price History Route Market Price History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/debate":{"post":{"tags":["Agents"],"summary":"Multi-Agent Bull vs. Bear Adversarial Debate & Blind Spot Analyzer","description":"Executes a 3-agent adversarial cross-examination (Bull, Bear, Judge) on a forecasting question.","operationId":"agent_debate_agent_debate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DebateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Agent Debate Agent Debate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/index-forecast":{"get":{"tags":["Markets"],"summary":"Calibrated range forecasts for ten NSE indices","description":"Today's 1-, 5- and 21-session range forecasts for ten NSE indices and their track record.\n\nBuilt once per trading day from Upstox's NSE index closes and India VIX by\nscripts/index_forecast_tick.py. The forecasts are ranges and the chance of closing above\nround levels, not direction calls: a walk-forward test found no up/down skill.","operationId":"markets_index_forecast_markets_index_forecast_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markets/commodity-pairs":{"get":{"tags":["Markets"],"summary":"Statistical-arbitrage tracker for ten commodity pairs","description":"How stretched ten commodity pair spreads are, and the live record of stretched-pair signals.\n\nBuilt once a day from MCX futures (Upstox), FRED spot prices and gold and platinum snapshots by\nscripts/commodity_pairs_tick.py. A\nmonitor, not a strategy: the same signal rule lost money on half the pairs in a\n2011-2026 backtest, which the payload carries per pair.","operationId":"markets_commodity_pairs_markets_commodity_pairs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/market/weather-radar":{"get":{"tags":["Markets"],"summary":"Live prediction-market weather radar evaluated against neural weather models","description":"Scan active Kalshi daily temperature contracts, compute real-time calibrated\nneural weather model forecasts (Google DeepMind WeatherNext / MetNet or Open-Meteo),\napply microclimate station bias offsets, and evaluate strike bracket probabilities and edges.","operationId":"market_weather_radar_market_weather_radar_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"Max weather opportunities to return","default":15,"title":"Limit"},"description":"Max weather opportunities to return"},{"name":"min_edge","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Filter by minimum absolute model edge","default":0.0,"title":"Min Edge"},"description":"Filter by minimum absolute model edge"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Weather Radar Market Weather Radar Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/portfolio/optimal-allocation":{"get":{"tags":["Trading"],"summary":"Calculate optimal Fractional Kelly allocation across live Grade A/B opportunities","description":"Compute optimal Fractional Kelly position sizing across live audited Radar opportunities.","operationId":"portfolio_optimal_allocation_portfolio_optimal_allocation_get","parameters":[{"name":"bankroll","in":"query","required":false,"schema":{"type":"number","minimum":10.0,"description":"Total portfolio capital in USD","default":1000.0,"title":"Bankroll"},"description":"Total portfolio capital in USD"},{"name":"kelly_fraction","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.05,"description":"Kelly fraction (0.25 = Quarter-Kelly)","default":0.25,"title":"Kelly Fraction"},"description":"Kelly fraction (0.25 = Quarter-Kelly)"},{"name":"min_edge","in":"query","required":false,"schema":{"type":"number","minimum":0.01,"description":"Minimum edge threshold","default":0.05,"title":"Min Edge"},"description":"Minimum edge threshold"},{"name":"min_credibility","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Minimum credibility score threshold","default":0.6,"title":"Min Credibility"},"description":"Minimum credibility score threshold"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Portfolio Optimal Allocation Portfolio Optimal Allocation Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/portfolio/optimize":{"post":{"tags":["Trading"],"summary":"Optimize arbitrary list of market opportunities using Fractional Kelly","description":"Optimize position sizing on supplied or live opportunities.","operationId":"portfolio_optimize_post_portfolio_optimize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioOptimizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Portfolio Optimize Post Portfolio Optimize Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stream/radar":{"get":{"tags":["System"],"summary":"Live Server-Sent Events (SSE) feed for Market Radar Desk","description":"Stream live market radar updates, price movements, and edge detections via SSE.","operationId":"stream_radar_stream_radar_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/arbitrage/cross-venue":{"get":{"tags":["Markets"],"summary":"Scan cross-venue synthetic arbitrage & statistical spreads between Polymarket and Kalshi","description":"Scan and compute real-time cross-venue spreads between Polymarket and Kalshi.","operationId":"arbitrage_cross_venue_route_v1_arbitrage_cross_venue_get","parameters":[{"name":"min_spread","in":"query","required":false,"schema":{"type":"number","minimum":0.01,"description":"Minimum price divergence threshold","default":0.03,"title":"Min Spread"},"description":"Minimum price divergence threshold"},{"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":"object","additionalProperties":true,"title":"Response Arbitrage Cross Venue Route V1 Arbitrage Cross Venue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/batch/forecast":{"post":{"tags":["Inference"],"summary":"Batch forecast multiple prediction market questions concurrently","description":"Execute concurrent calibrated forecasts across a list of market questions.","operationId":"batch_forecast_route_v1_batch_forecast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Batch Forecast Route V1 Batch Forecast Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/system/health":{"get":{"tags":["System"],"summary":"Institutional system health and venue connectivity metrics","description":"Inspect system health, venue connectivity, and calibration metrics.","operationId":"system_health_route_v1_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response System Health Route V1 System Health Get"}}}}}}},"/v1/market/whale-flow":{"get":{"tags":["Markets"],"summary":"Track large block trades and net smart-money flow across Polymarket and Kalshi","description":"Inspect large institutional trade prints and sentiment positioning.","operationId":"market_whale_flow_route_v1_market_whale_flow_get","parameters":[{"name":"min_notional","in":"query","required":false,"schema":{"type":"number","minimum":10.0,"description":"Minimum trade value in USD to qualify as whale print","default":250.0,"title":"Min Notional"},"description":"Minimum trade value in USD to qualify as whale print"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Whale Flow Route V1 Market Whale Flow Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/accounts":{"get":{"tags":["Trading"],"summary":"Check configured trading venues","description":"Return configured/not-configured status for server-side exchange credentials.\n\nThis endpoint never returns private keys, API secrets, or passphrases. Live\norder submission still requires `/trading/orders` confirmation.","operationId":"trading_accounts_trading_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingAccountStatus"}}}}}}},"/trading/accounts/check":{"post":{"tags":["Trading"],"summary":"Validate own-account (BYO) trading credentials","description":"Report readiness for caller-supplied own-account credentials, never stored.\n\nLets the UI confirm a connected Kalshi/Polymarket account (e.g. the RSA key\nparses) before placing an order. Credentials are used transiently and never\nechoed back — only boolean readiness is returned.","operationId":"trading_accounts_check_trading_accounts_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingAccountCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingAccountStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/guardrails":{"get":{"tags":["Trading"],"summary":"Read the signed-in user's real-money trading guardrails","operationId":"get_trading_guardrails_trading_guardrails_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingGuardrailsResponse"}}}}}},"put":{"tags":["Trading"],"summary":"Narrow the signed-in user's real-money trading guardrails","operationId":"update_trading_guardrails_trading_guardrails_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingGuardrailsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingGuardrailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/guardrails/events":{"get":{"tags":["Trading"],"summary":"List safe audit events for real-money trading controls","operationId":"list_trading_guardrail_events_trading_guardrails_events_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":250,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Trading Guardrail Events Trading Guardrails Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/connections":{"get":{"tags":["Trading"],"summary":"List encrypted exchange connections","description":"Return only connection metadata for the signed-in user, never secrets.","operationId":"trading_connections_trading_connections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingConnectionsResponse"}}}}}}},"/trading/connections/{platform}":{"put":{"tags":["Trading"],"summary":"Encrypt and save one exchange connection","description":"Validate and store one account connection with server-side encryption.","operationId":"save_trading_connection_trading_connections__platform__put","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingConnectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Trading"],"summary":"Delete one encrypted exchange connection","description":"Delete only the encrypted credential blob; trading audit history remains.","operationId":"delete_trading_connection_trading_connections__platform__delete","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradingConnectionStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/kite":{"get":{"tags":["Kite Personal"],"summary":"Private Kite connection status","operationId":"kite_connection_status_integrations_kite_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["Kite Personal"],"summary":"Validate and encrypt a daily Kite session","operationId":"kite_connect_integrations_kite_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Kite Personal"],"summary":"Remove your stored Kite session","operationId":"kite_disconnect_integrations_kite_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/integrations/kite/quotes":{"get":{"tags":["Kite Connect"],"summary":"Read your subscribed Kite market snapshots","operationId":"kite_market_quotes_integrations_kite_quotes_get","parameters":[{"name":"i","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":500,"title":"I"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/kite/history":{"get":{"tags":["Kite Connect"],"summary":"Read your subscribed Kite OHLCV candles","operationId":"kite_market_history_integrations_kite_history_get","parameters":[{"name":"instrument","in":"query","required":true,"schema":{"type":"string","maxLength":120,"title":"Instrument"}},{"name":"interval","in":"query","required":false,"schema":{"type":"string","maxLength":10,"default":"day","title":"Interval"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","maxLength":40,"title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","maxLength":40,"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integrations/kite/{resource}":{"get":{"tags":["Kite Personal"],"summary":"Read private Kite account data","operationId":"kite_account_resource_integrations_kite__resource__get","parameters":[{"name":"resource","in":"path","required":true,"schema":{"enum":["holdings","positions","funds","orders"],"type":"string","title":"Resource"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/model-providers":{"get":{"tags":["Model Providers"],"summary":"List safe BYO model provider connection statuses","description":"Return configured model provider statuses without leaking secret API keys.","operationId":"list_user_model_providers_api_user_model_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModelProvidersResponse"}}}}}}},"/api/user/model-providers/{provider_id}":{"put":{"tags":["Model Providers"],"summary":"Encrypt and save credentials for one AI model provider","description":"Validate and store one model provider connection with server-side envelope encryption.","operationId":"save_user_model_provider_api_user_model_providers__provider_id__put","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveUserModelProviderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModelProviderStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Model Providers"],"summary":"Delete encrypted credentials for one AI model provider","description":"Delete encrypted credentials for the specified provider.","operationId":"delete_user_model_provider_api_user_model_providers__provider_id__delete","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModelProviderStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/model-providers/{provider_id}/test":{"post":{"tags":["Model Providers"],"summary":"Live-test credentials against the provider API","description":"Send a minimal test request to verify API key validity and measure response latency.","operationId":"test_user_model_provider_api_user_model_providers__provider_id__test_post","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestUserModelProviderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestUserModelProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/preview":{"post":{"tags":["Trading"],"summary":"Preview a guarded prediction-market order","description":"Validate and normalize a Kalshi/Polymarket order without placing it.","operationId":"trading_preview_trading_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeOrderPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/runs":{"post":{"tags":["Trading"],"summary":"Create a durable, reviewable live-trade run","description":"Save a validated order plan. This endpoint cannot submit an order.","operationId":"create_trading_run_trading_runs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRunCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Trading"],"summary":"List the signed-in user's durable trade runs","operationId":"list_trading_runs_trading_runs_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Platform"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Trading Runs Trading Runs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/runs/{run_id}":{"get":{"tags":["Trading"],"summary":"Read one durable trade run","operationId":"read_trading_run_trading_runs__run_id__get","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/TradeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/runs/{run_id}/execute":{"post":{"tags":["Trading"],"summary":"Execute one saved run after explicit confirmation","description":"Submit exactly one approved run and attach the resulting order audit row.","operationId":"execute_trading_run_trading_runs__run_id__execute_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRunExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/orders":{"post":{"tags":["Trading"],"summary":"Submit a confirmed prediction-market order","description":"Submit a live order after preview guardrails and exact confirmation.\n\nLive execution is disabled unless `FORESEA_ENABLE_BYO_TRADING=true`. Market/IOC\nstyle orders are separately disabled unless `FORESEA_ALLOW_MARKET_ORDERS=true`.","operationId":"trading_order_trading_orders_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Trading"],"summary":"List the signed-in user's submitted order audit trail","operationId":"list_trading_orders_trading_orders_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Platform"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Trading Orders Trading Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/portfolio":{"get":{"tags":["Trading"],"summary":"Reconcile an exchange portfolio, orders, and fills","description":"Fetch live venue state and safely merge known order status/fill progress.","operationId":"trading_portfolio_trading_portfolio_get","parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Platform"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trading Portfolio Trading Portfolio Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/orders/{audit_order_id}/reconcile":{"post":{"tags":["Trading"],"summary":"Refresh a submitted order's fill/status","operationId":"reconcile_trading_order_trading_orders__audit_order_id__reconcile_post","parameters":[{"name":"audit_order_id","in":"path","required":true,"schema":{"type":"string","title":"Audit Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reconcile Trading Order Trading Orders  Audit Order Id  Reconcile Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/runs/{run_id}/reconcile":{"post":{"tags":["Trading"],"summary":"Reconcile the exchange order linked to a durable trade run","operationId":"reconcile_trading_run_trading_runs__run_id__reconcile_post","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/TradeRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/orders/{audit_order_id}":{"delete":{"tags":["Trading"],"summary":"Cancel the remaining quantity of a submitted order","operationId":"cancel_trading_order_trading_orders__audit_order_id__delete","parameters":[{"name":"audit_order_id","in":"path","required":true,"schema":{"type":"string","title":"Audit Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelTradingOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Trading Order Trading Orders  Audit Order Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/models":{"get":{"tags":["System"],"summary":"List models from a provider base URL","description":"Fetch available models from an OpenAI-compatible or Ollama endpoint.\n\nPass `base_url` (e.g. `http://localhost:11434`). Returns `{models: [...]}`.\nCloud-metadata hosts are blocked.","operationId":"list_provider_models_providers_models_get","parameters":[{"name":"base_url","in":"query","required":true,"schema":{"type":"string","maxLength":500,"title":"Base Url"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/extract":{"post":{"tags":["System"],"summary":"Extract text from a PDF file or URL","description":"Extract plain text from an uploaded PDF or a web URL.\n\nReturns a dict compatible with the `news_articles` field of `/predict`:\n`{title, text, source, url}`. Pass one of `file` or `url`, not both.","operationId":"extract_attachment_extract_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_attachment_extract_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Extract Attachment Extract Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/google":{"post":{"tags":["Auth"],"summary":"Sign in with Google","description":"Verify a Google One-Tap ID token, create or update the user account, and return a session token.\n\nThe browser should send the `credential` string returned by\n`google.accounts.id.initialize({ callback })` after the user grants consent.\nStore the returned `token` in `localStorage` and include it as\n`Authorization: Bearer <token>` on subsequent authenticated requests.","operationId":"auth_google_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/github":{"post":{"tags":["Auth"],"summary":"Sign in with GitHub","description":"Exchange a GitHub OAuth `code` for the user's profile and return a session token.\n\nThe browser sends users to GitHub's authorize URL, then posts the returned\n`code` (and the same `redirect_uri`) here. Store the returned `token` like the\nGoogle flow.","operationId":"auth_github_auth_github_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GitHubAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["Auth"],"summary":"Create an account","description":"Create an email/password account and return a session token.\n\nThe email becomes the account ID. Passwords are stored as salted\nPBKDF2-HMAC-SHA256 hashes; the plaintext is never persisted.","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/SessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["Auth"],"summary":"Sign in with email and password","description":"Verify an email/password account and return a session token.","operationId":"auth_login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["Auth"],"summary":"Get current user","description":"Return the authenticated user decoded from the `Authorization: Bearer` session token.","operationId":"auth_me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthMeResponse"}}}}}}},"/personal-ledger":{"get":{"tags":["Auth"],"summary":"List Personal Ledger","description":"Return the current user's explicitly saved chat forecasts.","operationId":"list_personal_ledger_personal_ledger_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalLedgerList"}}}}}}},"/personal-ledger/{entry_id}":{"put":{"tags":["Auth"],"summary":"Save Personal Ledger Entry","description":"Save a forecast to the current user's private personal ledger.","operationId":"save_personal_ledger_entry_personal_ledger__entry_id__put","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalLedgerEntry"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalLedgerEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Auth"],"summary":"Delete Personal Ledger Entry","description":"Remove one saved forecast from the current user's personal ledger.","operationId":"delete_personal_ledger_entry_personal_ledger__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Delete Personal Ledger Entry Personal Ledger  Entry Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/personal-ledger/{entry_id}/verdict":{"patch":{"tags":["Auth"],"summary":"Judge Personal Ledger Entry","description":"Mark one of the current user's saved forecasts correct or wrong.","operationId":"judge_personal_ledger_entry_personal_ledger__entry_id__verdict_patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalLedgerVerdict"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalLedgerEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent-profiles":{"get":{"tags":["Agents"],"summary":"List Agent Profiles","description":"List the current user's private copied-agent recipes.","operationId":"list_agent_profiles_agent_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileList"}}}}}}},"/agent-profiles/copy":{"post":{"tags":["Agents"],"summary":"Copy Agent Profile","description":"Copy a public model's research setup into a private, research-only recipe.","operationId":"copy_agent_profile_agent_profiles_copy_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileCopyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentProfileCopyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent-profiles/{profile_id}":{"delete":{"tags":["Agents"],"summary":"Delete Agent Profile","description":"Delete one of the current user's private copied-agent recipes.","operationId":"delete_agent_profile_agent_profiles__profile_id__delete","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Delete Agent Profile Agent Profiles  Profile Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs":{"get":{"tags":["Agents"],"summary":"List Agent Runs","description":"List the signed-in user's durable research runs, newest activity first.","operationId":"list_agent_runs_agent_runs_get","parameters":[{"name":"client_run_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"description":"Filter to the run created with this caller-supplied idempotency key -- how an API-key client looks its own run back up by client_run_key after a timeout.","title":"Client Run Key"},"description":"Filter to the run created with this caller-supplied idempotency key -- how an API-key client looks its own run back up by client_run_key after a timeout."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRunList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/runs/{run_id}":{"get":{"tags":["Agents"],"summary":"Read Agent Run","description":"Read one private research run, including its completed report when available.","operationId":"read_agent_run_agent_runs__run_id__get","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/AgentRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/favorites":{"get":{"tags":["Auth"],"summary":"List favourited markets","description":"Return the signed-in user's favourited markets/questions (their watchlist).","operationId":"list_favorites_favorites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteList"}}}}}}},"/favorites/{key}":{"put":{"tags":["Auth"],"summary":"Add/update a favourite","description":"Create or replace one favourite for the signed-in user.","operationId":"save_favorite_favorites__key__put","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMarket"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMarket"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Auth"],"summary":"Remove a favourite","description":"Delete one favourite for the signed-in user.","operationId":"remove_favorite_favorites__key__delete","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Remove Favorite Favorites  Key  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/favorites/prices":{"get":{"tags":["Auth"],"summary":"Live prices for favourited markets","description":"Fetch current market prices for the user's favourited markets (cheap, no LLM).","operationId":"favorite_prices_favorites_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Favorite Prices Favorites Prices Get"}}}}}}},"/market/quote":{"get":{"tags":["Markets"],"summary":"Quote a single market by platform+ident","description":"Fetch one market's current quote (question, price, 24h change, close time)\nso the watchlist can add a market pasted as a URL. Public + cached, no LLM.","operationId":"market_quote_market_quote_get","parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Platform"}},{"name":"ident","in":"query","required":true,"schema":{"type":"string","maxLength":200,"title":"Ident"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Market Quote Market Quote Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/forecast":{"post":{"tags":["Markets"],"summary":"Forecast one market now","description":"Run the model on a single market right now and return its probability, so a\nfreshly-watchlisted market shows a forecast without waiting for the next tick.\nSign-in gated (the watchlist is). Reuses the `/predict` pipeline.","operationId":"market_forecast_market_forecast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Market Forecast Market Forecast Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/forecast/stream":{"post":{"tags":["Markets"],"summary":"Stream one market forecast now","description":"Stream the underlying LLM forecast for a newly-watchlisted market.","operationId":"market_forecast_stream_market_forecast_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketForecastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markets/search":{"get":{"tags":["Markets"],"summary":"Search markets to add to a watchlist","description":"Search open Polymarket + Kalshi markets by keyword and/or category (empty\n`q`+`category` = trending by volume) so the watchlist can browse-and-add with\none click. Public + cached.","operationId":"markets_search_markets_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120,"default":"","title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":40,"default":"","title":"Category"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":1,"default":24,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Markets Search Markets Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rag/ingest":{"post":{"tags":["Knowledge"],"summary":"Add a document to your knowledge base","description":"Chunk, embed, and store a document (text or URL) in the signed-in user's\nknowledge base, so the agent can retrieve it as evidence.","operationId":"rag_ingest_rag_ingest_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RagIngestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Rag Ingest Rag Ingest Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rag/search":{"get":{"tags":["Knowledge"],"summary":"Search your knowledge base","operationId":"rag_search_rag_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"namespace","in":"query","required":false,"schema":{"type":"string","default":"kb","title":"Namespace"}},{"name":"top_k","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Top K"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RagSearchResult"},"title":"Response Rag Search Rag Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rag/documents":{"get":{"tags":["Knowledge"],"summary":"List your knowledge-base documents","operationId":"rag_documents_rag_documents_get","parameters":[{"name":"namespace","in":"query","required":false,"schema":{"type":"string","default":"kb","title":"Namespace"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rag Documents Rag Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Knowledge"],"summary":"Delete knowledge-base documents","operationId":"rag_delete_rag_documents_delete","parameters":[{"name":"namespace","in":"query","required":false,"schema":{"type":"string","default":"kb","title":"Namespace"}},{"name":"doc_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Rag Delete Rag Documents Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict":{"post":{"tags":["Inference"],"summary":"Run a single forecasting prediction","description":"Submit a forecasting question and receive a typed structured prediction.\n\nThe model returns:\n- **`question_type`** — `binary`, `multiple_choice`, `numeric`, or `date`\n- **`predicted_answer`** — `Yes`/`No`, top option, or median estimate\n- **`confidence`** — probability (0–1) for binary and multiple-choice answers\n- **`options`** — per-option probabilities for multiple-choice questions\n- **`range_forecast`** — p10/p50/p90 bounds for numeric and date questions\n- **`rationale`** — 2–4 sentence explanation\n- **`evidence_sources`** — news articles used as context\n- **`market_analysis`** — model-vs-market edge when `market_probability` is provided\n\n### Choosing a variant\n\nStart with `variant0_neutral_baseline` (the default). Switch to other variants\nto inject additional structure into the prompt — for example, `variant3_reasoning_type`\nasks the model to identify whether the prediction is based on speculation, an expert\nforecast, or a stated plan.\n\n### Providing your own evidence\n\nPass pre-fetched articles in `news_articles` to use them directly.\nLeave the list empty to trigger automatic news retrieval (if the evidence\npipeline is configured on the server).\n\n### Example — binary request\n\n```bash\ncurl -X POST /predict \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"question\": \"Will oil prices exceed $100 per barrel in 2026?\",\n    \"question_type\": \"binary\",\n    \"market_platform\": \"Kalshi\",\n    \"market_probability\": 0.31\n  }'\n```\n\n### Example — multiple choice\n\n```bash\ncurl -X POST /predict \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"question\": \"Who will win the 2026 Formula 1 drivers championship?\",\n    \"question_type\": \"multiple_choice\",\n    \"options\": [\"Max Verstappen\", \"Lando Norris\", \"Charles Leclerc\", \"Lewis Hamilton\", \"Other\"],\n    \"attach_evidence\": false\n  }'\n```\n\n### Example — numeric forecast with context\n\n```bash\ncurl -X POST /predict \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"question\": \"What will US CPI inflation be in December 2026?\",\n    \"question_type\": \"numeric\",\n    \"resolution_criteria\": \"Use the year-over-year CPI-U inflation rate for December 2026.\",\n    \"categories\": [\"Economics\", \"United States\"],\n    \"variant\": \"variant5_key_conditions\"\n  }'\n```","operationId":"predict_predict_post","parameters":[{"name":"kb_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"}}}},"responses":{"200":{"description":"Prediction returned successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictResponse"}}}},"400":{"description":"Invalid request — unknown variant or malformed input."},"401":{"description":"Missing or invalid `X-API-Key` header (only when API key is configured)."},"429":{"description":"Rate limit exceeded. Retry after 60 seconds."},"503":{"description":"Server not yet initialised — LLM provider not loaded."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict/device/prepare":{"post":{"tags":["Inference"],"summary":"Build the forecast prompt for a model on your own device","description":"Gather evidence and build the forecast prompt without calling a model.\n\nSend the returned `messages` to your own model (any OpenAI-compatible\n`/v1/chat/completions` server), then post its reply with the returned\n`request` and evidence to `/predict/device/finish`.","operationId":"predict_device_prepare_predict_device_prepare_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevicePrepareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict/device/finish":{"post":{"tags":["Inference"],"summary":"Turn your device model's reply into a forecast","description":"Parse a local model's reply into the same `PredictResponse` that `/predict` returns.\n\nNothing is cached, scored or added to the track record: the reply comes\nfrom the caller's own model.","operationId":"predict_device_finish_predict_device_finish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceFinishRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict/stream":{"post":{"tags":["Inference"],"summary":"Stream a conversational forecasting response","description":"Stream model output as server-sent events, for all question types.\n\nDelta events carry raw text chunks as they arrive so the UI can render the\nrationale progressively. The final ``done`` event contains the same fully-\nparsed ``PredictResponse`` shape that ``/predict`` returns, including\nstructured fields (``predicted_answer``, ``confidence``, etc.) for binary,\nnumeric, and multiple-choice questions.","operationId":"predict_stream_predict_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictRequest"}}},"required":true},"responses":{"200":{"description":"Server-sent events containing model text deltas and a final PredictResponse payload.","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict/ensemble":{"post":{"tags":["Inference"],"summary":"Calibrated Brier-weighted ensemble forecast across multiple models","description":"Produce an empirically calibrated ensemble forecast combining multiple LLM models weighted by their verified historical Brier score.","operationId":"predict_ensemble_predict_ensemble_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnsemblePredictRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnsemblePredictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/predict/batch":{"post":{"tags":["Inference"],"summary":"Batch forecast multiple prediction market questions concurrently","description":"Submit up to 25 forecasting questions and receive concurrent structured predictions.","operationId":"predict_batch_predict_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPredictRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPredictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/subscribe":{"post":{"tags":["Webhooks"],"summary":"Subscribe an external agent callback webhook for real-time market events","description":"Register an automated webhook callback. The response contains an HMAC secret (X-Foresea-Signature) for validating payloads.","operationId":"webhook_subscribe_webhooks_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/subscriptions":{"get":{"tags":["Webhooks"],"summary":"List active webhook subscriptions","description":"List all registered webhook subscriptions.","operationId":"webhook_list_subscriptions_webhooks_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Webhook List Subscriptions Webhooks Subscriptions Get"}}}}}}},"/webhooks/subscriptions/{sub_id}":{"delete":{"tags":["Webhooks"],"summary":"Unsubscribe an external agent webhook","description":"Delete a registered webhook subscription.","operationId":"webhook_delete_subscription_webhooks_subscriptions__sub_id__delete","parameters":[{"name":"sub_id","in":"path","required":true,"schema":{"type":"string","title":"Sub Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Webhook Delete Subscription Webhooks Subscriptions  Sub Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/analyze":{"post":{"tags":["Agents"],"summary":"Run the analysis agent on a live question","description":"Orchestrate an end-to-end analysis of a live market question.\n\nPipeline: resolve the market (fetch a live Polymarket/Kalshi price when an\nidentifier is given) → gather evidence and forecast → compute the model-vs-market\nedge → run any custom **skills** → recommend. Returns one structured report.","operationId":"agent_analyze_agent_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalyzeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/analyze/stream":{"post":{"tags":["Agents"],"summary":"Stream the analysis agent on a live question","description":"Stream the agent's LLM forecast thesis while preserving the final report shape.\n\nThe fixed pipeline streams the underlying forecast generation as `delta` events,\nthen emits the same structured `AgentReport` as `/agent/analyze` in `done`.\nTool-loop mode remains available through the blocking endpoint because its model\nturns are interleaved with tool calls rather than one continuous answer.","operationId":"agent_analyze_stream_agent_analyze_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalyzeRequest"}}},"required":true},"responses":{"200":{"description":"Server-sent events with forecast deltas and a final AgentReport payload.","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/scan":{"get":{"tags":["Agents"],"summary":"Scan a venue for mispriced markets","description":"Scan live markets on one or both venues and surface the most mispriced.\n\nLists active markets (Polymarket and/or Kalshi), forecasts each, compares\nagainst the market price, and returns those whose model-vs-market gap is at\nleast `min_edge`. `platform` accepts `polymarket`, `kalshi`, or `all`/`both`.\n`query` optionally filters to markets whose question contains that keyword\n(e.g. `nba`). Bounded by `limit` per venue (max 8) since each market runs a\nfull forecast; results are cached briefly.","operationId":"agent_scan_agent_scan_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","default":"polymarket","title":"Platform"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":4,"title":"Limit"}},{"name":"min_edge","in":"query","required":false,"schema":{"type":"number","default":0.1,"title":"Min Edge"}},{"name":"evidence_top_k","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Evidence Top K"}},{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/mandates":{"post":{"tags":["Autonomous Twin"],"summary":"Create Route","operationId":"create_route_twin_mandates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandateDraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/mandates/{mandate_id}":{"get":{"tags":["Autonomous Twin"],"summary":"Read Route","operationId":"read_route_twin_mandates__mandate_id__get","parameters":[{"name":"mandate_id","in":"path","required":true,"schema":{"type":"string","title":"Mandate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/mandates/{mandate_id}/revisions":{"post":{"tags":["Autonomous Twin"],"summary":"Revise Route","operationId":"revise_route_twin_mandates__mandate_id__revisions_post","parameters":[{"name":"mandate_id","in":"path","required":true,"schema":{"type":"string","title":"Mandate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandateRevisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/mandates/{mandate_id}/approve":{"post":{"tags":["Autonomous Twin"],"summary":"Approve Route","operationId":"approve_route_twin_mandates__mandate_id__approve_post","parameters":[{"name":"mandate_id","in":"path","required":true,"schema":{"type":"string","title":"Mandate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandateApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/mandates/{mandate_id}/revoke":{"post":{"tags":["Autonomous Twin"],"summary":"Revoke Route","operationId":"revoke_route_twin_mandates__mandate_id__revoke_post","parameters":[{"name":"mandate_id","in":"path","required":true,"schema":{"type":"string","title":"Mandate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandateTransitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/status":{"get":{"tags":["Autonomous Twin"],"summary":"Status Route","operationId":"status_route_twin_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twin/portfolio":{"get":{"tags":["Autonomous Twin"],"summary":"Portfolio Route","operationId":"portfolio_route_twin_portfolio_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twin/decisions":{"get":{"tags":["Autonomous Twin"],"summary":"Decisions Route","operationId":"decisions_route_twin_decisions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/commands":{"get":{"tags":["Autonomous Twin"],"summary":"Commands Route","operationId":"commands_route_twin_commands_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/readiness":{"get":{"tags":["Autonomous Twin"],"summary":"Readiness Route","operationId":"readiness_route_twin_readiness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twin/pause":{"post":{"tags":["Autonomous Twin"],"summary":"Pause Route","operationId":"pause_route_twin_pause_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorPauseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/commands/{command_id}/cancel":{"post":{"tags":["Autonomous Twin"],"summary":"Cancel Route","operationId":"cancel_route_twin_commands__command_id__cancel_post","parameters":[{"name":"command_id","in":"path","required":true,"schema":{"type":"string","title":"Command Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twin/accounts/{scope_id}/opening":{"get":{"tags":["Autonomous Twin"],"summary":"Review Route","operationId":"review_route_twin_accounts__scope_id__opening_get","parameters":[{"name":"scope_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"title":"Scope Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Autonomous Twin"],"summary":"Confirm Route","operationId":"confirm_route_twin_accounts__scope_id__opening_post","parameters":[{"name":"scope_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"title":"Scope Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpeningConfirmation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/market/venue/catalog":{"get":{"tags":["Venue APIs"],"summary":"Discover public venue operations and schemas","operationId":"venue_catalog_market_venue_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Venue Catalog Market Venue Catalog Get"}}}}}}},"/market/venue/{platform}/{operation}":{"post":{"tags":["Venue APIs"],"summary":"Execute public venue operation","operationId":"public_venue_data_market_venue__platform___operation__post","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}},{"name":"operation","in":"path","required":true,"schema":{"type":"string","title":"Operation"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VenueRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Public Venue Data Market Venue  Platform   Operation  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/venue/catalog":{"get":{"tags":["Venue APIs"],"summary":"Discover authenticated venue account operations and actions","operationId":"account_venue_catalog_trading_venue_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Account Venue Catalog Trading Venue Catalog Get"}}}}}}},"/trading/venue/{platform}/{operation}":{"post":{"tags":["Venue APIs"],"summary":"Execute authenticated venue account read","operationId":"account_venue_data_trading_venue__platform___operation__post","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}},{"name":"operation","in":"path","required":true,"schema":{"type":"string","title":"Operation"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VenueRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Account Venue Data Trading Venue  Platform   Operation  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trading/venue/{platform}/actions/{operation}":{"post":{"tags":["Venue APIs"],"summary":"Execute guarded venue order action","operationId":"venue_action_trading_venue__platform__actions__operation__post","parameters":[{"name":"platform","in":"path","required":true,"schema":{"type":"string","title":"Platform"}},{"name":"operation","in":"path","required":true,"schema":{"type":"string","title":"Operation"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VenueActionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Venue Action Trading Venue  Platform  Actions  Operation  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentAnalyzeRequest":{"properties":{"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question","description":"Market question. Optional if a market identifier is given."},"platform":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Platform","description":"'polymarket' or 'kalshi' to fetch a live price."},"market_platform":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Market Platform","description":"Prediction-market venue supplied by the forecasting UI."},"market_ident":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Market Ident","description":"Polymarket slug or Kalshi ticker supplied by the forecasting UI."},"market_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Market Url"},"slug":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Slug","description":"Polymarket market slug."},"market_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Market Id","description":"Polymarket numeric market id."},"ticker":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Ticker","description":"Kalshi market ticker."},"description":{"type":"string","maxLength":4000,"title":"Description","default":""},"resolution_criteria":{"type":"string","maxLength":12000,"title":"Resolution Criteria","default":""},"categories":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Categories"},"news_articles":{"items":{"$ref":"#/components/schemas/NewsArticle"},"type":"array","maxItems":20,"title":"News Articles"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability","description":"Override market price (0..1 or 0..100) when not fetching."},"market_bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Bid"},"market_ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Ask"},"market_volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Volume"},"market_liquidity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Liquidity"},"resolve_time":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Resolve Time"},"variant":{"type":"string","maxLength":64,"title":"Variant","default":"variant0_neutral_baseline"},"evidence_top_k":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Evidence Top K","default":20},"skills":{"items":{"$ref":"#/components/schemas/AgentSkill"},"type":"array","maxItems":5,"title":"Skills","description":"Up to 5 custom skills to run."},"builtin_skills":{"type":"boolean","title":"Builtin Skills","description":"Also run the built-in forecasting toolkit (base rate, scenario decomposition, red team, key drivers).","default":false},"ground_in_record":{"type":"boolean","title":"Ground In Record","description":"Condition the forecast on the model's own live track-record calibration.","default":false},"tool_loop":{"type":"boolean","title":"Tool Loop","description":"Use a ReAct tool-using loop (model plans + calls tools) instead of the fixed pipeline.","default":false},"benchmark_tools":{"type":"boolean","title":"Benchmark Tools","description":"When tool_loop=true, expose Foresea's market-research toolkit. place_trade and manage_notes are reserved for Foresea's scheduled trading agents and are not available over the API.","default":false},"benchmark_tool_names":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":3},{"type":"null"}],"title":"Benchmark Tool Names","description":"When benchmark_tools=true, restrict the exposed tool set to named Foresea tools -- e.g. a research-only call passes ['web_search', 'orderbook'], a pure-reasoning call passes [] (no tools, so the model must answer on its first turn). Unset exposes every tool available to the caller. Naming place_trade or manage_notes over the API is refused with 403."},"max_tool_steps":{"type":"integer","minimum":1.0,"title":"Max Tool Steps","description":"Max tool calls in the loop.","default":8},"effort_tier":{"anyOf":[{"type":"string","enum":["simple","standard","deep"]},{"type":"null"}],"title":"Effort Tier","description":"How much analysis effort this question gets (evidence fetch depth, which built-in skills run, tool-loop step budget). Set explicitly to override; left unset, the server estimates it from the question."},"history":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","maxItems":24,"title":"History","description":"Prior conversation turns for follow-up context."},"conversation_steer":{"type":"string","maxLength":1000,"title":"Conversation Steer","description":"Optional per-conversation steering instruction.","default":""},"openrouter_api_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Openrouter Api Key"},"openrouter_model":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Openrouter Model"},"model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Model"},"provider_base_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Provider Base Url"},"ollama_base_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Ollama Base Url"},"agent_profile_id":{"anyOf":[{"type":"string","maxLength":160,"pattern":"^agent_[a-zA-Z0-9_-]{12,150}$"},{"type":"null"}],"title":"Agent Profile Id","description":"Private copied-agent recipe. Its research model and instructions are server-resolved."},"client_run_key":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Client Run Key","description":"Caller-supplied idempotency key, stored on the durable AgentRun this request creates. If your own request times out waiting for a response, the run may still be progressing server-side -- look it up with GET /agent/runs?client_run_key=... instead of restarting."},"max_tokens":{"anyOf":[{"type":"integer","maximum":16384.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens","description":"Max output tokens for the agent tool loop and skills."}},"type":"object","title":"AgentAnalyzeRequest","description":"Ask the analysis agent to work a live question end-to-end."},"AgentProfile":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"source_agent_id":{"type":"string","title":"Source Agent Id"},"model":{"type":"string","title":"Model"},"instruction":{"type":"string","title":"Instruction"},"version":{"type":"integer","minimum":1.0,"title":"Version"},"execution_mode":{"type":"string","const":"research_only","title":"Execution Mode"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","name","source_agent_id","model","instruction","version","execution_mode","created_at","updated_at"],"title":"AgentProfile","description":"A private, immutable copy of a public Foresea research setup."},"AgentProfileCopyRequest":{"properties":{"source_agent_id":{"type":"string","maxLength":120,"minLength":1,"pattern":"^[a-zA-Z0-9._-]+$","title":"Source Agent Id"},"name":{"anyOf":[{"type":"string","maxLength":80,"minLength":1},{"type":"null"}],"title":"Name"}},"type":"object","required":["source_agent_id"],"title":"AgentProfileCopyRequest"},"AgentProfileCopyResponse":{"properties":{"profile":{"$ref":"#/components/schemas/AgentProfile"},"created":{"type":"boolean","title":"Created"}},"type":"object","required":["profile","created"],"title":"AgentProfileCopyResponse"},"AgentProfileList":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/AgentProfile"},"type":"array","title":"Profiles"}},"type":"object","title":"AgentProfileList"},"AgentProfileReference":{"properties":{"id":{"type":"string","title":"Id"},"source_agent_id":{"type":"string","title":"Source Agent Id"},"model":{"type":"string","title":"Model"},"version":{"type":"integer","minimum":1.0,"title":"Version"},"execution_mode":{"type":"string","const":"research_only","title":"Execution Mode"}},"type":"object","required":["id","source_agent_id","model","version","execution_mode"],"title":"AgentProfileReference","description":"The profile snapshot that shaped one agent report, without private context."},"AgentReport":{"properties":{"question":{"type":"string","title":"Question"},"options":{"items":{"$ref":"#/components/schemas/OptionProb"},"type":"array","title":"Options","description":"Per-option forecasts, for an event link with several options."},"served_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Served Model Name","description":"Exact upstream model that served the final agent response, when reported by the provider."},"pipeline":{"items":{"type":"string"},"type":"array","title":"Pipeline","description":"Ordered steps the agent ran."},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"model_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Model Probability"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"stance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stance"},"recommendation":{"type":"string","title":"Recommendation","description":"`buy_yes`, `buy_no`, `hold`, or `no_market_price`."},"recommendation_detail":{"type":"string","title":"Recommendation Detail","default":""},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"question_type":{"type":"string","title":"Question Type","default":"binary"},"thesis":{"type":"string","title":"Thesis","default":""},"evidence_sources":{"items":{"$ref":"#/components/schemas/EvidenceSource"},"type":"array","title":"Evidence Sources"},"evidence_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Error"},"skills":{"items":{"$ref":"#/components/schemas/AgentSkillResult"},"type":"array","title":"Skills"},"grounding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grounding","description":"Track-record self-calibration note applied to the forecast."},"effort_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effort Tier","description":"How much analysis effort this question got: simple, standard, or deep."},"tool_transcript":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tool Transcript","description":"Tool calls + observations when the tool loop ran."},"tool_loop_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Loop Steps","description":"Tool-call steps the loop actually ran, when tool_loop=true."},"tool_loop_model_calls":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Loop Model Calls","description":"Logical orchestration turns, including finalization; excludes provider retries and nested tools."},"tool_loop_truncated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tool Loop Truncated","description":"True if the loop hit max_tool_steps without the model giving a final answer."},"tool_loop_tokens_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Loop Tokens Used","description":"Total estimated tokens consumed across turns."},"tool_loop_output_tokens_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Loop Output Tokens Used","description":"Estimated completion/output tokens consumed in the tool loop."},"agent_profile":{"anyOf":[{"$ref":"#/components/schemas/AgentProfileReference"},{"type":"null"}],"description":"Immutable private research recipe used for this report, when one was selected."},"live_trade_intent":{"anyOf":[{"$ref":"#/components/schemas/LiveTradeIntent"},{"type":"null"}],"description":"A non-executable research handoff for the authenticated user's live trade terminal."},"agent_run":{"anyOf":[{"$ref":"#/components/schemas/AgentRunReference"},{"type":"null"}],"description":"Private durable run record for this signed-in user's agent research."}},"type":"object","required":["question","recommendation"],"title":"AgentReport","description":"End-to-end analysis of a live question produced by the agent."},"AgentRunList":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/AgentRunSummary"},"type":"array","title":"Runs"}},"type":"object","title":"AgentRunList"},"AgentRunReference":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["running","completed","failed","interrupted"],"title":"Status"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","status","created_at","updated_at"],"title":"AgentRunReference","description":"The durable, private research run that produced an agent report."},"AgentRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["running","completed","failed","interrupted"],"title":"Status"},"title":{"type":"string","title":"Title"},"question":{"type":"string","title":"Question"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"},"recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommendation"},"model_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Model Probability"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"agent_profile":{"anyOf":[{"$ref":"#/components/schemas/AgentProfileReference"},{"type":"null"}]},"has_live_trade_intent":{"type":"boolean","title":"Has Live Trade Intent","default":false},"timeline":{"items":{"$ref":"#/components/schemas/AgentRunTimelineEvent"},"type":"array","title":"Timeline"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"client_run_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Run Key"},"request":{"additionalProperties":true,"type":"object","title":"Request"},"report":{"anyOf":[{"$ref":"#/components/schemas/AgentReport"},{"type":"null"}]},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps","description":"Tool-loop steps persisted as they happened, visible even for a still-running or crashed run."}},"type":"object","required":["id","status","title","question","created_at","updated_at"],"title":"AgentRunResponse","description":"Full private run record, including the safe input snapshot and report."},"AgentRunSummary":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["running","completed","failed","interrupted"],"title":"Status"},"title":{"type":"string","title":"Title"},"question":{"type":"string","title":"Question"},"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"},"recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommendation"},"model_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Model Probability"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"agent_profile":{"anyOf":[{"$ref":"#/components/schemas/AgentProfileReference"},{"type":"null"}]},"has_live_trade_intent":{"type":"boolean","title":"Has Live Trade Intent","default":false},"timeline":{"items":{"$ref":"#/components/schemas/AgentRunTimelineEvent"},"type":"array","title":"Timeline"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"client_run_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Run Key"}},"type":"object","required":["id","status","title","question","created_at","updated_at"],"title":"AgentRunSummary","description":"Operator-safe overview of a private, durable agent research run."},"AgentRunTimelineEvent":{"properties":{"at":{"type":"string","title":"At"},"phase":{"type":"string","title":"Phase"},"status":{"type":"string","enum":["running","completed","failed","interrupted"],"title":"Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["at","phase","status","detail"],"title":"AgentRunTimelineEvent"},"AgentScanResponse":{"properties":{"platform":{"type":"string","title":"Platform"},"scanned":{"type":"integer","title":"Scanned","description":"How many live markets were analysed."},"opportunities":{"items":{"$ref":"#/components/schemas/ScanOpportunity"},"type":"array","title":"Opportunities"}},"type":"object","required":["platform","scanned"],"title":"AgentScanResponse","description":"Mispriced markets surfaced by the scan agent, ranked by |edge|."},"AgentSkill":{"properties":{"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name","description":"Short skill name, e.g. 'Base rate check'."},"instruction":{"type":"string","maxLength":2000,"minLength":1,"title":"Instruction","description":"What this skill should analyse."}},"type":"object","required":["name","instruction"],"title":"AgentSkill","description":"A user-defined analysis step the agent runs over the question + evidence."},"AgentSkillResult":{"properties":{"name":{"type":"string","title":"Name"},"output":{"type":"string","title":"Output"},"verdict":{"anyOf":[{"$ref":"#/components/schemas/RedTeamVerdict"},{"type":"null"}],"description":"Structured classification of this skill's own argument, when available (Red team only, best-effort)."}},"type":"object","required":["name","output"],"title":"AgentSkillResult"},"AnalyticsAttributionSummary":{"properties":{"window_days":{"type":"integer","title":"Window Days","default":30},"authenticated_records":{"type":"integer","title":"Authenticated Records","default":0},"anonymous_records":{"type":"integer","title":"Anonymous Records","default":0},"authenticated_accounts":{"type":"integer","title":"Authenticated Accounts","default":0},"total_registered_users":{"type":"integer","title":"Total Registered Users","default":0}},"type":"object","title":"AnalyticsAttributionSummary","description":"Aggregate, privacy-preserving attribution for the last 30 days."},"AnalyticsEventRequest":{"properties":{"event_name":{"type":"string","maxLength":80,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Event Name"},"path":{"type":"string","maxLength":500,"title":"Path","default":"/"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["event_name"],"title":"AnalyticsEventRequest","description":"Anonymous or signed-in product event from the browser."},"AnalyticsEventSummary":{"properties":{"total_events":{"type":"integer","title":"Total Events"},"by_event":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Event"},"by_day":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Day"},"attribution":{"$ref":"#/components/schemas/AnalyticsAttributionSummary"},"events_24h":{"type":"integer","title":"Events 24H","default":0},"active_accounts_24h":{"type":"integer","title":"Active Accounts 24H","default":0},"active_accounts_7d":{"type":"integer","title":"Active Accounts 7D","default":0},"by_model":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Model"}},"type":"object","required":["total_events","by_event","by_day","attribution"],"title":"AnalyticsEventSummary"},"AnalyticsSummary":{"properties":{"total_visits":{"type":"integer","title":"Total Visits"},"unique_visitors":{"type":"integer","title":"Unique Visitors"},"by_day":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"By Day"},"attribution":{"$ref":"#/components/schemas/AnalyticsAttributionSummary"},"visits_24h":{"type":"integer","title":"Visits 24H","default":0}},"type":"object","required":["total_visits","unique_visitors","by_day","attribution"],"title":"AnalyticsSummary"},"AuthMeResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"picture":{"type":"string","title":"Picture"}},"type":"object","required":["user_id","email","name","picture"],"title":"AuthMeResponse","description":"Current user decoded from a session token."},"BatchForecastItem":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"question":{"type":"string","maxLength":800,"minLength":1,"title":"Question"},"market_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Platform"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"}},"type":"object","required":["question"],"title":"BatchForecastItem"},"BatchForecastRequest":{"properties":{"questions":{"items":{"$ref":"#/components/schemas/BatchForecastItem"},"type":"array","maxItems":20,"minItems":1,"title":"Questions"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","required":["questions"],"title":"BatchForecastRequest"},"BatchPredictRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PredictRequest"},"type":"array","maxItems":25,"minItems":1,"title":"Items","description":"List of forecasting requests (max 25)"},"concurrency_limit":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Concurrency Limit","description":"Max concurrent model calls","default":5}},"type":"object","required":["items"],"title":"BatchPredictRequest"},"BatchPredictResponse":{"properties":{"results":{"items":{"anyOf":[{"$ref":"#/components/schemas/PredictResponse"},{"type":"null"}]},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"},"successful":{"type":"integer","title":"Successful"},"failed":{"type":"integer","title":"Failed"},"elapsed_ms":{"type":"number","title":"Elapsed Ms"}},"type":"object","required":["results","total","successful","failed","elapsed_ms"],"title":"BatchPredictResponse"},"BatchQuoteItem":{"properties":{"platform":{"type":"string","title":"Platform"},"ident":{"type":"string","title":"Ident"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"close_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Time"},"order_book":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Order Book","description":"Present only when the ref included its extra id (Kalshi series_ticker / Polymarket token_id)."},"candles":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Candles","description":"Present only when the ref included its extra id."},"fetched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fetched At","description":"ISO 8601 UTC time the price/volume fields were fetched."},"age_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Age Seconds","description":"How old fetched_at is, in seconds -- the trust signal."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Set (with other fields empty) when this one ref failed."}},"type":"object","required":["platform","ident"],"title":"BatchQuoteItem"},"BatchQuoteResponse":{"properties":{"quotes":{"items":{"$ref":"#/components/schemas/BatchQuoteItem"},"type":"array","title":"Quotes"},"count":{"type":"integer","title":"Count"},"truncated":{"type":"boolean","title":"Truncated","description":"True if more than _MAX_BATCH_REFS refs were requested; the extras were dropped, not silently merged.","default":false}},"type":"object","required":["quotes","count"],"title":"BatchQuoteResponse"},"BenchmarkForecast":{"properties":{"probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Probability","description":"Forecast probability of YES (0–1)."},"outcome":{"type":"integer","maximum":1.0,"minimum":0.0,"title":"Outcome","description":"Realized outcome: 1 (YES) or 0 (NO)."},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability","description":"Market price at forecast time, for skill-vs-market."},"question":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Question"}},"type":"object","required":["probability","outcome"],"title":"BenchmarkForecast","description":"One resolved forecast to score: a probability and the realized outcome."},"BenchmarkRequest":{"properties":{"forecasts":{"items":{"$ref":"#/components/schemas/BenchmarkForecast"},"type":"array","maxItems":5000,"minItems":1,"title":"Forecasts"},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Label","description":"Optional name for this forecaster/run."}},"type":"object","required":["forecasts"],"title":"BenchmarkRequest","description":"Score any forecaster's resolved calls — an AI-forecaster benchmark."},"Body_extract_attachment_extract_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"Body_extract_attachment_extract_post"},"CancelTradingOrderRequest":{"properties":{"confirmation":{"type":"string","maxLength":80,"title":"Confirmation"}},"type":"object","required":["confirmation"],"title":"CancelTradingOrderRequest"},"DebateRequest":{"properties":{"question":{"type":"string","maxLength":1000,"minLength":1,"title":"Question"},"platform":{"type":"string","maxLength":80,"title":"Platform","default":"Market"},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability"},"evidence":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidence"},"resolution_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Criteria"}},"type":"object","required":["question"],"title":"DebateRequest"},"DeviceFinishRequest":{"properties":{"request":{"$ref":"#/components/schemas/PredictRequest"},"content":{"type":"string","maxLength":200000,"title":"Content","description":"The model's full reply."},"evidence_articles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":50,"title":"Evidence Articles"},"evidence_error":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Evidence Error"},"served_model_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Served Model Name","description":"The local model's name."}},"type":"object","required":["request","content"],"title":"DeviceFinishRequest","description":"A local model's reply to a prompt from /predict/device/prepare."},"DevicePrepareResponse":{"properties":{"messages":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Messages","description":"Chat messages to send to the local model."},"temperature":{"type":"number","title":"Temperature"},"max_tokens":{"type":"integer","title":"Max Tokens"},"request":{"additionalProperties":true,"type":"object","title":"Request","description":"The request after preparation (a pasted market link fills its market fields). Send it back unchanged to /predict/device/finish."},"evidence_articles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Evidence Articles"},"evidence_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Error"}},"type":"object","required":["messages","temperature","max_tokens","request"],"title":"DevicePrepareResponse","description":"The forecast prompt for a model on the user's device."},"EnsemblePredictRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":3,"title":"Question","description":"Forecasting question"},"models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Models","description":"Models to include in ensemble (defaults to top council models)"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Optional domain category for calibration weights"},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability","description":"Reference market price if known"},"market_platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Platform","description":"Reference market platform"},"member_forecasts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Member Forecasts","description":"Optional pre-computed member forecasts [{'model': '...', 'probability': 0.7, 'rationale': '...'}]"}},"type":"object","required":["question"],"title":"EnsemblePredictRequest"},"EnsemblePredictResponse":{"properties":{"question":{"type":"string","title":"Question"},"ensemble_probability":{"type":"number","title":"Ensemble Probability"},"confidence_interval":{"items":{"type":"number"},"type":"array","title":"Confidence Interval"},"dispersion_std":{"type":"number","title":"Dispersion Std"},"consensus_level":{"type":"string","title":"Consensus Level"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"member_contributions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Member Contributions"},"rationale_summary":{"type":"string","title":"Rationale Summary"}},"type":"object","required":["question","ensemble_probability","confidence_interval","dispersion_std","consensus_level","member_contributions","rationale_summary"],"title":"EnsemblePredictResponse"},"EvidenceSource":{"properties":{"source":{"type":"string","title":"Source","description":"Publisher name."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Article headline."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Article URL."},"publish_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish Date","description":"ISO 8601 publish date."},"relevance_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Relevance Score","description":"Relevance to the question (0–1)."}},"type":"object","required":["source"],"title":"EvidenceSource","description":"A deduplicated citation drawn from the evidence articles."},"ExplainShiftRequest":{"properties":{"platform":{"type":"string","maxLength":20,"title":"Platform","description":"Polymarket or Kalshi"},"ident":{"type":"string","maxLength":200,"title":"Ident","description":"Market identifier"}},"type":"object","required":["platform","ident"],"title":"ExplainShiftRequest"},"FavoriteList":{"properties":{"favorites":{"items":{"$ref":"#/components/schemas/FavoriteMarket"},"type":"array","title":"Favorites"}},"type":"object","required":["favorites"],"title":"FavoriteList"},"FavoriteMarket":{"properties":{"key":{"type":"string","maxLength":160,"minLength":1,"pattern":"^[A-Za-z0-9:_\\-./]+$","title":"Key"},"question":{"type":"string","maxLength":500,"title":"Question","default":""},"platform":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Platform"},"ident":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Ident"},"market_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Market Url"},"model_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Model Probability"},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability"},"notify":{"type":"boolean","title":"Notify","default":false},"createdAt":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Createdat"},"updatedAt":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Updatedat"}},"type":"object","required":["key"],"title":"FavoriteMarket","description":"A market or question a signed-in user has favourited to watch.\n\n`key` identifies the favourite (`{platform}:{ident}` for a market, or a\nclient-chosen slug for a bare question). `notify` opts the favourite into the\nperiodic email digest (`scripts/favorites_digest.py`)."},"FeedbackRequest":{"properties":{"message":{"type":"string","maxLength":4000,"minLength":1,"title":"Message"},"rating":{"anyOf":[{"type":"integer","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Rating"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Email"},"page":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Page"}},"type":"object","required":["message"],"title":"FeedbackRequest","description":"User-submitted feedback."},"GitHubAuthRequest":{"properties":{"code":{"type":"string","maxLength":512,"title":"Code"},"redirect_uri":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Redirect Uri"}},"type":"object","required":["code"],"title":"GitHubAuthRequest","description":"GitHub OAuth authorization code returned to the browser."},"GoogleAuthRequest":{"properties":{"credential":{"type":"string","maxLength":8192,"title":"Credential"}},"type":"object","required":["credential"],"title":"GoogleAuthRequest","description":"Google One-Tap credential submitted by the browser."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LiveTradeIntent":{"properties":{"platform":{"type":"string","title":"Platform"},"ident":{"type":"string","title":"Ident"},"action":{"type":"string","title":"Action","default":"buy"},"outcome":{"type":"string","title":"Outcome"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"},"model_probability":{"type":"number","title":"Model Probability"},"market_probability":{"type":"number","title":"Market Probability"},"edge":{"type":"number","title":"Edge"},"recommendation":{"type":"string","title":"Recommendation"}},"type":"object","required":["platform","ident","outcome","model_probability","market_probability","edge","recommendation"],"title":"LiveTradeIntent","description":"A chat-to-terminal handoff for a human-reviewed live order.\n\nThis is deliberately not an executable order: it contains no size or limit\nprice, and the trading terminal must still fetch a fresh venue quote, create\na durable `/trading/runs` record, and receive an explicit user confirmation\nbefore an exchange order can be submitted."},"LoginRequest":{"properties":{"email":{"type":"string","maxLength":254,"title":"Email"},"password":{"type":"string","maxLength":128,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest","description":"Email + password sign-in submitted by the browser."},"MandateApprovalRequest":{"properties":{"expected_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Expected Hash"},"idempotency_key":{"type":"string","maxLength":128,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["expected_hash","idempotency_key"],"title":"MandateApprovalRequest"},"MandateDraftRequest":{"properties":{"client_request_id":{"type":"string","maxLength":128,"minLength":8,"title":"Client Request Id"},"account_scope_id":{"type":"string","maxLength":256,"minLength":1,"title":"Account Scope Id"},"strategy_version":{"type":"string","maxLength":128,"minLength":1,"title":"Strategy Version"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"live":{"type":"boolean","title":"Live","default":false},"allowed_actions":{"items":{"type":"string"},"type":"array","title":"Allowed Actions","default":["BUY_YES","BUY_NO"]},"max_capital":{"type":"string","title":"Max Capital","default":"0"},"max_loss":{"type":"string","title":"Max Loss","default":"0"},"max_model_usd":{"type":"string","title":"Max Model Usd","default":"0"},"max_model_tokens":{"type":"integer","minimum":0.0,"title":"Max Model Tokens","default":0},"max_model_requests":{"type":"integer","minimum":0.0,"title":"Max Model Requests","default":0}},"additionalProperties":false,"type":"object","required":["client_request_id","account_scope_id","strategy_version","expires_at"],"title":"MandateDraftRequest"},"MandateRevisionRequest":{"properties":{"client_request_id":{"type":"string","maxLength":128,"minLength":8,"title":"Client Request Id"},"account_scope_id":{"type":"string","maxLength":256,"minLength":1,"title":"Account Scope Id"},"strategy_version":{"type":"string","maxLength":128,"minLength":1,"title":"Strategy Version"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"live":{"type":"boolean","title":"Live","default":false},"allowed_actions":{"items":{"type":"string"},"type":"array","title":"Allowed Actions","default":["BUY_YES","BUY_NO"]},"max_capital":{"type":"string","title":"Max Capital","default":"0"},"max_loss":{"type":"string","title":"Max Loss","default":"0"},"max_model_usd":{"type":"string","title":"Max Model Usd","default":"0"},"max_model_tokens":{"type":"integer","minimum":0.0,"title":"Max Model Tokens","default":0},"max_model_requests":{"type":"integer","minimum":0.0,"title":"Max Model Requests","default":0}},"additionalProperties":false,"type":"object","required":["client_request_id","account_scope_id","strategy_version","expires_at"],"title":"MandateRevisionRequest"},"MandateTransitionRequest":{"properties":{"idempotency_key":{"type":"string","maxLength":128,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"MandateTransitionRequest"},"MarkEnrolledRequest":{"properties":{"idents":{"items":{"type":"string"},"type":"array","maxItems":500,"title":"Idents"}},"type":"object","title":"MarkEnrolledRequest","description":"Idents (``\"platform:ident\"``) the Action has now started tracking."},"MarketAnalysis":{"properties":{"platform":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform","description":"Prediction market venue supplied by the caller."},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url","description":"Prediction market URL supplied by the caller."},"outcome":{"type":"string","title":"Outcome","description":"Outcome being compared against the market price."},"market_probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Market Probability","description":"Market-implied probability for the outcome."},"model_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Model Probability","description":"Foresea probability for the same outcome (recalibrated from the live track record when warranted)."},"model_probability_raw":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Model Probability Raw","description":"Raw model probability before live calibration (only set when calibration was applied)."},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge","description":"Model probability minus market probability."},"stance":{"type":"string","title":"Stance","description":"`model_above_market`, `model_below_market`, `in_line`, or `not_comparable`."},"summary":{"type":"string","title":"Summary","description":"Short human-readable market comparison."}},"type":"object","required":["outcome","market_probability","stance","summary"],"title":"MarketAnalysis","description":"Deterministic comparison between Foresea's forecast and a market price."},"MarketForecastRequest":{"properties":{"question":{"type":"string","maxLength":600,"title":"Question"},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability"},"market_platform":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Market Platform"},"market_ident":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Market Ident"},"market_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Market Url"}},"type":"object","required":["question"],"title":"MarketForecastRequest","description":"Forecast one market immediately (e.g. just-watchlisted)."},"MarketOption":{"properties":{"label":{"type":"string","title":"Label","description":"Outcome label, e.g. 'Yes' or 'No'."},"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability","description":"Market-implied probability (0..1), or null when unpriced."}},"type":"object","required":["label"],"title":"MarketOption","description":"One outcome of a fetched prediction market and its implied probability."},"MarketQuote":{"properties":{"platform":{"type":"string","title":"Platform","description":"Venue: 'Polymarket' or 'Kalshi'."},"ident":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ident","description":"Venue market identifier."},"question":{"type":"string","title":"Question","description":"Market question/title.","default":""},"market_url":{"type":"string","title":"Market Url","description":"Canonical market URL.","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Venue-provided background context."},"resolution_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Criteria","description":"Complete venue rules used to resolve the market."},"venue_news_articles":{"items":{"$ref":"#/components/schemas/NewsArticle"},"type":"array","title":"Venue News Articles","description":"Articles supplied by the prediction-market venue."},"outcome":{"type":"string","title":"Outcome","description":"Primary outcome (prefers 'Yes').","default":""},"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability","description":"Market-implied probability for `outcome` (0..1)."},"outcomes":{"items":{"$ref":"#/components/schemas/MarketOption"},"type":"array","title":"Outcomes","description":"All outcomes with their probabilities."},"close_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Time"},"created_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Time"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"liquidity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidity"},"price_change_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Change 24H"},"price_change_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Change 7D"},"yes_bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Yes Bid"},"yes_ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Yes Ask"},"last_trade_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Trade Price"},"resolution_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Source"},"no_sub_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"No Sub Title"},"expected_expiration_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Expiration Time"},"floor_strike":{"anyOf":[{},{"type":"null"}],"title":"Floor Strike"},"cap_strike":{"anyOf":[{},{"type":"null"}],"title":"Cap Strike"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"fetched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fetched At","description":"ISO 8601 UTC time this quote was actually fetched from the venue (not when it was served from cache)."},"series_ticker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Series Ticker","description":"Kalshi series ticker -- the 'extra' id /market/batch needs for candlesticks."},"token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id","description":"Polymarket YES-outcome CLOB token id -- the 'extra' id /market/batch needs for order book/price history."},"event_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Title","description":"For an event link (one market per option): the event's title."},"event_exclusive":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Event Exclusive","description":"For an event link: whether exactly one option can win."},"event_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Event Options","description":"For an event link: each open option's `label`, market `question` and `probability`; the quoted market has `quoted` set."}},"type":"object","required":["platform"],"title":"MarketQuote","description":"A live prediction-market quote, normalised for use with `/predict`."},"NewsArticle":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Title","description":"Article headline."},"summary":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Summary","description":"Short human-written summary."},"summary_llm":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Summary Llm","description":"LLM-generated summary."},"text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Text","description":"Full article body text."},"source":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Source","description":"Publisher name (e.g. Reuters)."},"credibility":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Credibility","description":"Credibility score breakdown."},"frs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Frs","description":"Future-Resolution Statement metadata."},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url","description":"Canonical article URL."},"authors":{"anyOf":[{},{"type":"null"}],"title":"Authors","description":"Author name(s)."},"publish_date":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Publish Date","description":"ISO 8601 publish timestamp."},"keywords":{"anyOf":[{},{"type":"null"}],"title":"Keywords","description":"Extracted keywords."},"relevance_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Relevance Score","description":"Cosine similarity to the question (0–1)."},"search_query":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Search Query","description":"Query used to retrieve this article."}},"type":"object","title":"NewsArticle","description":"A news article passed as evidence context for the prediction.","example":{"publish_date":"2025-01-15T10:30:00Z","relevance_score":0.91,"source":"Reuters","summary":"Federal Reserve officials signaled a more cautious approach to rate cuts...","title":"Fed signals rate cuts may slow in 2025","url":"https://reuters.com/example"}},"OpeningConfirmation":{"properties":{"review_hash":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Review Hash"},"evidence_ref":{"type":"string","pattern":"^[0-9a-f]{64}$","title":"Evidence Ref"},"confirmation":{"type":"string","const":"REGISTER ACCOUNT OPENING","title":"Confirmation"}},"additionalProperties":false,"type":"object","required":["review_hash","evidence_ref","confirmation"],"title":"OpeningConfirmation"},"OperatorCancelRequest":{"properties":{"idempotency_key":{"type":"string","maxLength":128,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["idempotency_key"],"title":"OperatorCancelRequest"},"OperatorPauseRequest":{"properties":{"paused":{"type":"boolean","title":"Paused"},"reason":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:@-]*$","title":"Reason"},"idempotency_key":{"type":"string","maxLength":128,"minLength":8,"title":"Idempotency Key"}},"additionalProperties":false,"type":"object","required":["paused","reason","idempotency_key"],"title":"OperatorPauseRequest"},"OptionProb":{"properties":{"label":{"type":"string","title":"Label","description":"The option text."},"probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Probability","description":"Probability assigned to this option (0–1)."}},"type":"object","required":["label","probability"],"title":"OptionProb","description":"A single option and its probability in a multiple-choice forecast."},"PersonalLedgerEntry":{"properties":{"id":{"type":"string","maxLength":120,"minLength":1,"pattern":"^[A-Za-z0-9:_\\-]+$","title":"Id"},"conversation_id":{"type":"string","maxLength":120,"title":"Conversation Id","default":""},"message_id":{"type":"string","maxLength":120,"title":"Message Id","default":""},"question":{"type":"string","maxLength":800,"minLength":1,"title":"Question"},"predicted_answer":{"type":"string","maxLength":120,"title":"Predicted Answer","default":""},"probability":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Probability"},"rationale":{"type":"string","maxLength":8000,"title":"Rationale","default":""},"model":{"type":"string","maxLength":160,"title":"Model","default":""},"createdAt":{"type":"integer","minimum":0.0,"title":"Createdat"},"user_verdict":{"anyOf":[{"type":"string","enum":["correct","wrong"]},{"type":"null"}],"title":"User Verdict"},"judgedAt":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Judgedat"}},"type":"object","required":["id","question","probability","createdAt"],"title":"PersonalLedgerEntry","description":"One forecast a signed-in user explicitly saved from a chat response."},"PersonalLedgerList":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/PersonalLedgerEntry"},"type":"array","title":"Entries"}},"type":"object","required":["entries"],"title":"PersonalLedgerList"},"PersonalLedgerVerdict":{"properties":{"verdict":{"type":"string","enum":["correct","wrong"],"title":"Verdict"}},"type":"object","required":["verdict"],"title":"PersonalLedgerVerdict","description":"A user's explicit assessment of one of their saved forecasts."},"PortfolioOptimizeRequest":{"properties":{"bankroll_usd":{"type":"number","minimum":10.0,"title":"Bankroll Usd","default":1000.0},"kelly_fraction":{"type":"number","maximum":1.0,"minimum":0.05,"title":"Kelly Fraction","default":0.25},"min_edge":{"type":"number","maximum":0.99,"minimum":0.01,"title":"Min Edge","default":0.05},"min_credibility":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Credibility","default":0.6},"opportunities":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Opportunities"}},"type":"object","title":"PortfolioOptimizeRequest"},"PredictRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question","description":"The forecasting question to evaluate. It should ask about a future or otherwise resolvable event, option, quantity, or date.","examples":["Will the Federal Reserve cut interest rates at least once before the end of 2025?","Who will win the 2026 Formula 1 drivers championship?","What will US CPI inflation be in December 2026?"]},"description":{"type":"string","maxLength":4000,"title":"Description","description":"Extended background context that clarifies what the question is asking.","default":""},"resolution_criteria":{"type":"string","maxLength":12000,"title":"Resolution Criteria","description":"Full venue conditions and measurement source used to resolve the forecast.","default":""},"categories":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Categories","description":"Topic tags (e.g. `['Economics', 'United States']`)."},"news_articles":{"items":{"$ref":"#/components/schemas/NewsArticle"},"type":"array","maxItems":20,"title":"News Articles","description":"Pre-fetched venue or caller news articles to preserve as evidence. When `attach_evidence` is true, fresh retrieved news is merged with them."},"variant":{"type":"string","maxLength":100,"title":"Variant","description":"Prompt variant that controls the reasoning instruction style. See the variant table in the Overview section.","default":"variant0_neutral_baseline","examples":["variant0_neutral_baseline","variant3_reasoning_type"]},"attach_evidence":{"type":"boolean","title":"Attach Evidence","description":"If `true`, fetch live evidence and merge it with any supplied articles.","default":true},"evidence_top_k":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Evidence Top K","description":"Maximum number of evidence articles to retrieve (1–100).","default":20},"evidence_detail":{"type":"string","pattern":"^(summary|full)$","title":"Evidence Detail","description":"Evidence detail level in the model prompt. Use `summary` for scheduled multi-model runs to keep prompts bounded; default `full` preserves the interactive API behaviour.","default":"full"},"created_time":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Created Time","description":"ISO 8601 question creation time."},"publish_time":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Publish Time","description":"ISO 8601 question publish time."},"resolve_time":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Resolve Time","description":"ISO 8601 resolution deadline."},"days_open":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":0.0},{"type":"null"}],"title":"Days Open","description":"Days the question has been open."},"history":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","maxItems":12,"title":"History","description":"Prior conversation turns for multi-turn context, oldest first. Each item is `{\"role\": \"user\"|\"assistant\", \"content\": \"...\"}`."},"conversation_steer":{"type":"string","maxLength":1000,"title":"Conversation Steer","description":"Optional per-conversation steering instruction for tone, emphasis, or analytical stance. It cannot override safety rules or response contracts.","default":""},"question_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question Type","description":"Question type: `binary`, `multiple_choice`, `numeric`, or `date`. Set this explicitly for API clients; auto-detected from the question when omitted."},"options":{"items":{"type":"string"},"type":"array","maxItems":12,"title":"Options","description":"Candidate answers for `multiple_choice` questions (optional; the model can infer them)."},"market_platform":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Market Platform","description":"Prediction market venue, e.g. `Polymarket`, `Kalshi`, `Manifold`, or `Metaculus`."},"market_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Market Url","description":"URL for the prediction market being analyzed. Must start with `http://` or `https://`."},"market_outcome":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Market Outcome","description":"Outcome whose market-implied probability is provided. Defaults to `Yes` for binary markets; set this to `No` or to a multiple-choice option label when needed."},"market_ident":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Market Ident","description":"Venue market id (Polymarket slug / Kalshi ticker). Lets Foresea fetch live odds when `market_probability` is omitted."},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability","description":"Current market-implied probability for `market_outcome`. Use 0-1, or pass a percentage from 0-100 and Foresea will normalize it. When omitted but the market is identifiable (`market_url` or `market_platform`+`market_ident`), Foresea fetches the current live odds."},"market_volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Volume","description":"24-hour trading volume in USD. Populated automatically from live odds when the market is identifiable."},"market_liquidity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Liquidity","description":"Total open interest / liquidity in USD. Populated automatically from live odds."},"market_price_change_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Price Change 24H","description":"Price change in the last 24 hours (in probability points, -1..1). Populated automatically from live odds."},"market_bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Bid","description":"Current best bid (YES) in probability units (0..1). Kalshi only; Polymarket uses the mid price."},"market_ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Ask","description":"Current best ask (YES) in probability units (0..1). Kalshi only."},"market_last_trade_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Last Trade Price","description":"Last actual trade price (0..1). More reliable than resting bid/ask in thin markets. Populated automatically."},"market_price_change_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Price Change 7D","description":"7-day price change in probability points (-1..1). Reveals slow drift that 24h misses. Populated automatically."},"market_resolution_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Resolution Source","description":"Who resolves the market (e.g. UMA oracle, Kalshi team). Affects how much to trust the market price."},"market_no_sub_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market No Sub Title","description":"What the NO outcome represents (Kalshi). Useful when the question wording is ambiguous."},"market_expected_expiration_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Expected Expiration Time","description":"When the venue expects to settle (Kalshi). May differ from trading close date."},"market_floor_strike":{"anyOf":[{},{"type":"null"}],"title":"Market Floor Strike","description":"Lower bound of resolution range for scalar Kalshi markets."},"market_cap_strike":{"anyOf":[{},{"type":"null"}],"title":"Market Cap Strike","description":"Upper bound of resolution range for scalar Kalshi markets."},"market_price_history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Market Price History","description":"Recent price points for this market, newest first. Each entry: {ts: ISO timestamp, probability: float 0..1, volume?: float, liquidity?: float, bid?: float, ask?: float}. Up to 8 entries. Shown to the model as market-trajectory context so it can detect price and tradability changes that the current price alone would hide."},"forecast_history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Forecast History","description":"Prior Foresea forecast snapshots for the same market, newest first. Used by scheduled re-forecasts so repeat forecasts are stateful updates, not independent stateless calls."},"openrouter_api_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Openrouter Api Key","description":"User-supplied OpenRouter API key. When set, this request is routed through OpenRouter using `openrouter_model` instead of the server's default provider."},"openrouter_model":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Openrouter Model","description":"OpenRouter model ID (e.g. `openai/gpt-4o`, `anthropic/claude-3.5-sonnet`)."},"model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Model","description":"Optional alternate server-hosted model to forecast with, from the SCADS allowlist (for example `gpt-oss-120b`, `scads-alias-reasoning`, `kimi-k2.7-code`). Uses the server's own key — no BYOK needed. Powers the multi-model paper-trading comparison."},"provider_base_url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Provider Base Url","description":"Optional OpenAI-compatible chat-completions endpoint (e.g. `https://api.openai.com/v1/chat/completions`). When set with `openrouter_api_key` + `openrouter_model`, the request goes to your own endpoint instead of OpenRouter. Must be public HTTPS."},"chat_mode":{"type":"boolean","title":"Chat Mode","description":"When `true`, skips the forecast output template entirely. The model responds in plain natural language with no structured JSON.","default":true},"effort_tier":{"anyOf":[{"type":"string","enum":["simple","standard","deep"]},{"type":"null"}],"title":"Effort Tier","description":"How much reasoning effort the model call uses, when the provider supports it (best-effort; unsupported providers ignore it). Set explicitly to override; left unset, no reasoning-effort hint is sent."},"max_tokens":{"anyOf":[{"type":"integer","maximum":4096.0,"minimum":64.0},{"type":"null"}],"title":"Max Tokens","description":"Optional per-request generation cap. The server still clamps this to its configured model limit."},"ollama_base_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Ollama Base Url","description":"Base URL of an Ollama instance, e.g. `http://localhost:11434`. No API key required. Cloud-metadata hosts are blocked; for foresea.ink the instance must be reachable from the server."}},"type":"object","required":["question"],"title":"PredictRequest","description":"Input payload for a single forecasting prediction.","examples":[{"market_platform":"Polymarket","market_probability":0.54,"question":"Will the Federal Reserve cut interest rates at least once before the end of 2025?","question_type":"binary"},{"options":["Max Verstappen","Lando Norris","Charles Leclerc","Lewis Hamilton","Other"],"question":"Who will win the 2026 Formula 1 drivers championship?","question_type":"multiple_choice"},{"categories":["Economics","United States"],"question":"What will US CPI inflation be in December 2026?","question_type":"numeric","resolution_criteria":"Use the year-over-year CPI-U inflation rate for December 2026."}]},"PredictResponse":{"properties":{"question_type":{"type":"string","title":"Question Type","description":"Detected type: `binary`, `multiple_choice`, `numeric`, or `date`.","default":"binary"},"predicted_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicted Answer","description":"Headline answer: Yes/No, the top option, or the median estimate."},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence","description":"Confidence in the headline answer (binary/MC). Null for numeric."},"model_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Model Probability","description":"Explicit model probability for conversational forecasts, when one was provided."},"options":{"items":{"$ref":"#/components/schemas/OptionProb"},"type":"array","title":"Options","description":"Per-option probabilities for `multiple_choice`."},"range_forecast":{"anyOf":[{"$ref":"#/components/schemas/RangeForecast"},{"type":"null"}],"description":"p10/p50/p90 estimate for `numeric` and `date`."},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale","description":"2–4 sentence explanation of the prediction."},"model_rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Rationale","description":"Raw rationale as returned by the model (may differ from `rationale` after post-processing)."},"variant":{"type":"string","title":"Variant","description":"Prompt variant used for this prediction."},"model_key":{"type":"string","title":"Model Key","description":"Model identifier (e.g. `gpt-oss-120b`)."},"served_model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Served Model Name","description":"Exact upstream model name that served the response, if reported by the provider."},"evidence_sources":{"items":{"$ref":"#/components/schemas/EvidenceSource"},"type":"array","title":"Evidence Sources","description":"Deduplicated citations used as evidence."},"evidence_articles":{"items":{"$ref":"#/components/schemas/NewsArticle"},"type":"array","title":"Evidence Articles","description":"Full evidence articles passed to the model."},"evidence_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Error","description":"Non-null if evidence retrieval failed (prediction still returned)."},"market_analysis":{"anyOf":[{"$ref":"#/components/schemas/MarketAnalysis"},{"type":"null"}],"description":"Optional comparison against a supplied prediction-market probability."},"complexity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Complexity","description":"Model's own self-reported difficulty for this question: `low` or `high`."},"bull_factors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Bull Factors","description":"Decomposed factors favoring the YES / upside outcome."},"bear_factors":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Bear Factors","description":"Decomposed counter-factors favoring the NO / downside outcome."},"key_catalysts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Key Catalysts","description":"Key upcoming events/dates that could trigger thesis revision."}},"type":"object","required":["variant","model_key"],"title":"PredictResponse","description":"Prediction result for a single forecasting question.","example":{"confidence":0.72,"evidence_articles":[],"evidence_sources":[{"publish_date":"2025-01-15T10:30:00Z","relevance_score":0.91,"source":"Reuters","title":"Fed signals rate cuts may slow in 2025","url":"https://reuters.com/example"}],"market_analysis":{"edge":0.18,"market_probability":0.54,"market_url":"https://polymarket.com/event/example","model_probability":0.72,"outcome":"Yes","platform":"Polymarket","stance":"model_above_market","summary":"Foresea is 18 percentage points above the market on Yes."},"model_key":"gpt-oss-120b","model_rationale":"Current Fed guidance suggests rates will remain elevated through mid-2025.","options":[],"predicted_answer":"No","question_type":"binary","rationale":"Current Fed guidance suggests rates will remain elevated through mid-2025. Recent inflation data remains above the 2% target, reducing the likelihood of a cut in the near term. However, slowing economic growth introduces some downside risk that could prompt a cut by year-end.","served_model_name":"openai/gpt-oss-120b","variant":"variant0_neutral_baseline"}},"RadarMarket":{"properties":{"id":{"type":"string","title":"Id"},"ident":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ident"},"platform":{"type":"string","title":"Platform","default":""},"question":{"type":"string","title":"Question"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"resolution_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution Criteria"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"model_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Model Probability"},"foresea_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Foresea Probability"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"abs_edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Abs Edge"},"side":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Side"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"horizon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Horizon"},"reason":{"type":"string","title":"Reason","default":""},"credibility_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Credibility Score"},"credibility_grade":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credibility Grade"},"credibility_flags":{"items":{"type":"string"},"type":"array","title":"Credibility Flags"},"is_credible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Credible"},"weather_brief":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Weather Brief"},"bracket_probability":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bracket Probability"},"forecasted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forecasted At"}},"type":"object","required":["id","question"],"title":"RadarMarket"},"RadarResponse":{"properties":{"updated_at":{"type":"string","title":"Updated At"},"markets":{"items":{"$ref":"#/components/schemas/RadarMarket"},"type":"array","title":"Markets"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"forecasted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forecasted At"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"edge_board":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edge Board"},"models_comparison":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Models Comparison"},"paper_pnl":{"anyOf":[{},{"type":"null"}],"title":"Paper Pnl"},"primary_paper_pnl":{"anyOf":[{},{"type":"null"}],"title":"Primary Paper Pnl"},"mark_to_market_account":{"anyOf":[{},{"type":"null"}],"title":"Mark To Market Account"},"mark_to_market_by_model":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Mark To Market By Model"},"quarter_kelly_by_model":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Quarter Kelly By Model"},"growth_1pct_by_model":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Growth 1Pct By Model"},"growth_2pct_by_model":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Growth 2Pct By Model"},"mark_to_market_cycle_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mark To Market Cycle Minutes"},"lead_lag":{"anyOf":[{},{"type":"null"}],"title":"Lead Lag"},"calibration":{"anyOf":[{},{"type":"null"}],"title":"Calibration"},"resolved_log":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Resolved Log"},"freshness":{"additionalProperties":true,"type":"object","title":"Freshness"},"n_snapshots_resolved":{"type":"integer","title":"N Snapshots Resolved","default":0},"n_markets_resolved":{"type":"integer","title":"N Markets Resolved","default":0},"primary_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Model"},"primary_n_snapshots_resolved":{"type":"integer","title":"Primary N Snapshots Resolved","default":0},"primary_n_markets_resolved":{"type":"integer","title":"Primary N Markets Resolved","default":0},"n_markets_open":{"type":"integer","title":"N Markets Open","default":0}},"type":"object","required":["updated_at","markets"],"title":"RadarResponse"},"RagIngestRequest":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}],"title":"Text","description":"Raw text to ingest."},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url","description":"URL to fetch and ingest."},"title":{"type":"string","maxLength":300,"title":"Title","default":""},"namespace":{"type":"string","maxLength":40,"title":"Namespace","description":"Corpus: 'kb', 'evidence', or 'forecasts'.","default":"kb"}},"type":"object","title":"RagIngestRequest","description":"Add a document to the user's knowledge base."},"RagSearchResult":{"properties":{"text":{"type":"string","title":"Text","default":""},"title":{"type":"string","title":"Title","default":""},"url":{"type":"string","title":"Url","default":""},"source":{"type":"string","title":"Source","default":""},"score":{"type":"number","title":"Score","default":0.0}},"type":"object","title":"RagSearchResult"},"RangeForecast":{"properties":{"p10":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"P10","description":"10th-percentile (low) estimate."},"p50":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"P50","description":"50th-percentile (median) estimate."},"p90":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"P90","description":"90th-percentile (high) estimate."},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit","description":"Unit of the estimate, e.g. 'USD', '%', 'people'."}},"type":"object","title":"RangeForecast","description":"A numeric or date estimate expressed as percentile bounds."},"RecentAnalyticsEvent":{"properties":{"event_name":{"type":"string","title":"Event Name"},"path":{"type":"string","title":"Path","default":""},"attribution":{"type":"string","title":"Attribution","default":"anonymous"},"ts":{"type":"string","title":"Ts","default":""},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["event_name"],"title":"RecentAnalyticsEvent"},"RecentAnalyticsEventsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/RecentAnalyticsEvent"},"type":"array","title":"Events"}},"type":"object","title":"RecentAnalyticsEventsResponse"},"RedTeamVerdict":{"properties":{"credible":{"type":"boolean","title":"Credible","description":"Whether the argument is well-supported by a real mechanism or evidence, not just contrarian restating."},"severity":{"type":"string","enum":["low","medium","high"],"title":"Severity","description":"How much this argument should weigh against the forecast if credible."}},"type":"object","required":["credible","severity"],"title":"RedTeamVerdict","description":"Structured classification of a Red team skill's own argument, from a\nseparate follow-up call. Observational only -- nothing in the pipeline\nreads this to gate or adjust the forecast."},"RegisterRequest":{"properties":{"email":{"type":"string","maxLength":254,"title":"Email","description":"Account email address."},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password","description":"At least 8 characters."},"name":{"type":"string","maxLength":120,"title":"Name","description":"Optional display name.","default":""}},"type":"object","required":["email","password"],"title":"RegisterRequest","description":"Email + password sign-up submitted by the browser."},"RegisteredUserItem":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email","default":""},"name":{"type":"string","title":"Name","default":""},"picture":{"type":"string","title":"Picture","default":""},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"last_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login"}},"type":"object","required":["user_id"],"title":"RegisteredUserItem"},"RegisteredUsersResponse":{"properties":{"total":{"type":"integer","title":"Total","default":0},"users":{"items":{"$ref":"#/components/schemas/RegisteredUserItem"},"type":"array","title":"Users"}},"type":"object","title":"RegisteredUsersResponse"},"SaveUserModelProviderRequest":{"properties":{"api_key":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Api Key"},"default_model":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Default Model"},"custom_base_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Custom Base Url"}},"type":"object","title":"SaveUserModelProviderRequest"},"ScanOpportunity":{"properties":{"question":{"type":"string","title":"Question"},"market_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Market Url"},"outcome":{"type":"string","title":"Outcome","default":"Yes"},"market_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Market Probability"},"model_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Model Probability"},"edge":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Edge"},"stance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stance"},"recommendation":{"type":"string","title":"Recommendation"}},"type":"object","required":["question","recommendation"],"title":"ScanOpportunity","description":"One mispriced market found by the scan agent."},"SessionResponse":{"properties":{"token":{"type":"string","title":"Token"},"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"picture":{"type":"string","title":"Picture"}},"type":"object","required":["token","user_id","email","name","picture"],"title":"SessionResponse","description":"Issued after a successful Google sign-in."},"SharedForecastRequest":{"properties":{"question":{"type":"string","maxLength":800,"minLength":1,"title":"Question"},"question_type":{"type":"string","maxLength":40,"title":"Question Type","default":"binary"},"predicted_answer":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Predicted Answer"},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"rationale":{"type":"string","maxLength":5000,"title":"Rationale","default":""},"model_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Model Probability"},"market_probability":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Market Probability"},"market_platform":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Market Platform"},"market_url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Market Url"},"sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":12,"title":"Sources"},"model":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Model"},"variant":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Variant"}},"type":"object","required":["question"],"title":"SharedForecastRequest"},"SharedForecastResponse":{"properties":{"share_id":{"type":"string","title":"Share Id"},"url":{"type":"string","title":"Url"}},"type":"object","required":["share_id","url"],"title":"SharedForecastResponse"},"TestUserModelProviderRequest":{"properties":{"api_key":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Api Key"},"model_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Model Name"},"custom_base_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Custom Base Url"}},"type":"object","title":"TestUserModelProviderRequest"},"TestUserModelProviderResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Ms"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"sample_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sample Response"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ok"],"title":"TestUserModelProviderResponse"},"TradeOrderPreviewResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"platform":{"type":"string","title":"Platform"},"would_execute":{"type":"boolean","title":"Would Execute"},"requires_confirmation":{"type":"boolean","title":"Requires Confirmation"},"confirmation_phrase":{"type":"string","title":"Confirmation Phrase"},"trading_enabled":{"type":"boolean","title":"Trading Enabled"},"max_order_notional":{"type":"number","title":"Max Order Notional"},"estimated_notional":{"type":"number","title":"Estimated Notional"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"normalized_order":{"additionalProperties":true,"type":"object","title":"Normalized Order"}},"type":"object","required":["ok","platform","would_execute","requires_confirmation","confirmation_phrase","trading_enabled","max_order_notional","estimated_notional","normalized_order"],"title":"TradeOrderPreviewResponse"},"TradeOrderRequest":{"properties":{"platform":{"type":"string","maxLength":20,"title":"Platform","description":"`kalshi` or `polymarket`."},"action":{"type":"string","maxLength":10,"title":"Action","description":"`buy` or `sell`.","default":"buy"},"outcome":{"type":"string","maxLength":10,"title":"Outcome","description":"Outcome side: `yes` or `no`.","default":"yes"},"order_type":{"type":"string","maxLength":20,"title":"Order Type","description":"`limit` or `market`.","default":"limit"},"price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Price","description":"Limit price, or worst acceptable price for market/IOC-style orders."},"quantity":{"type":"number","exclusiveMinimum":0.0,"title":"Quantity","description":"Contracts/shares. For Polymarket market-buy, max_cost may define spend."},"max_cost":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Cost","description":"Polymarket market-buy spend cap in USD."},"ticker":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Ticker","description":"Kalshi market ticker."},"token_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Token Id","description":"Polymarket CLOB outcome token id."},"slug":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Slug","description":"Polymarket market slug for token resolution."},"market_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Market Id","description":"Polymarket market id for token resolution."},"time_in_force":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Time In Force","description":"Venue-specific TIF, e.g. GTC/FOK or good_till_canceled."},"post_only":{"type":"boolean","title":"Post Only","description":"Reject rather than cross the book when supported.","default":false},"reduce_only":{"type":"boolean","title":"Reduce Only","description":"Kalshi reduce-only flag.","default":false},"tick_size":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Tick Size","description":"Polymarket tick size override."},"neg_risk":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Neg Risk","description":"Polymarket negative-risk market flag."},"client_order_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Client Order Id","description":"Caller-provided idempotency/order id."},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi cancel-on-pause flag.","default":false},"subaccount":{"anyOf":[{"type":"integer","maximum":32.0,"minimum":0.0},{"type":"null"}],"title":"Subaccount","description":"Kalshi subaccount number."},"exchange_index":{"type":"integer","minimum":0.0,"title":"Exchange Index","description":"Kalshi exchange shard index; currently 0.","default":0},"execute":{"type":"boolean","title":"Execute","description":"Must be true on `/trading/orders` for live execution.","default":false},"confirmation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Confirmation","description":"Must equal the server confirmation phrase."},"venue_credentials":{"anyOf":[{"$ref":"#/components/schemas/VenueCredentials"},{"type":"null"}],"description":"Deprecated and rejected for public trading requests. Connect the account through /trading/connections first.","deprecated":true}},"type":"object","required":["platform","quantity"],"title":"TradeOrderRequest","description":"A guarded prediction-market order request.\n\n`/trading/preview` validates this without execution. `/trading/orders` only\nsubmits when `execute=true`, the confirmation phrase is exact, and server\nlive-trading env flags are enabled."},"TradeOrderResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"platform":{"type":"string","title":"Platform"},"would_execute":{"type":"boolean","title":"Would Execute"},"requires_confirmation":{"type":"boolean","title":"Requires Confirmation"},"confirmation_phrase":{"type":"string","title":"Confirmation Phrase"},"trading_enabled":{"type":"boolean","title":"Trading Enabled"},"max_order_notional":{"type":"number","title":"Max Order Notional"},"estimated_notional":{"type":"number","title":"Estimated Notional"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"normalized_order":{"additionalProperties":true,"type":"object","title":"Normalized Order"},"submitted":{"type":"boolean","title":"Submitted"},"user_id":{"type":"string","title":"User Id"},"venue_response":{"additionalProperties":true,"type":"object","title":"Venue Response"},"audit_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Order Id"},"venue_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Venue Order Id"},"reconciliation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reconciliation Status"}},"type":"object","required":["ok","platform","would_execute","requires_confirmation","confirmation_phrase","trading_enabled","max_order_notional","estimated_notional","normalized_order","submitted","user_id","venue_response"],"title":"TradeOrderResponse"},"TradeRunCreateRequest":{"properties":{"platform":{"type":"string","maxLength":20,"title":"Platform","description":"`kalshi` or `polymarket`."},"action":{"type":"string","maxLength":10,"title":"Action","description":"`buy` or `sell`.","default":"buy"},"outcome":{"type":"string","maxLength":10,"title":"Outcome","description":"Outcome side: `yes` or `no`.","default":"yes"},"order_type":{"type":"string","maxLength":20,"title":"Order Type","description":"`limit` or `market`.","default":"limit"},"price":{"anyOf":[{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Price","description":"Limit price, or worst acceptable price for market/IOC-style orders."},"quantity":{"type":"number","exclusiveMinimum":0.0,"title":"Quantity","description":"Contracts/shares. For Polymarket market-buy, max_cost may define spend."},"max_cost":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Cost","description":"Polymarket market-buy spend cap in USD."},"ticker":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Ticker","description":"Kalshi market ticker."},"token_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Token Id","description":"Polymarket CLOB outcome token id."},"slug":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Slug","description":"Polymarket market slug for token resolution."},"market_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Market Id","description":"Polymarket market id for token resolution."},"time_in_force":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Time In Force","description":"Venue-specific TIF, e.g. GTC/FOK or good_till_canceled."},"post_only":{"type":"boolean","title":"Post Only","description":"Reject rather than cross the book when supported.","default":false},"reduce_only":{"type":"boolean","title":"Reduce Only","description":"Kalshi reduce-only flag.","default":false},"tick_size":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Tick Size","description":"Polymarket tick size override."},"neg_risk":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Neg Risk","description":"Polymarket negative-risk market flag."},"client_order_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Client Order Id","description":"Caller-provided idempotency/order id."},"cancel_order_on_pause":{"type":"boolean","title":"Cancel Order On Pause","description":"Kalshi cancel-on-pause flag.","default":false},"subaccount":{"anyOf":[{"type":"integer","maximum":32.0,"minimum":0.0},{"type":"null"}],"title":"Subaccount","description":"Kalshi subaccount number."},"exchange_index":{"type":"integer","minimum":0.0,"title":"Exchange Index","description":"Kalshi exchange shard index; currently 0.","default":0},"execute":{"type":"boolean","title":"Execute","description":"Must be true on `/trading/orders` for live execution.","default":false},"confirmation":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Confirmation","description":"Must equal the server confirmation phrase."},"venue_credentials":{"anyOf":[{"$ref":"#/components/schemas/VenueCredentials"},{"type":"null"}],"description":"Deprecated and rejected for public trading requests. Connect the account through /trading/connections first.","deprecated":true},"title":{"type":"string","maxLength":160,"title":"Title","description":"Short operator-facing name for this run.","default":""},"thesis":{"type":"string","maxLength":4000,"title":"Thesis","description":"Optional research rationale retained with the trade run.","default":""},"source_conversation_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Source Conversation Id","description":"Optional chat thread that produced the trade idea."},"expected_edge":{"anyOf":[{"type":"number","maximum":1.0,"minimum":-1.0},{"type":"null"}],"title":"Expected Edge","description":"Optional model-minus-market probability edge."},"sources":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Sources","description":"Optional source URLs or identifiers supporting the thesis."}},"type":"object","required":["platform","quantity"],"title":"TradeRunCreateRequest","description":"Create a durable, human-reviewable live-trade run without executing it."},"TradeRunExecuteRequest":{"properties":{"confirmation":{"type":"string","maxLength":80,"title":"Confirmation"}},"type":"object","required":["confirmation"],"title":"TradeRunExecuteRequest","description":"The explicit human acknowledgement required to send a saved run."},"TradeRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"title":{"type":"string","title":"Title"},"platform":{"type":"string","title":"Platform"},"action":{"type":"string","title":"Action"},"outcome":{"type":"string","title":"Outcome"},"ticker":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ticker"},"token_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Id"},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quantity"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"},"estimated_notional":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Estimated Notional"},"order_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Type"},"client_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Order Id"},"preview":{"additionalProperties":true,"type":"object","title":"Preview"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"audit_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Order Id"},"venue_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Venue Order Id"},"reconciliation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reconciliation Status"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"last_reconciled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Reconciled At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"}},"type":"object","required":["id","status","title","platform","action","outcome","preview","provenance","created_at","updated_at"],"title":"TradeRunResponse","description":"A durable live-trading lifecycle record, with no credential material."},"TradingAccountCheckRequest":{"properties":{"venue_credentials":{"anyOf":[{"$ref":"#/components/schemas/VenueCredentials"},{"type":"null"}],"description":"Legacy transient credentials. Use /trading/connections instead.","deprecated":true}},"type":"object","title":"TradingAccountCheckRequest","description":"Legacy transient credential validation request.\n\nKept for non-browser compatibility while the public product uses the secure\naccount-connection endpoint below."},"TradingAccountStatus":{"properties":{"trading_enabled":{"type":"boolean","title":"Trading Enabled"},"byo_trading_enabled":{"type":"boolean","title":"Byo Trading Enabled","default":false},"max_order_notional":{"type":"number","title":"Max Order Notional"},"allow_market_orders":{"type":"boolean","title":"Allow Market Orders"},"confirmation_phrase":{"type":"string","title":"Confirmation Phrase"},"credential_source":{"type":"string","title":"Credential Source"},"venues":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Venues"}},"type":"object","required":["trading_enabled","max_order_notional","allow_market_orders","confirmation_phrase","credential_source","venues"],"title":"TradingAccountStatus","description":"Trading readiness without exposing exchange secrets."},"TradingConnectionRequest":{"properties":{"venue_credentials":{"$ref":"#/components/schemas/VenueCredentials"}},"type":"object","required":["venue_credentials"],"title":"TradingConnectionRequest","description":"One-time encrypted account-connection request."},"TradingConnectionStatus":{"properties":{"platform":{"type":"string","title":"Platform"},"connected":{"type":"boolean","title":"Connected"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["platform","connected"],"title":"TradingConnectionStatus"},"TradingConnectionsResponse":{"properties":{"encryption_configured":{"type":"boolean","title":"Encryption Configured"},"connections":{"additionalProperties":{"$ref":"#/components/schemas/TradingConnectionStatus"},"type":"object","title":"Connections"}},"type":"object","required":["encryption_configured","connections"],"title":"TradingConnectionsResponse"},"TradingGuardrailsResponse":{"properties":{"paused":{"type":"boolean","title":"Paused"},"platform_kill_switch":{"type":"boolean","title":"Platform Kill Switch"},"max_order_notional":{"type":"number","title":"Max Order Notional"},"max_daily_risk_notional":{"type":"number","title":"Max Daily Risk Notional"},"max_market_exposure_notional":{"type":"number","title":"Max Market Exposure Notional"},"max_open_orders":{"type":"integer","title":"Max Open Orders"},"max_price_deviation_bps":{"type":"integer","title":"Max Price Deviation Bps"},"max_quote_age_seconds":{"type":"integer","title":"Max Quote Age Seconds"},"cooldown_seconds":{"type":"integer","title":"Cooldown Seconds"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["paused","platform_kill_switch","max_order_notional","max_daily_risk_notional","max_market_exposure_notional","max_open_orders","max_price_deviation_bps","max_quote_age_seconds","cooldown_seconds"],"title":"TradingGuardrailsResponse","description":"The signed-in user's execution limits, never exchange credentials."},"TradingGuardrailsUpdateRequest":{"properties":{"paused":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paused"},"max_order_notional":{"anyOf":[{"type":"number","maximum":100000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Order Notional"},"max_daily_risk_notional":{"anyOf":[{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Daily Risk Notional"},"max_market_exposure_notional":{"anyOf":[{"type":"number","maximum":1000000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Market Exposure Notional"},"max_open_orders":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Max Open Orders"},"max_price_deviation_bps":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Max Price Deviation Bps"},"max_quote_age_seconds":{"anyOf":[{"type":"integer","maximum":300.0,"minimum":1.0},{"type":"null"}],"title":"Max Quote Age Seconds"},"cooldown_seconds":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":0.0},{"type":"null"}],"title":"Cooldown Seconds"}},"type":"object","title":"TradingGuardrailsUpdateRequest","description":"Users may only narrow their own limits below Foresea's hard ceilings."},"UserModelProviderStatus":{"properties":{"provider_id":{"type":"string","title":"Provider Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"description":{"type":"string","title":"Description"},"connected":{"type":"boolean","title":"Connected"},"default_model":{"type":"string","title":"Default Model"},"popular_models":{"items":{"type":"string"},"type":"array","title":"Popular Models"},"default_base_url":{"type":"string","title":"Default Base Url"},"custom_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Base Url"},"docs_url":{"type":"string","title":"Docs Url","default":""},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"key_prefix":{"type":"string","title":"Key Prefix","default":""},"masked_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Masked Key"}},"type":"object","required":["provider_id","name","category","description","connected","default_model","popular_models","default_base_url"],"title":"UserModelProviderStatus"},"UserModelProvidersResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/UserModelProviderStatus"},"type":"array","title":"Providers"},"encryption_configured":{"type":"boolean","title":"Encryption Configured","default":true}},"type":"object","required":["providers"],"title":"UserModelProvidersResponse"},"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"},"VenueActionRequest":{"properties":{"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Body"},"execute":{"type":"boolean","title":"Execute","default":false},"confirmation":{"type":"string","title":"Confirmation","default":""},"audit_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audit Order Id"}},"additionalProperties":false,"type":"object","title":"VenueActionRequest"},"VenueCredentials":{"properties":{"kalshi_api_key_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Kalshi Api Key Id"},"kalshi_private_key":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Kalshi Private Key","description":"RSA private key PEM."},"kalshi_base_url":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Kalshi Base Url"},"polymarket_private_key":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Polymarket Private Key","description":"Wallet private key."},"polymarket_api_key":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Polymarket Api Key"},"polymarket_api_secret":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Polymarket Api Secret"},"polymarket_api_passphrase":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Polymarket Api Passphrase"},"polymarket_clob_host":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Polymarket Clob Host"},"polymarket_chain_id":{"anyOf":[{"type":"integer","maximum":1000000000.0,"minimum":0.0},{"type":"null"}],"title":"Polymarket Chain Id"},"polymarket_signature_type":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Polymarket Signature Type"},"polymarket_funder_address":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Polymarket Funder Address"}},"type":"object","title":"VenueCredentials","description":"Credentials received only by the authenticated connection endpoint.\n\nThese values are accepted once over TLS, encrypted server-side, and never\nreturned to the browser. They are intentionally rejected on order-preview\nand order-submission requests so the public UI cannot fall back to a\nbrowser-held secret flow."},"VenueRequest":{"properties":{"parameters":{"additionalProperties":true,"type":"object","title":"Parameters"},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Body"}},"additionalProperties":false,"type":"object","title":"VenueRequest"},"VisitRequest":{"properties":{"path":{"type":"string","maxLength":500,"title":"Path","default":"/"},"referrer":{"type":"string","maxLength":2000,"title":"Referrer","default":""},"timezone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"VisitRequest","description":"Browser visit event; attribution is resolved from the session header."},"WebhookSubscribeRequest":{"properties":{"url":{"type":"string","maxLength":500,"title":"Url","description":"Destination webhook callback URL (https/http)"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events","description":"Events to subscribe to: 'edge_alert', 'market_resolution', 'new_market', 'all'"},"min_edge":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Edge","description":"Minimum edge threshold for edge_alert events","default":0.08}},"type":"object","required":["url"],"title":"WebhookSubscribeRequest"},"WebhookSubscribeResponse":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"secret":{"type":"string","title":"Secret"},"min_edge":{"type":"number","title":"Min Edge"},"created_at":{"type":"string","title":"Created At"},"active":{"type":"boolean","title":"Active"},"status":{"type":"string","title":"Status","default":"registered"}},"type":"object","required":["id","url","events","secret","min_edge","created_at","active"],"title":"WebhookSubscribeResponse"}}},"tags":[{"name":"Inference","description":"Probability forecasting, structured rationale generation, multi-model ensembles, and concurrent batch predictions."},{"name":"Markets","description":"Real-time and historical quotes, orderbooks, trade tapes, exchange status, whale flow, and arbitrage scanning across Polymarket and Kalshi."},{"name":"Trading","description":"Institutional non-custodial trading: KMS envelope encryption, risk guardrails, pre-trade preview collars, portfolio reconciliation, and Fractional Kelly sizing."},{"name":"Agents","description":"Autonomous multi-agent intelligence: ReAct execution loops, market scanners, 3-agent adversarial bull-bear debates, durable research runs, and copied recipes."},{"name":"Autonomous Twin","description":"Autonomous operator twin execution: mandates, risk approval, automated paper/live decision loops, commands, readiness, and emergency pause controls."},{"name":"Venue APIs","description":"Direct venue pass-through endpoints covering 49 paginated REST operations and WebSocket feeds across Kalshi and Polymarket."},{"name":"Feed","description":"Unified streaming alpha feed, live agent activities, and real-time market pulse via Server-Sent Events (SSE)."},{"name":"Analytics","description":"Public dataset exports in compressed Apache Parquet format and product intelligence metrics."},{"name":"Knowledge","description":"Per-user RAG (Retrieval-Augmented Generation) knowledge base: document ingestion, vector/keyword search, and evidence grounding."},{"name":"Model Providers","description":"User Bring-Your-Own-Key (BYOK) model provider credentials and live connectivity tests."},{"name":"Webhooks","description":"External agent webhook subscription lifecycle for automated market and signal event dispatch."},{"name":"Auth","description":"User authentication, OAuth2 (Google & GitHub), personal forecasting ledger, and market watchlists."},{"name":"System","description":"Institutional health probes, readiness checks, public track record statistics, and operational telemetry."}]}