{
  "openapi": "3.1.0",
  "info": {
    "title": "MacroPulse API",
    "description": "BuildPulse \u2014 home construction and renovation intelligence: project cost estimates, contractor vetting, permit requirements, material pricing, ROI projections, and inspection checklists. US-focused with Canadian coverage.",
    "version": "1.2.0",
    "contact": {
      "url": "https://macropulse-alpha.vercel.app"
    },
    "x-agent-use-case": "on-demand",
    "x-agent-chaining": "Follow up with /gridpulse for solar/EV charger installation costs as part of a build; /propplus for property value impact of renovations; /insurepulse for builder risk insurance quotes."
  },
  "servers": [
    {
      "url": "https://macropulse-alpha.vercel.app"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 payment signature. Send a GET request without this header to receive a 402 with payment requirements. Sign the payment and retry with the PAYMENT-SIGNATURE header."
      }
    }
  },
  "security": [
    {
      "x402": []
    }
  ],
  "paths": {
    "/api/session-brief": {
      "get": {
        "summary": "Forex session brief",
        "description": "Real-time macro intelligence for the current or specified trading session. Includes rates snapshot, top pair biases, scheduled events, and agent action.",
        "operationId": "sessionBrief",
        "parameters": [
          {
            "name": "session",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asian",
                "london",
                "newyork"
              ]
            },
            "description": "Trading session. Auto-detected from UTC time if omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "Session brief",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "headline": {
                      "type": "string"
                    },
                    "risk_tone": {
                      "type": "string",
                      "enum": [
                        "risk-on",
                        "risk-off",
                        "neutral"
                      ]
                    },
                    "session": {
                      "type": "string"
                    },
                    "top_pairs": {
                      "type": "array"
                    },
                    "scheduled_events": {
                      "type": "array"
                    },
                    "rates_snapshot": {
                      "type": "object"
                    },
                    "equities_context": {
                      "type": "string"
                    },
                    "crypto_context": {
                      "type": "string"
                    },
                    "narrative": {
                      "type": "string"
                    },
                    "agent_action": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required. See PAYMENT-REQUIRED response header for x402 payment details.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "schema": {
                  "type": "string"
                },
                "description": "Base64-encoded x402 payment requirements"
              }
            }
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/event-pulse": {
      "get": {
        "summary": "Economic event deep-dive",
        "description": "Deep analysis of a specific economic event \u2014 forecast vs consensus, historical context, forex market impact.",
        "operationId": "eventPulse",
        "parameters": [
          {
            "name": "event",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "NFP",
                "CPI",
                "FOMC",
                "GDP",
                "PPI",
                "PCE",
                "ISM",
                "JOLTS",
                "RETAIL_SALES",
                "UNEMPLOYMENT",
                "ECB",
                "BOJ",
                "BOE",
                "RBA",
                "RBNZ",
                "BOC"
              ]
            },
            "description": "Economic event identifier"
          }
        ],
        "responses": {
          "200": {
            "description": "Event analysis"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.2,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/crypto-pulse": {
      "get": {
        "summary": "Crypto market context",
        "description": "BTC and ETH prices, market cap, dominance, Fear & Greed index, and risk tone for forex context.",
        "operationId": "cryptoPulse",
        "responses": {
          "200": {
            "description": "Crypto snapshot"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.05,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/commodities-pulse": {
      "get": {
        "summary": "Commodities brief",
        "description": "Gold, silver, WTI, and Brent crude \u2014 current prices (via FRED when available), posture, Brent/WTI spread, and forex impact on commodity-linked currencies.",
        "operationId": "commoditiesPulse",
        "responses": {
          "200": {
            "description": "Commodities brief"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/equities-pulse": {
      "get": {
        "summary": "Equities pulse",
        "description": "Global equity index snapshot for the current or specified session. US indices via Alpha Vantage (EOD). International context synthesized from financial news.",
        "operationId": "equitiesPulse",
        "parameters": [
          {
            "name": "session",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asian",
                "london",
                "newyork"
              ]
            },
            "description": "Trading session. Auto-detected from UTC time if omitted."
          }
        ],
        "responses": {
          "200": {
            "description": "Equities brief"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    },
    "/api/calendar": {
      "get": {
        "summary": "Weekly economic calendar",
        "description": "High-impact economic events for the current trading week \u2014 dates, times, currency impact, central bank schedule, and peak volatility windows.",
        "operationId": "calendar",
        "responses": {
          "200": {
            "description": "Weekly calendar"
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price-usd": 0.1,
        "x-agent-use-case": "on-demand"
      }
    }
  }
}