{
  "openapi": "3.1.0",
  "info": {
    "title": "MCPFax Macro & Market Intelligence API",
    "version": "1.1.3",
    "description": "18 x402-paid market-data endpoints over free, keyless public sources (FRED, US Treasury, ECB via Frankfurter, Coinbase, Base RPC, DefiLlama, Polymarket, Manifold Markets). Unpaid calls return HTTP 402 with an x402 challenge. A call that returns no data is never settled, so it costs nothing."
  },
  "servers": [
    {
      "url": "https://mcpfax-markets.bowling-anthony.workers.dev"
    }
  ],
  "tags": [
    {
      "name": "discovery"
    },
    {
      "name": "mcp"
    },
    {
      "name": "macro"
    },
    {
      "name": "rates"
    },
    {
      "name": "fx"
    },
    {
      "name": "crypto"
    },
    {
      "name": "defi"
    },
    {
      "name": "prediction-markets"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Service catalog (HTML)",
        "security": [],
        "responses": {
          "200": {
            "description": "Catalog page",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Service health and endpoint list",
        "security": [],
        "responses": {
          "200": {
            "description": "Health document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "Agent-readable service description",
        "security": [],
        "responses": {
          "200": {
            "description": "Plain text",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "This document",
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/server.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "MCP registry manifest",
        "security": [],
        "responses": {
          "200": {
            "description": "server.json manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "mcp"
        ],
        "summary": "MCP Streamable HTTP endpoint (JSON-RPC 2.0)",
        "description": "initialize, ping and tools/list are free. tools/call is x402-paid at the same price as the matching HTTP route.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/macro": {
      "get": {
        "tags": [
          "macro"
        ],
        "summary": "US macro indicators",
        "description": "DATED SNAPSHOT of Fed funds, CPI, core PCE, unemployment and M2 from FRED. Price: $0.003 USDC per successful call (3000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "description": "Return the stored capture in effect at this UTC date or ISO timestamp instead of the latest one (append-only history; not subject to the freshness limit)",
            "schema": {
              "type": "string"
            },
            "example": "2026-08-11"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "3000",
                      "resource": "/macro",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/rates": {
      "get": {
        "tags": [
          "rates"
        ],
        "summary": "US Treasury yields",
        "description": "DATED SNAPSHOT of US Treasury 2/10/30Y yields, 10s2s curve spread and the 30Y mortgage rate. Price: $0.003 USDC per successful call (3000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "description": "Return the stored capture in effect at this UTC date or ISO timestamp instead of the latest one (append-only history; not subject to the freshness limit)",
            "schema": {
              "type": "string"
            },
            "example": "2026-08-11"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "3000",
                      "resource": "/rates",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/fx": {
      "get": {
        "tags": [
          "fx"
        ],
        "summary": "FX reference rates",
        "description": "ECB reference foreign-exchange cross rates. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "base",
            "in": "query",
            "required": false,
            "description": "Base currency ISO-4217 (default USD)",
            "schema": {
              "type": "string"
            },
            "example": "USD"
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Comma-separated target currencies",
            "schema": {
              "type": "string"
            },
            "example": "EUR,GBP,JPY"
          },
          {
            "name": "as_of",
            "in": "query",
            "required": false,
            "description": "Return the stored capture in effect at this UTC date or ISO timestamp instead of the latest one (append-only history; not subject to the freshness limit)",
            "schema": {
              "type": "string"
            },
            "example": "2026-08-11"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/fx",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/crypto": {
      "get": {
        "tags": [
          "crypto"
        ],
        "summary": "Crypto spot prices",
        "description": "Coinbase spot prices for up to ten assets. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Comma-separated asset symbols (default BTC,ETH,SOL)",
            "schema": {
              "type": "string"
            },
            "example": "BTC,ETH"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/crypto",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/stablecoin": {
      "get": {
        "tags": [
          "crypto"
        ],
        "summary": "Stablecoin peg deviation",
        "description": "USDC, USDT and DAI spot price and peg deviation in basis points. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/stablecoin",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/gas": {
      "get": {
        "tags": [
          "crypto"
        ],
        "summary": "Base gas price",
        "description": "Live Base mainnet gas price from JSON-RPC. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/gas",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/defi/protocols": {
      "get": {
        "tags": [
          "defi"
        ],
        "summary": "DeFi protocols by TVL",
        "description": "DefiLlama protocol universe ranked by TVL, filterable by chain, category or name. Price: $0.002 USDC per successful call (2000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "description": "Only protocols deployed on this chain",
            "schema": {
              "type": "string"
            },
            "example": "Base"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Exact DefiLlama category",
            "schema": {
              "type": "string"
            },
            "example": "Lending"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Name or slug substring",
            "schema": {
              "type": "string"
            },
            "example": "aave"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1-100 (default 20)",
            "schema": {
              "type": "integer"
            },
            "example": "20"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "2000",
                      "resource": "/defi/protocols",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/defi/protocol": {
      "get": {
        "tags": [
          "defi"
        ],
        "summary": "DeFi protocol detail",
        "description": "One DefiLlama protocol: TVL, per-chain TVL, category, chains and links. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "DefiLlama protocol slug (required)",
            "schema": {
              "type": "string"
            },
            "example": "aave-v3"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/defi/protocol",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/defi/chains": {
      "get": {
        "tags": [
          "defi"
        ],
        "summary": "Chain TVL ranking",
        "description": "DefiLlama TVL per blockchain, ranked, with the cross-chain total. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Chain name substring",
            "schema": {
              "type": "string"
            },
            "example": "Base"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1-100 (default 25)",
            "schema": {
              "type": "integer"
            },
            "example": "25"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/defi/chains",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/defi/yields": {
      "get": {
        "tags": [
          "defi"
        ],
        "summary": "DeFi yield pools",
        "description": "DefiLlama yield pools with APY, TVL and the stable pool identifier. Price: $0.002 USDC per successful call (2000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "required": false,
            "description": "Only pools on this chain",
            "schema": {
              "type": "string"
            },
            "example": "Base"
          },
          {
            "name": "project",
            "in": "query",
            "required": false,
            "description": "Only pools from this DefiLlama project",
            "schema": {
              "type": "string"
            },
            "example": "aave-v3"
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Token symbol substring",
            "schema": {
              "type": "string"
            },
            "example": "USDC"
          },
          {
            "name": "min_tvl_usd",
            "in": "query",
            "required": false,
            "description": "Minimum pool TVL in USD (default 1000000)",
            "schema": {
              "type": "number"
            },
            "example": "1000000"
          },
          {
            "name": "stablecoin_only",
            "in": "query",
            "required": false,
            "description": "Only stablecoin pools",
            "schema": {
              "type": "boolean"
            },
            "example": "true"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1-100 (default 20)",
            "schema": {
              "type": "integer"
            },
            "example": "20"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "2000",
                      "resource": "/defi/yields",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/defi/token-prices": {
      "get": {
        "tags": [
          "defi"
        ],
        "summary": "On-chain token prices",
        "description": "DefiLlama prices for arbitrary on-chain tokens addressed as chain:address. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "coins",
            "in": "query",
            "required": false,
            "description": "Comma-separated DefiLlama coin ids as chain:address or coingecko:id, up to 20 (required)",
            "schema": {
              "type": "string"
            },
            "example": "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,coingecko:ethereum"
          },
          {
            "name": "search_width",
            "in": "query",
            "required": false,
            "description": "How far back a price may be taken from (default 6h)",
            "schema": {
              "type": "string"
            },
            "example": "6h"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/defi/token-prices",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/polymarket/markets": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Polymarket markets",
        "description": "Live Polymarket markets with outcome prices, volume and liquidity. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many markets, 1-50 (default 10)",
            "schema": {
              "type": "integer"
            },
            "example": "10"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "volumeNum, liquidityNum, startDate or endDate",
            "schema": {
              "type": "string"
            },
            "example": "volumeNum"
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Sort ascending instead of descending",
            "schema": {
              "type": "boolean"
            },
            "example": "false"
          },
          {
            "name": "closed",
            "in": "query",
            "required": false,
            "description": "Return closed markets instead of open ones",
            "schema": {
              "type": "boolean"
            },
            "example": "false"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/polymarket/markets",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/polymarket/events": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Polymarket events",
        "description": "Polymarket events (market groups) with volume, open interest and member markets. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many events, 1-25 (default 5)",
            "schema": {
              "type": "integer"
            },
            "example": "5"
          },
          {
            "name": "markets_per_event",
            "in": "query",
            "required": false,
            "description": "Member markets per event, 1-25 (default 5)",
            "schema": {
              "type": "integer"
            },
            "example": "5"
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Sort ascending instead of descending",
            "schema": {
              "type": "boolean"
            },
            "example": "false"
          },
          {
            "name": "closed",
            "in": "query",
            "required": false,
            "description": "Return closed events instead of open ones",
            "schema": {
              "type": "boolean"
            },
            "example": "false"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/polymarket/events",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/polymarket/market": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Polymarket market + order book",
        "description": "One Polymarket market with the live CLOB order book for each outcome. Price: $0.002 USDC per successful call (2000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Polymarket Gamma market id",
            "schema": {
              "type": "string"
            },
            "example": "908713"
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Market slug, if you have no id",
            "schema": {
              "type": "string"
            },
            "example": "fed-rate-hike-in-2026"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "description": "Full 0x-prefixed 32-byte condition id (66 chars), abbreviated here, as returned by the markets/events/search tools",
            "schema": {
              "type": "string"
            },
            "example": "0x80b3af88…9744d82b"
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "Order-book levels per side, 1-20 (default 5)",
            "schema": {
              "type": "integer"
            },
            "example": "5"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "2000",
                      "resource": "/polymarket/market",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/polymarket/trades": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Polymarket recent trades",
        "description": "Recent public trade prints for one Polymarket market. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "required": false,
            "description": "Full 0x-prefixed 32-byte condition id (66 chars) of the market, abbreviated here, as returned by the markets/events/search tools (required)",
            "schema": {
              "type": "string"
            },
            "example": "0x80b3af88…9744d82b"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many trades, 1-100 (default 20)",
            "schema": {
              "type": "integer"
            },
            "example": "20"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/polymarket/trades",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/polymarket/leaderboard": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Polymarket trader leaderboard",
        "description": "Top Polymarket traders by traded volume or realised profit over a window. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "description": "volume or profit (default volume)",
            "schema": {
              "type": "string"
            },
            "example": "volume"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "1d, 7d, 30d or all (default 7d)",
            "schema": {
              "type": "string"
            },
            "example": "7d"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many traders, 1-50 (default 10)",
            "schema": {
              "type": "integer"
            },
            "example": "10"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/polymarket/leaderboard",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/manifold/markets": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Manifold markets",
        "description": "Manifold Markets questions with crowd probability. PLAY-money venue. Price: $0.001 USDC per successful call (1000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Question text to search for",
            "schema": {
              "type": "string"
            },
            "example": "bitcoin"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many markets, 1-50 (default 10)",
            "schema": {
              "type": "integer"
            },
            "example": "10"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "score, newest, liquidity, close-date or most-popular",
            "schema": {
              "type": "string"
            },
            "example": "score"
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "description": "all, open, closed or resolved (default open)",
            "schema": {
              "type": "string"
            },
            "example": "open"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "1000",
                      "resource": "/manifold/markets",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    },
    "/prediction-markets/search": {
      "get": {
        "tags": [
          "prediction-markets"
        ],
        "summary": "Cross-venue market search",
        "description": "Find a prediction market by question text across Polymarket and Manifold. Price: $0.002 USDC per successful call (2000 atomic units, 6dp).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Question text to search for (required)",
            "schema": {
              "type": "string"
            },
            "example": "fed rate"
          },
          {
            "name": "limit_per_venue",
            "in": "query",
            "required": false,
            "description": "Results per venue, 1-20 (default 5)",
            "schema": {
              "type": "integer"
            },
            "example": "5"
          },
          {
            "name": "venues",
            "in": "query",
            "required": false,
            "description": "Comma-separated subset of polymarket,manifold",
            "schema": {
              "type": "string"
            },
            "example": "polymarket,manifold"
          }
        ],
        "responses": {
          "200": {
            "description": "Paid data. Returned only after the x402 payment settles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. Body is an x402 challenge with an `accepts` array; retry with a base64 `X-PAYMENT` header carrying the signed authorization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "x402Version": {
                      "type": "integer",
                      "examples": [
                        1
                      ]
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                },
                "example": {
                  "x402Version": 1,
                  "accepts": [
                    {
                      "scheme": "exact",
                      "network": "base",
                      "maxAmountRequired": "2000",
                      "resource": "/prediction-markets/search",
                      "mimeType": "application/json",
                      "outputSchema": {
                        "input": {
                          "type": "http",
                          "method": "GET"
                        }
                      },
                      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Payment not configured, or an upstream source was unavailable."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "x402Payment": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PAYMENT",
        "description": "Base64-encoded x402 `exact`-scheme payment authorization for USDC on Base."
      }
    }
  },
  "security": [
    {
      "x402Payment": []
    }
  ]
}