{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentEuro \u2014 ECB & Eurostat x402 API",
    "version": "1.0.0",
    "description": "European Central Bank and Eurostat economic data via x402 micropayments. Exchange rates, EU economic indicators, and ECB monetary data.",
    "contact": {
      "name": "Ocean Digital Group",
      "url": "https://memoryapi.org",
      "email": "dmski100@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://euro.memoryapi.org",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PAYMENT",
        "description": "x402 payment header (Base64-encoded payment payload). Send $0.001 USDC on Base (eip155:8453)."
      }
    }
  },
  "paths": {
    "/x402/euro/rates": {
      "get": {
        "operationId": "getEcbRates",
        "summary": "ECB Exchange & Interest Rates",
        "description": "Get live EUR exchange rates against major currencies from the ECB Statistical Data Warehouse, or ECB key interest rates (ESTR).",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "fx (exchange rates, default) or rates (interest rates)",
            "schema": {
              "type": "string",
              "enum": [
                "fx",
                "rates"
              ],
              "default": "fx"
            }
          },
          {
            "name": "currencies",
            "in": "query",
            "description": "Comma-separated currency codes (default: USD,GBP,JPY,CHF,CNY)",
            "schema": {
              "type": "string",
              "default": "USD,GBP,JPY,CHF,CNY"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exchange or interest rates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "rates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "currency": {
                            "type": "string"
                          },
                          "rate": {
                            "type": "number"
                          },
                          "vs_eur": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/x402/euro/eurostat": {
      "get": {
        "operationId": "getEurostatData",
        "summary": "Eurostat EU Economic Statistics",
        "description": "EU economic statistics from Eurostat. GDP, HICP inflation, unemployment rates, and trade data for major EU member states.",
        "parameters": [
          {
            "name": "indicator",
            "in": "query",
            "description": "Economic indicator to retrieve",
            "schema": {
              "type": "string",
              "enum": [
                "gdp",
                "inflation",
                "unemployment",
                "trade"
              ],
              "default": "gdp"
            }
          },
          {
            "name": "countries",
            "in": "query",
            "description": "Comma-separated EU country codes (default: DE,FR,IT,ES,NL,PL,BE,SE,AT,DK)",
            "schema": {
              "type": "string",
              "default": "DE,FR,IT,ES,NL,PL,BE,SE,AT,DK"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "EU economic statistics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "indicator": {
                      "type": "string"
                    },
                    "countries_count": {
                      "type": "integer"
                    },
                    "latest_period": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "period": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/x402/euro/money": {
      "get": {
        "operationId": "getMoneySupply",
        "summary": "ECB Monetary / Money Supply Data",
        "description": "M3 money supply for the Euro Area or TARGET2 interbank settlement balances. Returns the last 12 monthly observations.",
        "parameters": [
          {
            "name": "series",
            "in": "query",
            "description": "m3 (M3 money supply, default) or target2 (TARGET2 balances)",
            "schema": {
              "type": "string",
              "enum": [
                "m3",
                "target2"
              ],
              "default": "m3"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Monetary data observations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "series": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "observations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "period": {
                            "type": "string"
                          },
                          "value": {
                            "type": "number"
                          },
                          "unit": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "latest": {
                      "type": "object"
                    },
                    "source": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment required"
          }
        },
        "x-price": "$0.001 USDC"
      }
    },
    "/mcp": {
      "get": {
        "operationId": "mcpInfo",
        "summary": "MCP Server Info",
        "description": "Returns AgentEuro MCP server metadata and available tool names.",
        "security": [],
        "responses": {
          "200": {
            "description": "MCP server info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "transport": {
                      "type": "string"
                    },
                    "protocol": {
                      "type": "string"
                    },
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mcpCall",
        "summary": "MCP Tool Call",
        "description": "Execute MCP tools: get_ecb_rates, get_eurostat_data, get_money_supply.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "example": "2.0"
                  },
                  "method": {
                    "type": "string",
                    "example": "tools/call"
                  },
                  "params": {
                    "type": "object"
                  },
                  "id": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}