{
  "openapi": "3.1.0",
  "info": {
    "title": "SignalPulse",
    "description": "Two-product trading intelligence platform. Product 1 \u2014 Market Analysis: natural language Q&A across FX, crypto, equities, sports, and racing; powered by an 11-layer intelligence stack; requires an analysis credit ($1.49/call). Product 2 \u2014 Trade Signals: cross-asset scanner covering 37 instruments (28 FX pairs, 4 metals/commodities, 5 global indices) plus sports and racing; returns actionable entry/SL/TP with full rationale; requires a signal credit ($2.49/call). Credit packs purchased at signalpulse.app \u2014 card or crypto. Credits are product-specific: analysis credits work only for /api/analysis; signal credits work only for signal/scan endpoints.",
    "version": "2.0.0",
    "contact": {
      "email": "info@theaslangroupllc.com"
    },
    "x-track-record": "https://signalpulse.theaslangroupllc.com/track-record"
  },
  "servers": [
    {
      "url": "https://signalpulse.theaslangroupllc.com"
    }
  ],
  "paths": {
    "/api/instruments": {
      "get": {
        "operationId": "listInstruments",
        "summary": "List supported instruments, sports, and endpoint reference",
        "description": "Free discovery endpoint. Returns all supported instruments, sports, prediction market categories, data layers, and full endpoint documentation.",
        "x-price-usd": 0,
        "x-credit-type": "none",
        "x-agent-use-case": "Discovery \u2014 call first to understand the full universe SignalPulse covers before generating signals or analysis",
        "responses": {
          "200": {
            "description": "Full instrument and endpoint catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/analysis": {
      "get": {
        "operationId": "askAnalysis",
        "summary": "Ask any market, trading, or betting question \u2014 returns a deep intelligence report",
        "description": "Natural language market analysis. Ask any question about FX, metals, commodities, indices, crypto, equities, sports, or racing and receive a professional-grade report synthesising all relevant intelligence layers. The engine detects your asset class from the question text and pulls targeted data: COT positioning for FX, TIPS real yield for gold, sharp Pinnacle odds for sports, going conditions for horse racing, FRED macro for equities. The 'data_edge' field surfaces the non-obvious factor the casual observer would miss. Costs 1 analysis credit ($1.49).",
        "x-price-usd": 1.49,
        "x-credit-type": "analysis",
        "x-agent-use-case": "Ask any question before deciding whether to generate a signal. Use to research macro context, assess a sports matchup, understand a gold breakout thesis, or sense-check an existing position. Covered asset classes: fx, metals, commodity, index, crypto, equity, sports, racing, macro.",
        "x-agent-chaining": "Use /api/analysis for research and /api/signal/* for execution. Example: ask /api/analysis 'Is EURUSD bearish this week?' then call /api/scan/forex to get the actual signal.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Natural language question. Any instrument, any asset class. Examples: 'What is the outlook for gold given current real yields?', 'Should I back Arsenal at 2.10 on Saturday?', 'Is USDJPY about to break?', 'What does today's NFP mean for my USD longs?'",
            "example": "Is gold a good buy given where real yields are?"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sp_[a-zA-Z0-9]{40}$"
            },
            "description": "SignalPulse API key with analysis credits. Keys issued after purchasing an analysis credit pack at signalpulse.app. One analysis credit deducted per call."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "description": "Alternative to ?q= query parameter"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intelligence report with data edge and confidence assessment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "question": {
                      "type": "string"
                    },
                    "asset_class": {
                      "type": "string",
                      "enum": [
                        "fx",
                        "metals",
                        "commodity",
                        "index",
                        "crypto",
                        "equity",
                        "sports",
                        "racing",
                        "macro"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "description": "2-3 sentence direct answer leading with the most important insight"
                    },
                    "analysis": {
                      "type": "object",
                      "properties": {
                        "key_findings": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "bullish_factors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "bearish_factors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "wildcards": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "time_horizon": {
                          "type": "string",
                          "enum": [
                            "short-term (1-7d)",
                            "medium-term (1-4w)",
                            "long-term (1-6m)"
                          ]
                        }
                      }
                    },
                    "data_edge": {
                      "type": "string",
                      "description": "The most non-obvious insight \u2014 specific numbers, obscure indicators, or cross-asset signals a casual observer would miss"
                    },
                    "outlook": {
                      "type": "string",
                      "enum": [
                        "bullish",
                        "bearish",
                        "neutral",
                        "mixed"
                      ]
                    },
                    "confidence": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "confidence_note": {
                      "type": "string",
                      "description": "What would change this view"
                    },
                    "generated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No credits remaining \u2014 purchase analysis credits at signalpulse.app"
          },
          "403": {
            "description": "Wrong credit type \u2014 this endpoint requires analysis credits, not signal credits"
          }
        }
      },
      "post": {
        "operationId": "askAnalysisPost",
        "summary": "Ask any market question (POST body)",
        "description": "Same as GET /api/analysis but accepts the question in the request body as JSON. Use when the question is too long for a query parameter.",
        "x-price-usd": 1.49,
        "x-credit-type": "analysis",
        "security": [
          {
            "analysisCredit": []
          }
        ],
        "parameters": [
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with analysis credits."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "question"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "example": "What is the macro outlook for gold over the next month?"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intelligence report \u2014 same schema as GET /api/analysis"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/scan/sample": {
      "get": {
        "operationId": "scanSample",
        "summary": "FREE pick-of-the-day \u2014 a full-depth sample of SignalPulse's sports intelligence on one featured matchup (de-vigged sportsbook consensus + proprietary stats/weather analytics). No payment, no API key.",
        "description": "A free, current sample of the same engine the paid endpoints use \u2014 one featured deep pick (baseball/WNBA by time of day; racing AM soon), cached and refreshed each window, logged to the public track record. Run your own queries at /api/scan/game ($1.00) and /api/scan/predmarket ($2.00).",
        "x-price-usd": 0,
        "x-agent-use-case": "discovery",
        "responses": {
          "200": {
            "description": "The free featured pick-of-the-day with full reasoning."
          }
        }
      }
    },
    "/api/scan/game": {
      "get": {
        "operationId": "scanGame",
        "summary": "Deep single-match analysis for AI sports & research agents \u2014 a full multi-engine read of any game: de-vigged sportsbook consensus (Bovada/FanDuel/Pinnacle), sharp-line moves, proprietary xG/EPA/Statcast/map-pool analytics, venue weather and altitude physics, injuries and props. Returns 3 ranked +EV plays with full reasoning, props included.",
        "description": "Desk-quality single-game intelligence on demand. Returns the headline pick plus top_picks (3 ranked plays), each with edge_reason, confidence, market, availability, plus venue_conditions, athlete_intelligence, line_movement and avoid_if. Sports markets are read against the de-vigged book and our proprietary sport/weather engines. Position sizing, real-time alerts and the tracked record are the premium SignalPulse service. Cached briefly per matchup.",
        "x-price-usd": 1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?sport=mlb (or wnba, soccer_epl, nba, nfl, nhl, tennis, mma, esports) with optional event= and market_type=. Pair with /api/scan/predmarket for the prediction-market cross-venue view. Agents pay $1.00 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "mlb | nba | nfl | nhl | wnba | soccer_epl | tennis | mma | esports \u2026",
            "example": "mlb"
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Matchup hint, e.g. yankees-red-sox.",
            "example": "yankees-red-sox"
          },
          {
            "name": "market_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "moneyline",
                "spread",
                "total",
                "props"
              ]
            },
            "description": "Optional market focus (hint, not a cap)."
          }
        ],
        "responses": {
          "200": {
            "description": "Single-match analysis \u2014 3 ranked +EV plays with full multi-engine reasoning (agent tier; sized/tracked calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $1.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/racing": {
      "get": {
        "operationId": "scanRacing",
        "summary": "Today's GB/IRE racing card scanned for AI betting & research agents \u2014 the single highest expected-value selection plus value picks across every race, horse or greyhound. Horses: RPR/Topspeed, draw bias, pace shape, going\u00d7form and trainer/jockey conditional course/going records. Greyhounds: early-speed, trap affinity, overall run-time, track trap-bias. Live exchange + forecast prices give genuine EV.",
        "description": "Desk-quality racing intelligence on demand. Returns scan_summary + top_pick (selection, event, bet_type, market_odds, implied vs our probability, edge, direction, confidence, rationale, key_edge) + value_picks + avoid + market_context, with the bet type chosen for the best edge (win/place/each-way/forecast/tricast). Reads the weather\u2192going\u2192form intersection, draw/trap bias and the pace map the casual punter ignores. Curated sizing, alerts and the tracked, calibrated record are the premium SignalPulse service. Cached briefly per card.",
        "x-price-usd": 0.5,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?type=horse (GB/IRE flat & jumps) or ?type=greyhound, with optional market_type= (win | place | each-way | forecast | tricast). Pair with /api/scan/game and /api/scan/predmarket for the full sports/markets view. Agents pay $0.50 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "horse",
                "greyhound"
              ]
            },
            "description": "Race discipline to scan (default horse).",
            "example": "horse"
          },
          {
            "name": "market_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "win",
                "place",
                "each-way",
                "forecast",
                "tricast"
              ]
            },
            "description": "Optional bet-type focus (hint, not a cap)."
          }
        ],
        "responses": {
          "200": {
            "description": "Racing card analysis \u2014 the single highest-EV selection + value picks with full reasoning (agent tier; sized/tracked calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $0.50 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/h2h": {
      "get": {
        "operationId": "scanH2H",
        "summary": "Player head-to-head for AI betting & research agents \u2014 a targeted read of TWO named players against each other in any matchup sport (golf, tennis, MMA). Returns the betting matchup verdict (favoured side, EV, edge) AND the fantasy head-to-head (who scores more DFS/fantasy points), plus data-backed props.",
        "description": "Desk-quality player-vs-player intelligence on demand. Returns betting_h2h (favoured player, bet_type, implied vs our probability, edge, confidence, rationale, key_edge) + fantasy_h2h (higher projection + reasoning \u2014 flagged when it diverges from the betting side) + props + avoid + market_context. Golf reads strokes-gained category fit to the course + history; tennis reads surface/form/fatigue; combat reads the style matchup. Curated sizing, alerts and the tracked record are the premium SignalPulse service. Cached briefly per matchup.",
        "x-price-usd": 0.5,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?sport=golf&player_a=fitzpatrick&player_b=mcilroy (or ?players=a-vs-b) with optional market=matchup|props|fantasy. Pair with /api/scan/game and /api/scan/predmarket for the full sports view. Agents pay $0.50 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "golf | tennis | mma \u2026 (any matchup sport the engine covers).",
            "example": "golf"
          },
          {
            "name": "player_a",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "First player (or use players=a-vs-b).",
            "example": "fitzpatrick"
          },
          {
            "name": "player_b",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Second player.",
            "example": "mcilroy"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "matchup",
                "props",
                "fantasy"
              ]
            },
            "description": "Optional focus (hint, not a cap)."
          }
        ],
        "responses": {
          "200": {
            "description": "Head-to-head analysis \u2014 betting matchup verdict + fantasy h2h + props (agent tier; sized/tracked calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $0.50 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/compare": {
      "get": {
        "operationId": "scanCompare",
        "summary": "Compare & rank 2+ named players against each other for AI betting, fantasy & research agents \u2014 golf 3-balls, DFS player pools, season-long start/sit, 'best of these'. Returns a ranked list (each with a projection) plus the single best betting play AND the best fantasy/DFS value.",
        "description": "Desk-quality multi-player ranking on demand. Returns ranking[] (rank, player, projection, the_case, confidence, in_data) + best_play (player, play_type, edge, rationale, key_edge) + fantasy_best (highest-value DFS play \u2014 flagged when it diverges from the betting best) + fade + market_context. Golf reads strokes-gained category fit to the course; tennis reads surface/form; combat reads the style matchup; team-sport players read usage/role + DFS points-per-dollar. Players not in the data block are ranked last and flagged (no fabrication). Cached briefly per group.",
        "x-price-usd": 1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?sport=golf&players=scheffler-vs-schauffele-vs-morikawa (or comma-separated, or repeated ?player=) with optional market=value|fantasy|props|start-sit. The N-way generalization of /api/scan/h2h. Agents pay $1.00 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "golf | tennis | mma \u2026 (any sport the engine covers).",
            "example": "golf"
          },
          {
            "name": "players",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "2\u201312 names \u2014 a-vs-b-vs-c, comma-separated, or repeated ?player=.",
            "example": "scheffler-vs-schauffele-vs-morikawa"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "value",
                "fantasy",
                "props",
                "start-sit"
              ]
            },
            "description": "Optional purpose (hint, not a cap)."
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked comparison \u2014 best\u2192worst with projections + best betting play + best fantasy value (agent tier; sized/tracked calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $1.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/fantasy": {
      "get": {
        "operationId": "scanFantasy",
        "summary": "Direct fantasy advice for AI agents \u2014 start/sit, DFS lineup (salary cap, points-per-dollar), waiver pickups and trade analysis. FULLY OPEN: returns committed recommendations (who to start, accept/decline the trade), not just analysis. Projects fantasy points from the underlying data (golf SG/course-fit; NFL/MLB/NBA usage/role/matchup); the betting market is optional, never the gate.",
        "description": "Desk-quality fantasy decisions on demand. Returns headline (the direct call) + rankings[] (rank, player, projected_points, floor_ceiling, role_usage, matchup, the_case, start, confidence, in_data) + lineup (DFS salary-cap build with points-per-dollar \u2014 lineup mode) + trade_verdict (accept/decline, winning side, value gap \u2014 trade mode) + upside_play + risk_flags + caveats. Usage-driven projections, calibration-disciplined; players not in the data block are flagged (no fabrication). Cached briefly per pool.",
        "x-price-usd": 1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use mode=start-sit|lineup|waiver|trade. start-sit/lineup/waiver take ?players= (a-vs-b, comma, or repeated ?player=); trade takes ?give=\u2026&get=\u2026. Optional scoring=ppr|half-ppr|standard|dfs and slots=N. Pair with /api/scan/h2h for a single matchup. Agents pay $1.00 via x402; humans use a SignalPulse signal credit for alerts + the tracked record.",
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "nfl | mlb | nba | golf \u2026 (any sport the engine covers).",
            "example": "nfl"
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "start-sit",
                "lineup",
                "waiver",
                "trade"
              ],
              "default": "start-sit"
            },
            "description": "The fantasy decision type.",
            "example": "start-sit"
          },
          {
            "name": "players",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Candidate pool \u2014 1 to 16 names (a-vs-b, comma-separated, or repeated ?player=). Required for start-sit/lineup/waiver.",
            "example": "saquon-barkley-vs-bijan-robinson"
          },
          {
            "name": "give",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Trade mode \u2014 player(s) you would send.",
            "example": "ceedee-lamb"
          },
          {
            "name": "get",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Trade mode \u2014 player(s) you would receive.",
            "example": "bijan-robinson"
          },
          {
            "name": "scoring",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ppr",
                "half-ppr",
                "standard",
                "dfs"
              ]
            },
            "description": "Optional scoring format."
          },
          {
            "name": "slots",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Optional \u2014 how many to start (start-sit / lineup)."
          }
        ],
        "responses": {
          "200": {
            "description": "Committed fantasy advice \u2014 ranked board with projected points + lineup/trade verdict (agent tier; alerts + the tracked record are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $1.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/player": {
      "get": {
        "operationId": "scanPlayer",
        "summary": "Single-player stat-projected outlook for AI betting, fantasy & research agents \u2014 data-backed prop projections (the stat is projected from the underlying data even when no book posts a line), the fantasy projection (points, floor/ceiling, start-worthiness) and the form/role/matchup read. Golf strokes-gained/course-fit; NFL/MLB/NBA usage/role/matchup.",
        "description": "Desk-quality single-player intelligence on demand. Returns outlook (form, role_usage, matchup, conditions) + projections[] (stat, projection, market_line, lean, edge, one_line \u2014 market line OPTIONAL, never invented) + fantasy (projected_points, floor_ceiling, start_worthiness, reasoning) + key_edge + risk + market_context. The N=1 case of the player engine \u2014 the betting props are analysis, the fantasy projection is a direct call. Players not in the data block are flagged (no fabrication). Cached briefly per player.",
        "x-price-usd": 0.5,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?sport=mlb&player=aaron-judge with optional market=<a stat/prop>|fantasy|props. The single-player read; pair with /api/scan/h2h (two players) or /api/scan/compare (2+). Agents pay $0.50 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "mlb | nfl | nba | golf \u2026 (any sport the engine covers).",
            "example": "mlb"
          },
          {
            "name": "player",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A single player name.",
            "example": "aaron-judge"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional focus \u2014 a stat/prop, 'fantasy', or 'props'.",
            "example": "total-bases"
          }
        ],
        "responses": {
          "200": {
            "description": "Single-player outlook \u2014 prop projections + fantasy projection + form/matchup (agent tier; sized/tracked calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $0.50 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/ask": {
      "get": {
        "operationId": "scanAsk",
        "summary": "Ask any sports or prediction-market question in plain language \u2014 the front door to SignalPulse's deep engines. Returns a data-grounded answer with an explicit DATA-vs-OPINION split (every claim cites its stat; judgment is labeled), a betting or fantasy angle when relevant, and a pointer to the deepest named endpoint. Honest when a question is outside coverage \u2014 it routes, it doesn't bluff.",
        "description": "Natural-language triage over the whole sports/markets engine. Auto-detects the sport, pulls its live intelligence, and answers: answer + confidence + data_backed[] (each citing a stat/source) + opinion[] (judgment, labeled) + key_factors + betting_angle (analysis) + fantasy_angle (direct advice) + best_endpoint (the deep read to call next) + caveats. The cheap triage layer that funnels to the deep paid reads (game/h2h/compare/fantasy/player/predmarket/racing). Cached briefly per question.",
        "x-price-usd": 1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use ?q=<any sports/markets question> (optional &sport= to force detection). The orientation layer \u2014 read best_endpoint in the response, then call that named endpoint for the desk-quality read. Agents pay $1.00 via x402; humans use a SignalPulse signal credit.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A free-text sports/markets question (aliases: question, ask).",
            "example": "is Aaron Judge a good DFS play tonight against Skubal"
          },
          {
            "name": "sport",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional \u2014 force the sport instead of auto-detecting.",
            "example": "mlb"
          }
        ],
        "responses": {
          "200": {
            "description": "A data-grounded answer with a data-vs-opinion split + a pointer to the deepest named endpoint (agent tier; the deep reads are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $1.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/golf": {
      "get": {
        "operationId": "scanGolf",
        "summary": "Whole-field golf scan for AI betting, fantasy & research agents \u2014 reads the ENTIRE tournament field (PGA ShotLink strokes-gained + ESPN) and surfaces the single highest-EV play across every bet type (outright / each-way / top-N / matchup / make-cut / first-round-leader), led by course-fit and the tee-time weather wave. For named golfers use /api/scan/compare or /api/scan/h2h.",
        "description": "Desk-quality whole-field golf intelligence on demand \u2014 the agent twin of the premium signal/golf engine. Scans the live field by SG category profile against what the course demands, layering recent form, course history, and the AM/PM weather wave, then returns top_pick (player, bet type, market odds, edge, the case) + value_picks + the scan_summary course-fit read + avoid (the names to fade). compare/h2h handle named-golfer matchups; this is the full-field board. Cached briefly. Tournament weeks only \u2014 off-weeks return no_data.",
        "x-price-usd": 1,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Call with optional market=outright|matchup|top-10|make-cut|first-round-leader|dfs to bias the bet type. Then drill named golfers via /api/scan/compare (3-balls/DFS pools) or /api/scan/h2h (2-balls). Agents pay $1.00 via x402; humans use a SignalPulse signal credit for the sized, tracked call.",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional bet-type hint: outright | each-way | top-10 | matchup | make-cut | first-round-leader | dfs.",
            "example": "matchup"
          }
        ],
        "responses": {
          "200": {
            "description": "Whole-field golf scan \u2014 the highest-EV play across bet types + course-fit read (agent tier; sized/tracked calls are premium). Returns no_data on off-weeks."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $1.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/predmarket": {
      "get": {
        "operationId": "scanPredmarket",
        "summary": "Calibrated superforecaster scan of prediction markets for AI research & trading agents \u2014 a base-rate-anchored read across Polymarket, Manifold and PredictIt: cross-venue divergence, order-book and whale flow, and for sports the de-vigged sportsbook consensus plus proprietary team-strength and weather engines. Returns mispriced markets with probabilities, edge and full commentary, props included.",
        "description": "Desk-quality prediction-market intelligence on demand. Returns scan_summary + value_opportunities (question, market price, our calibrated probability, edge, direction, rationale, key data, risk) + no_edge_markets for the chosen category. Sports markets are priced against the de-vigged global sportsbook consensus and our proprietary sport/weather engines. Curated slate pick-lists, position sizing, real-time alerts and a tracked record are the premium SignalPulse service. Cached briefly per category.",
        "x-price-usd": 2,
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use category=sports for the sharpest edge (de-vigged book + sport engines, props included). Pair with /api/scan/event for macro-print event markets. Agents pay $2.00 via x402; humans use a SignalPulse signal credit for the full sized call.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "economics",
                "geopolitics",
                "politics",
                "sports",
                "esports"
              ]
            },
            "description": "Prediction-market category to scan.",
            "example": "sports"
          },
          {
            "name": "horizon",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "short",
                "mid",
                "long"
              ],
              "default": "mid"
            },
            "description": "short: order-flow/dislocation. mid: positioning + catalyst. long: base-rate/calibration.",
            "example": "mid"
          }
        ],
        "responses": {
          "200": {
            "description": "Prediction-market scan \u2014 mispriced markets with calibrated probabilities, edge and full analysis (agent tier; the sized calls are premium)."
          },
          "402": {
            "description": "Payment required (x402, USDC on Base) \u2014 $2.00 for agents without a SignalPulse session/API key."
          }
        }
      }
    },
    "/api/scan/market": {
      "get": {
        "operationId": "scanMarket",
        "summary": "Institutional cross-asset market scan for AI financial & trading agents \u2014 multi-layer read across FX majors, metals, and equity indices: regime, COT positioning, yield spreads, carry, real yields, VIX term structure, options gamma, and macro, synthesized into a decision-ready read: best instrument, directional bias, confidence, full rationale, key factors.",
        "description": "Desk-quality cross-asset intelligence on demand for autonomous financial/advisor/trading agents. Returns market_theme + best_opportunity (instrument, signal, confidence, bias, the FULL multi-layer rationale, weighted key_factors). Analysis tier \u2014 exact executable entries/stops/targets and post-cost expectancy are reserved for the premium SignalPulse product. Results cached briefly per style.",
        "x-price-usd": 2,
        "x-credit-type": "signal",
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Use /api/scan/market as the primary discovery endpoint when no asset class preference exists. Narrow to /api/scan/forex for FX-only. Use /api/signal/generate when you have a specific instrument. Use /api/analysis to research context before acting.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scalp",
                "intraday",
                "longterm"
              ],
              "default": "intraday"
            },
            "description": "Trading style: scalp (1H chart, tight targets ~20 pips), intraday (4H chart, exit before NY close), longterm (daily chart, structural position).",
            "example": "intraday"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^sp_[a-zA-Z0-9]{40}$"
            },
            "description": "SignalPulse API key with signal credits. One signal credit deducted per call."
          }
        ],
        "responses": {
          "200": {
            "description": "Cross-asset scan \u2014 single best opportunity with full intelligence briefing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scan_type": {
                      "type": "string",
                      "example": "market"
                    },
                    "universe_scanned": {
                      "type": "number",
                      "example": 37
                    },
                    "candidates_analyzed": {
                      "type": "number"
                    },
                    "market_theme": {
                      "type": "string"
                    },
                    "best_opportunity": {
                      "type": "object",
                      "properties": {
                        "instrument": {
                          "type": "string"
                        },
                        "asset_class": {
                          "type": "string",
                          "enum": [
                            "fx",
                            "metal",
                            "commodity",
                            "index"
                          ]
                        },
                        "signal": {
                          "type": "string",
                          "enum": [
                            "BUY",
                            "SELL",
                            "NEUTRAL"
                          ]
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "entry": {
                          "type": "object"
                        },
                        "stop_loss": {
                          "type": "object"
                        },
                        "take_profit": {
                          "type": "object"
                        },
                        "rationale": {
                          "type": "string"
                        },
                        "why_best": {
                          "type": "string"
                        },
                        "intelligence_nodes_active": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "ranked_candidates": {
                      "type": "array"
                    },
                    "no_clear_edge": {
                      "type": "boolean"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($2.00) for the agent analysis tier."
          },
          "403": {
            "description": "Wrong credit type \u2014 signal credits required"
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents"
      }
    },
    "/api/scan/forex": {
      "get": {
        "operationId": "scanForex",
        "summary": "Institutional forex market scan for AI financial & trading agents \u2014 multi-layer read across the 28 majors and crosses: rate differentials, COT positioning, carry, policy divergence, yield spreads, and cross-asset macro regime, synthesized into a decision-ready read: best pair, directional bias, confidence, full rationale, key factors.",
        "description": "Desk-quality FX intelligence on demand for autonomous financial/advisor/trading agents, for a fraction of a terminal subscription. Returns market_theme + best_opportunity (instrument, signal, confidence, bias, the FULL multi-layer rationale, weighted key_factors). Analysis tier \u2014 exact executable entries/stops/targets and post-cost expectancy are reserved for the premium SignalPulse product. Results cached briefly per style.",
        "x-price-usd": 0.5,
        "x-credit-type": "signal",
        "x-agent-use-case": "on-demand",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scalp",
                "intraday",
                "longterm"
              ],
              "default": "intraday"
            },
            "description": "Trading style: scalp (1H, ICT structure, \u226420 pip targets), intraday (4H), longterm (daily)."
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "FX scan results \u2014 best opportunity with ranked candidates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scan_type": {
                      "type": "string"
                    },
                    "pairs_scanned": {
                      "type": "number"
                    },
                    "market_theme": {
                      "type": "string"
                    },
                    "best_opportunity": {
                      "type": "object"
                    },
                    "ranked_candidates": {
                      "type": "array"
                    },
                    "no_clear_edge": {
                      "type": "boolean"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          },
          "403": {
            "description": "Wrong credit type"
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents"
      }
    },
    "/api/scan/event": {
      "get": {
        "operationId": "scanEvent",
        "summary": "Institutional economic-event scan for AI financial & trading agents \u2014 historical-reaction study for a scheduled macro release (NFP, CPI, FOMC and more): how the affected FX pairs have moved after similar surprises, the surprise read, macro context, and which pair has the cleanest reaction profile, with directional bias, confidence, and full rationale.",
        "description": "Desk-quality event-study intelligence on demand for autonomous financial/advisor/trading agents. Returns recommended_trade (instrument, signal, confidence, bias, the FULL historical-reaction rationale, why_this_pair, key_factors) for a scheduled macro release. Analysis tier \u2014 exact executable entry/stop/target levels are reserved for the premium SignalPulse product. Results cached briefly per event.",
        "x-price-usd": 1,
        "x-credit-type": "signal",
        "x-agent-use-case": "on-demand",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "event",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Economic event name. Examples: NFP, FOMC, CPI, ECB, BOE, RBA, GDP, PCE",
            "example": "NFP"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Event intelligence briefing with expected market impact and positioning guidance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "event": {
                      "type": "string"
                    },
                    "market_impact_summary": {
                      "type": "string"
                    },
                    "key_pairs_to_watch": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "bullish_scenario": {
                      "type": "string"
                    },
                    "bearish_scenario": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($1.00) for the agent analysis tier."
          },
          "403": {
            "description": "Wrong credit type"
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents"
      }
    },
    "/api/signal/generate": {
      "get": {
        "operationId": "generateSignal",
        "summary": "Generate a trading signal for any specific instrument",
        "description": "Synthesises RSI, MACD, Bollinger Bands, ATR, EMA trend, COT institutional positioning, FRED macro indicators, and GDELT news sentiment into a complete directional signal with entry, SL, and TP for any specified instrument. Covers forex, equities, commodities, crypto, and indices. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Use when you have a specific instrument in mind. For discovery (no instrument preference), use /api/scan/market or /api/scan/forex instead.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "instrument",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Any tradable instrument ticker. Examples: EURUSD, AAPL, BTC-USD, GOLD, GC=F (gold futures), CL=F (crude oil), ^GSPC (S&P 500), XAUUSD",
            "example": "EURUSD"
          },
          {
            "name": "timeframe",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "4h",
                "1d",
                "3d",
                "1w",
                "1m",
                "3m"
              ]
            },
            "description": "Signal timeframe \u2014 1h (scalping) through 3m (long-term position)",
            "example": "4h"
          },
          {
            "name": "risk_points",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Points/pips at risk from entry to stop-loss. Defaults to 1.5\u00d7 ATR."
          },
          {
            "name": "reward_ratio",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "default": 1
            },
            "description": "Risk:reward ratio. 1.0 = 1:1, 1.5 = 1:1.5, 2.0 = 1:2."
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Complete trading signal with entry, SL, TP, and intelligence rationale",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instrument": {
                      "type": "string"
                    },
                    "timeframe": {
                      "type": "string"
                    },
                    "signal": {
                      "type": "string",
                      "enum": [
                        "BUY",
                        "SELL",
                        "NEUTRAL"
                      ]
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "entry": {
                      "type": "object"
                    },
                    "stop_loss": {
                      "type": "object"
                    },
                    "take_profit": {
                      "type": "object"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "key_factors": {
                      "type": "array"
                    },
                    "risks": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "macro_context": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/sports": {
      "get": {
        "operationId": "generateSportsPick",
        "summary": "EV-based sports pick from 35+ sports \u2014 best value bet across today's card",
        "description": "Synthesises sharp consensus odds (Pinnacle, multiple books via The Odds API), ESPN injury reports, venue weather (Open-Meteo), GDELT news sentiment, and our model probability estimates into ranked picks with explicit Expected Value calculation. The pick is the bet where our model probability most exceeds the market implied probability \u2014 not just the favourite. Covers 35+ sports: NFL, NBA, WNBA, MLB, NHL, EPL, AFL, NRL, rugby union (auto-resolves the active competition), UFC/MMA, boxing, tennis, golf, Formula 1 (?sport=f1 delegates to the F1 field engine), cricket (bare board or competition scopes t20i/odi/test/wt20i/wodi/ipl/bbl/psl/cpl/wcpl/thehundred/whundred/t20blast/sa20/ilt20/bpl/lpl/mlc/wpl/asiacup/championstrophy/cricketworldcup/wcricketworldcup/t20worldcup/wt20worldcup), esports, and all major global soccer leagues. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Sports betting edge detection \u2014 the pick is the EV-positive selection where the market is systematically wrong, backed by injury, weather, and historical pattern data.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Sport key. Examples: nfl, nba, mlb, nhl, epl, ucl, laliga, afl, nrl, ufc, boxing, tennis, golf, cricket. Call /api/instruments for the full list.",
            "example": "nfl"
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Team name or matchup slug \u2014 e.g., bills-chiefs, arsenal-chelsea. Omit to get best pick across all of today's card.",
            "example": "bills-chiefs"
          },
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "h2h",
                "spreads",
                "totals"
              ]
            },
            "description": "Focus on a specific betting market. Omit to find the best EV pick across all markets."
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "EV-ranked sports picks with explicit probability edge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sport": {
                      "type": "string"
                    },
                    "scan_summary": {
                      "type": "string"
                    },
                    "top_picks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "pick": {
                            "type": "string"
                          },
                          "event": {
                            "type": "string"
                          },
                          "market": {
                            "type": "string"
                          },
                          "market_odds": {
                            "type": "number"
                          },
                          "implied_probability_pct": {
                            "type": "number"
                          },
                          "our_probability_pct": {
                            "type": "number"
                          },
                          "edge_pct": {
                            "type": "number"
                          },
                          "confidence": {
                            "type": "number"
                          },
                          "rationale": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/f1": {
      "get": {
        "operationId": "generateF1FieldScan",
        "summary": "F1 race-weekend field scan \u2014 highest-EV play across the whole grid",
        "description": "Scans the full race-weekend grid during the Thu\u2192race-start window: a current-season-weighted per-driver field table (teammate deltas, grid\u2192finish conversion, DNF/reliability, points share) + the Bovada board with full-set de-vigged one-winner fair probabilities + race-day weather (rain = variance amplifier). Surfaces the single highest-EV play across winner/podium/top-N/driver-H2H/constructor/qualifying markets. Between race weekends returns no_play naming the next round and refunds the credit. Also reachable via /api/signal/sports?sport=f1. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Motorsport betting edge detection on race weekends \u2014 market-anchored fair-probability comparison across every priced F1 market.",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional market bias: winner | podium | top10 | h2h | constructor | quali"
          }
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Field-scan pick with EV rationale, or no_play (refunded) outside the race window."
          }
        }
      }
    },
    "/api/signal/racing": {
      "get": {
        "operationId": "generateRacingPick",
        "summary": "Horse racing or greyhound pick \u2014 EV-based, going conditions, form, and trap bias",
        "description": "Generates the highest-value racing pick from today's card using sharp market prices (Pinnacle/Betfair), venue weather and going conditions (Open-Meteo), form and tipster intelligence (Tavily), and GDELT sentiment. The pick is explicitly EV-based: the selection where our estimated probability most exceeds the market implied probability. For horse racing: cross-references going conditions with each runner's form history on that going. For greyhounds: trap bias, rails vs wide runner preference, and sectional times. Explains WHY the market is mis-pricing the selection. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Racing edge detection \u2014 the pick surfaces the non-obvious factor (soft ground + stamina horse, trap 1 bias at this track) that explains why the market price is wrong. Includes explicit EV calculation.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "horse",
                "greyhound"
              ],
              "default": "horse"
            },
            "description": "Racing type. horse: UK/Ireland/US/AUS horse racing. greyhound: UK/Ireland greyhound racing with trap bias analysis.",
            "example": "horse"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "EV-based racing pick with going conditions, form synthesis, and explicit probability edge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "race_type": {
                      "type": "string",
                      "enum": [
                        "horse_racing",
                        "greyhound"
                      ]
                    },
                    "scan_summary": {
                      "type": "string"
                    },
                    "top_pick": {
                      "type": "object",
                      "properties": {
                        "selection": {
                          "type": "string"
                        },
                        "event": {
                          "type": "string"
                        },
                        "market_odds": {
                          "type": "string"
                        },
                        "implied_probability_pct": {
                          "type": "number"
                        },
                        "our_probability_pct": {
                          "type": "number"
                        },
                        "edge_pct": {
                          "type": "number"
                        },
                        "direction": {
                          "type": "string",
                          "enum": [
                            "back",
                            "lay"
                          ]
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "rationale": {
                          "type": "string"
                        },
                        "key_edge": {
                          "type": "string"
                        }
                      }
                    },
                    "value_picks": {
                      "type": "array"
                    },
                    "avoid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "market_context": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/polymarket": {
      "get": {
        "operationId": "scanPolymarket",
        "summary": "Scan Polymarket for prediction market mispricings",
        "description": "Fetches live Polymarket binary markets (Gamma API), cross-references with GDELT news sentiment, FRED macro data, and Tavily web context to identify markets where our data-driven probability estimate diverges from the current crowd price by more than 10 percentage points. Returns opportunities ranked by edge size. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Prediction market edge detection \u2014 identifies mispricings where fundamental data disagrees with the crowd. Best for crypto, macro, and geopolitical markets.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "crypto",
                "economics",
                "geopolitics",
                "politics"
              ]
            },
            "description": "Market category: crypto (BTC/ETH/DeFi outcomes), economics (Fed rate/inflation/recession), geopolitics (war/conflict/sanctions), politics (elections/legislation).",
            "example": "crypto"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Prediction market value opportunities ranked by edge",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "category": {
                      "type": "string"
                    },
                    "scan_summary": {
                      "type": "string"
                    },
                    "value_opportunities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "question": {
                            "type": "string"
                          },
                          "market_yes_pct": {
                            "type": "number"
                          },
                          "our_yes_estimate_pct": {
                            "type": "number"
                          },
                          "edge_pct": {
                            "type": "number"
                          },
                          "direction": {
                            "type": "string",
                            "enum": [
                              "YES",
                              "NO"
                            ]
                          },
                          "confidence": {
                            "type": "string",
                            "enum": [
                              "high",
                              "medium",
                              "low"
                            ]
                          },
                          "rationale": {
                            "type": "string"
                          },
                          "key_data_points": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "risk_to_thesis": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/futures": {
      "get": {
        "operationId": "signalFutures",
        "summary": "Multi-category futures signal \u2014 COT + seasonal + energy + metals + ag + softs + livestock (10 categories)",
        "description": "Full-spectrum futures intelligence engine covering 10 categories. Primary data: CFTC COT (Managed Money + Disaggregated for ag, TFF for financials), EIA weekly energy inventories, USDA FAS PSD for global crop supply/demand, SHFE warehouse inventory (Shanghai metals), CFTC Supplemental CIT for softs/livestock index trader flow, CME warehouse stocks, Treasury term premium. Signal timeframes: scalp (same-session), intraday (1-3 days), position (2-8 weeks). Categories: energy (crude/nat gas/RBOB/heating oil), metals (copper/gold/silver/platinum/palladium), agriculture (corn/wheat/soybeans via USDA), softs (coffee/sugar/cocoa/cotton via CIT), livestock (live cattle/feeder cattle/lean hogs), financial (E-Mini S&P 500/Nasdaq/T-Bonds), rates (SOFR path), fx (DXY/major pairs), crypto (BTC/ETH), all. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Futures intelligence \u2014 10 categories, 3 signal timeframes. Use category=energy for crude/nat gas, metals for copper/gold, agriculture for grain seasonals, softs for coffee/sugar/cotton index flows, financial for equity index futures, all for the best current setup across all categories.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "energy",
                "metals",
                "agriculture",
                "softs",
                "livestock",
                "financial",
                "rates",
                "fx",
                "crypto",
                "all"
              ],
              "default": "all"
            },
            "description": "Futures category. energy = crude/nat gas/RBOB/heating oil (EIA inventories + COT). metals = copper/gold/silver/platinum (COT + SHFE stocks). agriculture = corn/wheat/soybeans (USDA FAS PSD + seasonal patterns + COT). softs = coffee/sugar/cocoa/cotton (CFTC Supplemental CIT index trader flow). livestock = live cattle/feeder cattle/lean hogs (CIT + seasonal). financial = E-Mini S&P 500/Nasdaq/T-Bonds (TFF COT). rates = SOFR quarterly path. fx = DXY/majors. crypto = BTC/ETH perps. all = best setup across all (default). Note: market=grains is a legacy alias for agriculture.",
            "example": "energy"
          },
          {
            "name": "signal_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scalp",
                "intraday",
                "position"
              ],
              "default": "intraday"
            },
            "description": "Signal timeframe: scalp = same-session (session timing + momentum focus); intraday = 1-3 days (catalyst timing + COT extremes); position = 2-8 weeks (COT positioning + fundamentals dominant).",
            "example": "position"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked futures signal with COT positioning analysis",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "market": {
                      "type": "string"
                    },
                    "signal": {
                      "type": "string",
                      "enum": [
                        "LONG",
                        "SHORT",
                        "NEUTRAL",
                        "WAIT"
                      ]
                    },
                    "contract": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "positioning_edge": {
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "key_signals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "signal": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "weight": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "top_picks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rank": {
                            "type": "number"
                          },
                          "contract": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "confidence": {
                            "type": "number"
                          },
                          "cot_edge": {
                            "type": "string"
                          },
                          "entry_note": {
                            "type": "string"
                          },
                          "stop_note": {
                            "type": "string"
                          },
                          "hold_period": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "rate_path_signal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cot_extremes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "avoid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data_confidence": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "valid_for": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "market_scope": {
                          "type": "string"
                        },
                        "cot_records": {
                          "type": "number"
                        },
                        "rate_path_available": {
                          "type": "boolean"
                        },
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/equities": {
      "get": {
        "operationId": "signalEquities",
        "summary": "Institutional single-name equities scan for AI financial & trading agents \u2014 multi-layer read for any US ticker: dealer-gamma regime, VWAP/ORB/momentum, short interest and borrow, options skew/VRP, fundamentals, earnings drift, sector relative strength, insider and macro tide, synthesized into a directional signal, confidence, the primary edge, and full rationale.",
        "description": "Desk-quality single-name equity intelligence on demand for autonomous financial/advisor/trading agents. Returns the directional signal (LONG/SHORT/WAIT), confidence, primary_edge, full rationale, and key_signals for any US ticker across three horizons (day_trade/mid_term/long_term). Analysis tier \u2014 the exact executable trade plan (entry, stop, target, sizing) is reserved for the premium SignalPulse product. Results cached briefly per ticker/horizon.",
        "x-price-usd": 0.5,
        "x-credit-type": "signal",
        "x-agent-use-case": "on-demand",
        "x-agent-chaining": "Combine with /api/signal/screener to first find the best candidate, then call /api/signal/equities?ticker={top_pick} for a detailed signal. For options overlay on the equity: follow with /api/signal/options?ticker={ticker}&signal_type=mid_term.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stock ticker symbol. US equities work best (NYSE, NASDAQ). For day_trade: SPY, QQQ, AAPL, NVDA, TSLA, AMD, META have highest liquidity and best intraday data. For long_term: any S&P 500 constituent.",
            "example": "NVDA"
          },
          {
            "name": "signal_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day_trade",
                "mid_term",
                "long_term"
              ],
              "default": "mid_term"
            },
            "description": "Trading horizon: day_trade = same-day only (VWAP + ORB primary signals; hold until 3:45pm ET max); mid_term = 2-8 week swing (technical + fundamental catalyst primary); long_term = 6-24 months (business quality + valuation primary). Default: mid_term.",
            "example": "day_trade"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Long-only equity signal with entry, stop, target, and detailed rationale",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ticker": {
                      "type": "string"
                    },
                    "company_name": {
                      "type": "string"
                    },
                    "signal_type": {
                      "type": "string",
                      "enum": [
                        "day_trade",
                        "mid_term",
                        "long_term"
                      ]
                    },
                    "signal": {
                      "type": "string",
                      "enum": [
                        "LONG",
                        "WAIT"
                      ]
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "recommended_action": {
                      "type": "string"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "primary_edge": {
                      "type": "object"
                    },
                    "trade_detail": {
                      "type": "object",
                      "properties": {
                        "entry": {
                          "type": "string"
                        },
                        "stop_loss": {
                          "type": "string"
                        },
                        "target": {
                          "type": "string"
                        },
                        "hold_period": {
                          "type": "string"
                        },
                        "position_sizing": {
                          "type": "string"
                        }
                      }
                    },
                    "key_signals": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "technical_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fundamental_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "catalyst_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "squeeze_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "insider_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "analyst_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avoid_if": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data_confidence": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "valid_for": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "signal_type": {
                          "type": "string"
                        },
                        "quality_score": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "growth_score": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "squeeze_potential": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "short_volume_pct": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "vwap_position": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "or_status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "next_earnings": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "analyst_consensus": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "analyst_upside_pct": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing ticker parameter"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          },
          "403": {
            "description": "Wrong credit type"
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents"
      }
    },
    "/api/signal/screener": {
      "get": {
        "operationId": "signalScreener",
        "summary": "Global equity screener signal \u2014 best setup across 12 exchanges",
        "description": "Scans 10-20 liquid large-caps on any of 12 global exchanges, scores each candidate using a quantitative model (momentum 30pts, RSI 25pts, volume ratio 25pts, technical structure 20pts), then generates an AI-synthesised signal for the single best setup. Covers: NYSE, NASDAQ, LSE (London), ASX (Australia), TSE (Tokyo), HKEX (Hong Kong), NSE (India), TSX (Canada), XETRA (Germany/Frankfurt), KOSPI (Korea), B3 (Brazil), Euronext (Paris/Amsterdam). Criteria modes: momentum (trend + volume), value (oversold bounce), squeeze (short interest reversal), breakout (52-week highs). Includes insider activity signal from SEC EDGAR Form 4 for US tickers. Returns ranked candidates + top pick with entry, target, stop, hold period, and market breadth note. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Equity screening \u2014 use when you want the best stock setup on a specific exchange or globally. Best for swing trades (1-3 weeks). Combine with /api/signal/options for the follow-on options play on the screener's top pick.",
        "x-agent-chaining": "Run screener first, then call /api/signal/options?ticker={top_pick}&signal_type=mid_term for the options signal on the highest-scoring equity.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "exchange",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "NYSE",
                "NASDAQ",
                "LSE",
                "ASX",
                "TSE",
                "HKEX",
                "NSE",
                "TSX",
                "XETRA",
                "KOSPI",
                "B3",
                "Euronext"
              ],
              "default": "NASDAQ"
            },
            "description": "Exchange to screen. NYSE/NASDAQ = US large-caps. LSE = UK. ASX = Australia. TSE = Japan. HKEX = Hong Kong/China. NSE = India. TSX = Canada. XETRA = Germany. KOSPI = Korea. B3 = Brazil. Euronext = Paris/Amsterdam. Default: NASDAQ.",
            "example": "NASDAQ"
          },
          {
            "name": "criteria",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "momentum",
                "value",
                "squeeze",
                "breakout",
                "all"
              ],
              "default": "all"
            },
            "description": "Screening strategy: momentum = strong price + volume trend. value = oversold at support, bounce setup. squeeze = high short interest + volume surge + reversal. breakout = 52-week highs + resistance cleared. all = best setup across all criteria (default).",
            "example": "momentum"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Screener signal with ranked candidates and top pick",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exchange": {
                      "type": "string"
                    },
                    "criteria": {
                      "type": "string"
                    },
                    "top_pick": {
                      "type": "object",
                      "properties": {
                        "ticker": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "direction": {
                          "type": "string"
                        },
                        "confidence": {
                          "type": "number"
                        },
                        "signal_type": {
                          "type": "string"
                        },
                        "entry_note": {
                          "type": "string"
                        },
                        "target_note": {
                          "type": "string"
                        },
                        "stop_note": {
                          "type": "string"
                        },
                        "hold_period": {
                          "type": "string"
                        },
                        "rationale": {
                          "type": "string"
                        }
                      }
                    },
                    "ranked_picks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rank": {
                            "type": "number"
                          },
                          "ticker": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "signal": {
                            "type": "string"
                          },
                          "key_reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "market_breadth": {
                      "type": "string"
                    },
                    "exchange_context": {
                      "type": "string"
                    },
                    "avoid": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "exchange": {
                          "type": "string"
                        },
                        "criteria": {
                          "type": "string"
                        },
                        "candidates_scanned": {
                          "type": "number"
                        },
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid exchange or criteria parameter"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/signal/options": {
      "get": {
        "operationId": "signalOptions",
        "summary": "Options intelligence signal \u2014 0DTE / Mid-Term / LEAPs (GEX + VRP + UOA + VIX term structure)",
        "description": "Three-tier options signal engine covering the full options lifecycle. Signal type determines the primary intelligence stack: 0DTE (same-day) focuses on GEX (gamma exposure) \u2014 whether market makers are suppressing or amplifying moves; Mid-Term (7-45 DTE) focuses on VRP (variance risk premium) + unusual activity + IV term structure; LEAPs (>1 year) focuses on long-dated IV premium and VIX1Y/VIX ratio. Intelligence nodes include: GEX (Black-Scholes computed from Yahoo Finance chains, with call wall/put wall/gamma flip level), VIX full term structure (VIX1D through VIX1Y), CBOE P/C ratios (equity/total/index), NSE India VIX + NIFTY PCR (global vol regime), VRP, UOA (volume/OI sweeps), max pain, IV term structure. Returns specific strategy structure with strikes, expiry, entry/exit conditions, and key signal breakdown. Costs 1 signal credit ($2.49).",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Options intelligence \u2014 call with signal_type=0dte for same-day gamma plays (SPY/QQQ/SPX best), mid_term for weekly/monthly VRP and flow-based setups, leaps for 12-18 month structural vol plays. Combine with /api/analysis for macro context before entering.",
        "x-agent-chaining": "For 0DTE: call at market open (9:35am ET) or after 2pm ET for final-hour pinning setup. For mid-term: call anytime for UOA and VRP edge. For LEAPs: call once per week \u2014 VIX1Y signal changes slowly.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stock or ETF ticker. For 0DTE: SPY, QQQ, IWM, SPX work best (highest 0DTE liquidity). For mid-term: any liquid equity with options (AAPL, NVDA, TSLA, META). For LEAPs: major indices and mega-caps (SPY, QQQ, AAPL, MSFT, NVDA).",
            "example": "SPY"
          },
          {
            "name": "signal_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "0dte",
                "mid_term",
                "leaps"
              ],
              "default": "mid_term"
            },
            "description": "Options timeframe: 0dte = same-day expiry (GEX + max pain + VIX1D primary); mid_term = 7-45 DTE weekly/monthly (VRP + UOA + IV structure primary); leaps = >1 year expiry (VIX1Y/VIX ratio + long-dated IV premium primary). Default: mid_term.",
            "example": "0dte"
          },
          {
            "name": "strategy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "buy_vol",
                "sell_vol",
                "directional"
              ]
            },
            "description": "Optional strategy filter. buy_vol = cheap vol / straddle opportunities. sell_vol = expensive premium to sell. directional = call or put buys. Omit for best available signal.",
            "example": "sell_vol"
          },
          {
            "name": "X-API-KEY",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SignalPulse API key with signal credits."
          }
        ],
        "responses": {
          "200": {
            "description": "Options intelligence signal with strategy recommendation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ticker": {
                      "type": "string"
                    },
                    "signal_type": {
                      "type": "string",
                      "enum": [
                        "0dte",
                        "mid_term",
                        "leaps"
                      ]
                    },
                    "spot_price": {
                      "type": "number"
                    },
                    "recommended_strategy": {
                      "type": "string"
                    },
                    "signal": {
                      "type": "string",
                      "enum": [
                        "SELL_VOL",
                        "BUY_VOL",
                        "BULLISH",
                        "BEARISH",
                        "NEUTRAL"
                      ]
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "rationale": {
                      "type": "string"
                    },
                    "primary_edge": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "weight": {
                          "type": "string"
                        }
                      }
                    },
                    "strategy_detail": {
                      "type": "object",
                      "properties": {
                        "structure": {
                          "type": "string"
                        },
                        "strikes": {
                          "type": "string"
                        },
                        "expiry": {
                          "type": "string"
                        },
                        "max_risk": {
                          "type": "string"
                        },
                        "target_exit": {
                          "type": "string"
                        },
                        "entry_note": {
                          "type": "string"
                        }
                      }
                    },
                    "key_signals": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "gex_context": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "GEX regime, call wall, put wall, gamma flip level. Required for 0dte."
                    },
                    "vrp_signal": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unusual_activity": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "max_pain_context": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "iv_structure": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "leaps_context": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "VIX1Y/VIX ratio, long-dated vol premium. Required for leaps."
                    },
                    "avoid_if": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "opex_week": {
                      "type": "boolean"
                    },
                    "data_confidence": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    },
                    "valid_for": {
                      "type": "string"
                    },
                    "disclaimer": {
                      "type": "string"
                    },
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "signal_type": {
                          "type": "string"
                        },
                        "gex_regime": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "gex_total_bn": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "call_wall": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "put_wall": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "vix1d": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "vix": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "vix1y": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "cboe_total_pc": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "nse_india_vix": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "credits_remaining": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing required ticker parameter"
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "402": {
            "description": "No signal credits remaining"
          },
          "403": {
            "description": "Wrong credit type"
          }
        }
      }
    },
    "/api/auth/usage": {
      "get": {
        "operationId": "checkUsage",
        "summary": "Check API key usage and credits remaining",
        "description": "Returns the current status, credit type, and remaining balance for an API key. Use to check how many credits remain before making signal or analysis calls.",
        "x-price-usd": 0,
        "x-credit-type": "none",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The API key to check",
            "example": "sp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
          }
        ],
        "responses": {
          "200": {
            "description": "Key status and credit balance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "pending",
                        "cancelled",
                        "expired"
                      ]
                    },
                    "plan": {
                      "type": "string"
                    },
                    "credit_type": {
                      "type": "string",
                      "enum": [
                        "analysis",
                        "signal"
                      ],
                      "description": "Which product this key's credits work for"
                    },
                    "signals_remaining": {
                      "type": "number",
                      "description": "Credits remaining (analysis or signal, depending on credit_type)"
                    },
                    "signals_total": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "is_expired": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Key not found"
          }
        }
      }
    },
    "/api/scan/crypto": {
      "get": {
        "summary": "Institutional-grade crypto market scan for AI financial & trading agents \u2014 40+ live intelligence layers (regime, breadth, on-chain cycle, derivatives positioning, funding extremes, liquidation context, ETF/stablecoin flows) synthesized into a decision-ready read: directional bias, confidence, full rationale, key factors, adversarial pre-mortem.",
        "description": "Desk-quality crypto intelligence on demand for autonomous financial/advisor/trading agents, for a fraction of a terminal subscription. Returns market_theme + best_opportunity (instrument, signal, confidence, bias, the FULL multi-layer rationale, weighted key_factors, premortem). Analysis tier \u2014 exact executable entries/stops/targets and post-cost expectancy are reserved for the premium SignalPulse product. Results cached briefly per style for fast, low-cost delivery.",
        "x-agent-use-case": "on-demand",
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scalp",
                "intraday",
                "swing"
              ],
              "example": "intraday"
            },
            "description": "Scan horizon"
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis-tier crypto scan (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($2.00) for the agent analysis tier."
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents",
        "x-price-usd": 2
      }
    },
    "/api/signal/pre-ipo": {
      "get": {
        "summary": "Pre-IPO intelligence for AI financial & trading agents \u2014 any private company, with live perpetual-futures data (mark price, funding, open interest) for names with an active pre-IPO perp market, including the exact names in Coinbase's 2026-06-16 pre-IPO perp launch (SpaceX, OpenAI, Anthropic). Synthesizes last private valuation, funding history, growth, public-comp implied range, perp-implied valuation vs private marks, perp positioning, mirror/synthetic-token awareness (e.g. Republic rOpenAI/rAnthropic), IPO-timing, catalysts & risks into a decision-ready read.",
        "description": "Analysis tier for agents (valuation read, premium/discount, funding signal, bias, full rationale). The executable perp trade (entry valuation, sizing, EV) is premium-only.",
        "x-agent-use-case": "on-demand",
        "x-agent-audience": "financial-agents, pre-ipo-trading-agents, advisor-agents",
        "parameters": [
          {
            "name": "company",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "spacex"
            },
            "description": "Any private company, e.g. spacex|openai|anthropic|stripe|databricks|..."
          },
          {
            "name": "comp_ticker",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "NVDA"
            },
            "description": "Optional public comparable ticker for the comp cross-check"
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Response language code"
          }
        ],
        "responses": {
          "200": {
            "description": "Decision-ready pre-IPO brief (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($1.00) for the agent analysis tier."
          }
        },
        "x-price-usd": 1
      }
    },
    "/api/scan/options": {
      "get": {
        "summary": "Institutional equity-options volatility scan for AI financial & trading agents \u2014 VRP (variance risk premium), IV term structure, GEX regime, max-pain and unusual options activity across liquid optionable names, synthesized into a decision-ready read: best ticker, vol/directional bias, confidence, full rationale, key factors.",
        "description": "Desk-quality options intelligence on demand for autonomous financial/advisor/trading agents. Returns best_opportunity (ticker, signal, confidence, bias, the FULL multi-layer rationale across VRP + IV structure + GEX, key_factors) plus market context. Analysis tier \u2014 the exact executable trade structure (strikes, expiry, premium/credit) is reserved for the premium SignalPulse product. Results cached briefly per signal_type/strategy for fast, low-cost delivery.",
        "x-agent-use-case": "on-demand",
        "parameters": [
          {
            "name": "signal_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "0dte",
                "mid_term",
                "leaps"
              ],
              "example": "mid_term"
            },
            "description": "Options horizon"
          },
          {
            "name": "strategy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sell_vol",
                "buy_vol",
                "directional",
                "best_available"
              ],
              "example": "best_available"
            },
            "description": "Strategy filter"
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis-tier options scan (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents",
        "x-price-usd": 0.5
      }
    },
    "/api/scan/futures": {
      "get": {
        "summary": "Institutional futures market scan for AI financial & trading agents \u2014 multi-layer read across the futures complex (equity index, rates, energy, metals, grains): COT positioning (disaggregated + financial), seasonality, term structure, and macro regime, synthesized into a decision-ready read: best contract, directional bias, confidence, full rationale, key factors.",
        "description": "Desk-quality futures intelligence on demand for autonomous financial/advisor/trading agents. Returns market_theme + best_opportunity (contract, signal, confidence, bias, the FULL multi-layer rationale, key_factors). Analysis tier \u2014 exact executable entries/stops/targets and post-cost expectancy are reserved for the premium SignalPulse product. Results cached briefly per style.",
        "x-agent-use-case": "on-demand",
        "parameters": [
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "scalp",
                "intraday",
                "longterm"
              ],
              "example": "intraday"
            },
            "description": "Scan horizon"
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis-tier futures scan (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents",
        "x-price-usd": 0.5
      }
    },
    "/api/signal/tokenized": {
      "get": {
        "summary": "Multi-platform tokenized-equity premium/discount scan for AI financial & trading agents \u2014 the live gap between a 24/7 on-chain tokenized stock (xStocks NVDAx/TSLAx/GOOGLx, Ondo Global Markets NVDAon/TSLAon, Dinari dShares where readable) and its underlying share: premium/discount in bps per platform, rich-or-cheap, the cross-platform spread when 2+ platforms trade the same name, US session state, on-chain liquidity, and a mean-reversion read. Loud about platforms with no live public price (e.g. KYC-gated). Unique alpha that exists only on-chain.",
        "description": "Desk-quality multi-platform tokenized-equity intelligence on demand for autonomous financial/advisor/trading agents managing tokenized-stock books. Returns underlying price, a per-platform breakdown (platform, symbol, tokenized price, premium/discount bps, liquidity), cross_platform_spreads, platforms_unavailable (loud, not silent), US market session, mean_reversion_read, confidence and rationale. Analysis tier \u2014 the executable arbitrage (leg sizing, entry/exit gap levels, net capture after fees and gas, venues) is reserved for the premium SignalPulse product. Cached briefly per ticker.",
        "x-agent-use-case": "on-demand",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "NVDA"
            },
            "description": "Tokenized US equity ticker (NVDA, TSLA, GOOGL, AAPL, SPY)"
          }
        ],
        "responses": {
          "200": {
            "description": "Analysis-tier tokenized premium/discount read (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents, trading-agents",
        "x-price-usd": 0.5
      }
    },
    "/api/signal/tokenization-radar": {
      "get": {
        "summary": "Equity tokenization radar for AI financial & advisor agents \u2014 what is going on-chain and when: tokenization status for any US ticker (live / pending / none), on-chain dividend handling, and forward tokenization catalysts (new tokenized-stock listings, RWA issuance, DTCC pilots). The cheap top-of-funnel read for agents tracking tokenized equities.",
        "description": "Low-cost discovery intelligence for autonomous financial/advisor agents tracking the migration of equities on-chain. With a ticker: tokenization_status (verified live via on-chain DEX presence), dividend yield, on-chain dividend handling note, and sourced catalysts. Without a ticker: the forward tokenization-catalyst radar across issuers and venues. Cached per ticker.",
        "x-agent-use-case": "on-demand",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "NVDA"
            },
            "description": "Optional US equity ticker; omit for the forward radar"
          }
        ],
        "responses": {
          "200": {
            "description": "Tokenization radar (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.25) for the agent tier."
          }
        },
        "x-agent-audience": "financial-agents, advisor-agents",
        "x-price-usd": 0.25
      }
    },
    "/api/signal/tokenized-eligibility": {
      "get": {
        "summary": "Tokenized-stock / pre-IPO-perp jurisdiction-eligibility check for AI financial & advisor agents \u2014 given a user's ISO country and (optionally) a platform (Dinari, xStocks, Ondo Global Markets, Coinbase, Robinhood, Gemini), reports which tokenized-equity/pre-IPO-derivative products they can legally access: US-persons policy, named country exclusions, and confirmed-vs-uncertain launch geography. Nobody else sells this.",
        "description": "Deterministic eligibility calls (eligible/ineligible/uncertain) per platform, computed from verified research and never overridden by the LLM narrative layer, each with a cited explanation, an explicit as_of date, and a not-legal-advice disclaimer. Analysis tier for agents.",
        "x-agent-use-case": "on-demand",
        "x-agent-audience": "financial-agents, advisor-agents, compliance-agents",
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "DE"
            },
            "description": "ISO 3166-1 alpha-2 country code, e.g. US | GB | DE | SG"
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "dinari",
                "xstocks",
                "ondo_gm",
                "coinbase",
                "robinhood",
                "gemini",
                "all"
              ],
              "example": "all"
            },
            "description": "Optional \u2014 restrict to one platform; default checks all known platforms"
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "AAPL"
            },
            "description": "Optional \u2014 for framing only, does not change the eligibility logic"
          }
        ],
        "responses": {
          "200": {
            "description": "Per-platform eligibility calls with citations, as_of date, and disclaimer (JSON)."
          },
          "402": {
            "description": "Payment required \u2014 x402 USDC ($0.50) for the agent analysis tier."
          }
        },
        "x-price-usd": 0.5
      }
    },
    "/api/scan/crypto-lite": {
      "get": {
        "summary": "Crypto market tick \u2014 majors + sentiment + regime verdict",
        "description": "BTC/ETH/SOL price + 24h change, Fear & Greed, deterministic regime verdict (RISK_ON\u2026RISK_OFF) in one $0.05 call. 60s freshness, no LLM. Funnel to /api/scan/crypto ($2) deep scan.",
        "operationId": "api_scan_crypto_lite",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Tick result"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.05
      }
    },
    "/api/signal/parlay": {
      "get": {
        "operationId": "buildParlay",
        "summary": "Parlay Builder \u2014 the highest-probability 2/3/4-leg combo, one leg per game, priced at the venue you bet on",
        "description": "Deterministic legs (probability-first, band floor above the venue price, one leg per event, no team twice) priced where you will place them: Polymarket asks (Build a Combo) or a sportsbook's posted prices (NFL book combos may include model-priced player props). The venue's combo haircut sits INSIDE the EV \u2014 measured when the operator has captured it, interim table otherwise (haircut_source says which). The model only explains the legs; every payout, multiple and hit probability is server math. Returns no_play (credit refunded / USDC unsettled) when fewer than 2 legs clear the bar. Every sold combo is captured as one graded record (track-record category=sports sub=parlay: legs, venue, k/n legs hit, printed-vs-realised calibration). Costs 1 signal credit ($2.49) or $1.00 x402.",
        "x-price-usd": 2.49,
        "x-credit-type": "signal",
        "x-agent-use-case": "Multi-leg combo construction with the venue's real combo pricing inside the edge \u2014 the agent gets legs with condition ids / book market refs and the honest post-haircut EV.",
        "security": [
          {
            "signalCredit": []
          }
        ],
        "parameters": [
          {
            "name": "sport",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Sport key \u2014 nfl, nba, mlb, nhl, \u2026 Polymarket venue requires a Polymarket-listed sport.",
            "example": "nfl"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "polymarket",
                "book"
              ]
            },
            "description": "Where the combo will be placed (default polymarket).",
            "example": "polymarket"
          },
          {
            "name": "legs",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                2,
                3,
                4
              ]
            },
            "description": "Requested leg count (default 3). A shorter combo is returned when fewer legs clear \u2014 never a padded leg.",
            "example": 3
          }
        ],
        "responses": {
          "200": {
            "description": "The combo (legs, parlay maths, what_to_do, money line, disclaimer) or a no_play with the screened counts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad params (sport missing, unknown venue, legs not 2/3/4) \u2014 rejected before any credit is deducted."
          },
          "402": {
            "description": "Payment required (x402) / no credits."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "analysisCredit": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY",
        "description": "SignalPulse API key loaded with analysis credits. Analysis credits are purchased at signalpulse.app (1 credit = $1.49, 10 credits = $9.99). One credit is deducted per call to /api/analysis. Purchase URL: https://signalpulse.app#analysis"
      },
      "signalCredit": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY",
        "description": "SignalPulse API key loaded with signal credits. Signal credits are purchased at signalpulse.app (1 credit = $2.49, 10 credits = $16.99). One credit is deducted per call to any /api/scan/* or /api/signal/* endpoint. Purchase URL: https://signalpulse.app#signals"
      }
    }
  }
}