{
  "openapi": "3.1.0",
  "info": {
    "title": "X402 ETF & Macro Intelligence API",
    "version": "1.0.0",
    "description": "API for crypto ETF flows, FRED macroeconomic indicators, and BEA economic statistics for AI agents. Paid endpoints use x402.",
    "contact": {
      "name": "API Support",
      "url": "https://x402-sand.vercel.app",
      "email": "darmauyeee@gmail.com"
    },
    "x-guidance": "Use this API when an agent needs crypto ETF flow summaries, ETF sentiment, Federal Reserve event context, or U.S. macroeconomic indicators for market research. Inputs are endpoint-specific query parameters such as asset/ticker, date range, year, frequency, or limit; consult each operation's parameters and schemas and send only supported values. Successful calls return structured JSON with provider data and endpoint-specific metadata. Treat missing-provider and upstream errors as unavailable data; never infer or fabricate missing values. Paid operations use x402: first make the request without payment, inspect the HTTP 402 challenge for the exact price, accepted network and payment requirements, then retry with a compatible payment authorization. Do not assume all endpoints have the same price or supported chains. Use the response schema to parse results; cite timestamps and source/provider fields when present. Call summary endpoints for broad overviews and focused macro/BEA endpoints for a specific indicator or reporting period."
  },
  "servers": [
    {
      "url": "https://x402-etf-macro-intelligence.vercel.app"
    }
  ],
  "paths": {
    "/api/etf/summary": {
      "get": {
        "summary": "ETF flow summary across supported crypto assets",
        "operationId": "etf_summary",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "Reserved optional input field for future filters; currently ignored by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/etf/flows": {
      "get": {
        "summary": "ETF flows for a crypto asset; query asset, e.g. BTC",
        "operationId": "etf_flows",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "description": "Crypto asset symbol; defaults to BTC.",
            "schema": {
              "type": "string",
              "enum": [
                "BTC",
                "ETH",
                "SOL",
                "XRP",
                "DOGE",
                "LINK",
                "AVAX",
                "BNB",
                "DOT",
                "SUI"
              ]
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "Lookback period such as 7d or 30d.",
            "schema": {
              "type": "string",
              "default": "30d",
              "pattern": "^[1-9][0-9]{0,2}d$"
            }
          }
        ],
        "security": [
          {
            "X402Payment": []
          }
        ]
      }
    },
    "/api/etf/fund-flows": {
      "get": {
        "summary": "Fund-level ETF flows; query asset, e.g. BTC",
        "operationId": "etf_fund_flows",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "description": "Crypto asset symbol, e.g. BTC.",
            "schema": {
              "type": "string",
              "default": "BTC",
              "enum": [
                "BTC",
                "ETH",
                "SOL",
                "XRP",
                "DOGE",
                "LINK",
                "AVAX",
                "BNB",
                "DOT",
                "SUI"
              ]
            }
          }
        ],
        "security": [
          {
            "X402Payment": []
          }
        ]
      }
    },
    "/api/etf/funds": {
      "get": {
        "summary": "ETF fund data; query asset, e.g. BTC",
        "operationId": "etf_funds",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "description": "Crypto asset symbol, e.g. BTC.",
            "schema": {
              "type": "string",
              "default": "BTC",
              "enum": [
                "BTC",
                "ETH",
                "SOL",
                "XRP",
                "DOGE",
                "LINK",
                "AVAX",
                "BNB",
                "DOT",
                "SUI"
              ]
            }
          }
        ],
        "security": [
          {
            "X402Payment": []
          }
        ]
      }
    },
    "/api/etf/cefi": {
      "get": {
        "summary": "Centralized finance index data",
        "operationId": "etf_cefi",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "Reserved optional input field for future filters; currently ignored by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/etf/prices": {
      "get": {
        "summary": "Crypto ETF price data",
        "operationId": "etf_prices",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "Reserved optional input field for future filters; currently ignored by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/etf/weekly": {
      "get": {
        "summary": "Weekly ETF analytics",
        "operationId": "etf_weekly",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "Reserved optional input field for future filters; currently ignored by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/etf/tickers": {
      "get": {
        "summary": "Supported ETF tickers",
        "operationId": "etf_tickers",
        "responses": {
          "200": {
            "description": "Provider data returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.02"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "input",
            "in": "query",
            "required": true,
            "description": "Reserved optional input field for future filters; currently ignored by this endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/macro/indicators": {
      "get": {
        "summary": "Latest observations for supported FRED macroeconomic series",
        "description": "Returns up to two latest numeric observations per requested series from the Federal Reserve Bank of St. Louis FRED API. Requires FRED_API_KEY in the deployed environment. This route currently has no x402 payment middleware confirmed; the OpenAPI security declaration is therefore empty.",
        "operationId": "fred_macro_indicators",
        "parameters": [
          {
            "name": "series",
            "in": "query",
            "required": false,
            "description": "Comma-separated FRED series IDs. Supported IDs: DFF (Federal Funds Effective Rate), DGS10 (10-Year Treasury Constant Maturity Rate), CPIAUCSL (CPI for All Urban Consumers), PCEPI (Personal Consumption Expenditures Price Index), UNRATE (Unemployment Rate), GDP (Gross Domestic Product). Defaults to DFF,DGS10,CPIAUCSL,UNRATE.",
            "schema": {
              "type": "string",
              "default": "DFF,DGS10,CPIAUCSL,UNRATE",
              "examples": [
                "DFF",
                "DGS10",
                "CPIAUCSL",
                "PCEPI",
                "UNRATE",
                "GDP",
                "DFF,DGS10,UNRATE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latest observations retrieved from FRED",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "example": true
                    },
                    "source": {
                      "type": "string",
                      "example": "FRED"
                    },
                    "source_url": {
                      "type": "string",
                      "format": "uri",
                      "example": "https://fred.stlouisfed.org/"
                    },
                    "retrieved_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "requested_series": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "DFF",
                          "DGS10",
                          "CPIAUCSL",
                          "PCEPI",
                          "UNRATE",
                          "GDP"
                        ]
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "series": {
                            "type": "string",
                            "example": "DGS10"
                          },
                          "name": {
                            "type": "string",
                            "example": "10-Year Treasury Constant Maturity Rate"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ok"
                            ]
                          },
                          "observations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "date": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "value": {
                                  "type": "number"
                                },
                                "realtime_start": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "realtime_end": {
                                  "type": "string",
                                  "format": "date"
                                }
                              },
                              "required": [
                                "date",
                                "value"
                              ]
                            }
                          }
                        },
                        "required": [
                          "series",
                          "name",
                          "status",
                          "observations"
                        ]
                      }
                    }
                  },
                  "required": [
                    "source",
                    "source_url",
                    "retrieved_at",
                    "requested_series",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or unsupported series ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "502": {
            "description": "FRED provider error or timeout; check the FRED API key and upstream response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "FRED_API_KEY is missing from the deployed environment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/health": {
      "get": {
        "summary": "Service and provider configuration status",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Health status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/bea/gdp": {
      "get": {
        "summary": "BEA GDP data",
        "operationId": "bea_gdp",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/inflation": {
      "get": {
        "summary": "BEA PCE inflation price indexes",
        "operationId": "bea_inflation",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/personal-income": {
      "get": {
        "summary": "BEA personal income and spending",
        "operationId": "bea_personal_income",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/corporate-profits": {
      "get": {
        "summary": "BEA corporate profits and national income",
        "operationId": "bea_corporate_profits",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/trade": {
      "get": {
        "summary": "BEA international transactions and trade-related data",
        "operationId": "bea_trade",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/international-investment": {
      "get": {
        "summary": "BEA international investment position",
        "operationId": "bea_international_investment",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    },
    "/api/bea/gdp-by-industry": {
      "get": {
        "summary": "BEA GDP and value added by industry",
        "operationId": "bea_gdp_by_industry",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Year or BEA year range, such as LAST5 or 2024.",
            "schema": {
              "type": "string",
              "default": "2026"
            }
          },
          {
            "name": "frequency",
            "in": "query",
            "required": false,
            "description": "Dataset frequency where supported (A, Q, or M).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "table",
            "in": "query",
            "required": false,
            "description": "BEA table name override where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linecode",
            "in": "query",
            "required": false,
            "description": "BEA table line code where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geofips",
            "in": "query",
            "required": false,
            "description": "Regional GeoFIPS filter where supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "description": "Industry filter where supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time-series observations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing input parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. The deployed server must return a valid x402 v2 challenge with a non-empty accepts array and Bazaar input schema.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 v2 payment requirements",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/X402PaymentRequired"
                }
              }
            }
          },
          "503": {
            "description": "Provider configuration or upstream service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.01"
          }
        },
        "security": [
          {
            "X402Payment": []
          }
        ],
        "description": "Queries the official U.S. Bureau of Economic Analysis API. Requires BEA_API_KEY configured on the server."
      }
    }
  },
  "x-discovery": {
    "ownershipProofs": []
  },
  "components": {
    "schemas": {
      "ApiSuccess": {
        "description": "Provider JSON payload. Exact properties depend on the selected endpoint.",
        "type": "object",
        "additionalProperties": true
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "error"
        ]
      },
      "X402PaymentRequired": {
        "type": "object",
        "properties": {
          "x402Version": {
            "type": "integer",
            "example": 2
          },
          "error": {
            "type": "string"
          },
          "resource": {
            "type": "object",
            "additionalProperties": true
          },
          "accepts": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "scheme",
                "network",
                "amount",
                "asset",
                "payTo"
              ],
              "properties": {
                "scheme": {
                  "type": "string",
                  "example": "exact"
                },
                "network": {
                  "type": "string",
                  "example": "eip155:8453"
                },
                "amount": {
                  "type": "string",
                  "example": "20000"
                },
                "asset": {
                  "type": "string"
                },
                "payTo": {
                  "type": "string"
                },
                "maxTimeoutSeconds": {
                  "type": "integer"
                },
                "extra": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "additionalProperties": true
            }
          },
          "extensions": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "x402Version",
          "accepts"
        ],
        "additionalProperties": true
      }
    },
    "securitySchemes": {
      "X402Payment": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE",
        "description": "x402 v2 payment authorization header for endpoints that explicitly require payment."
      }
    }
  }
}
