{"openapi":"3.0.3","info":{"title":"BunnBase & BunnVault API","description":"Infraestructura financiera y de inteligencia autónoma operando en Base Mainnet.\nSoporta descubrimiento EIP-8004, pagos programáticos M2M (x402), gestión de fondos en Aave V3\ny atestaciones on-chain via EAS. Todos los endpoints pagados usan el protocolo x402 (eip155:8453).\n","version":"2.1.0","contact":{"name":"BunnBase Team","url":"https://bunnvault.xyz"},"x-logo":{"url":"https://bunnvault.xyz/vault/bunnvault-icon.png"},"x-category":"DeFi","x-tags":["defi","aave","usdc","base","ai-agent","treasury","x402","mcp"]},"servers":[{"url":"https://bunnvault.xyz","description":"Production Server (Base Mainnet)"},{"url":"http://localhost:3000","description":"Local Development"}],"paths":{"/info":{"get":{"summary":"Información general del agente","description":"Retorna la identidad, dirección de la wallet y capacidades públicas del agente.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","example":"BunnBase Agent"},"address":{"type":"string","example":"0xcDd5CB6ab2b9c5f3D2Bae896CE516b65010C1f4E"},"basename":{"type":"string","example":"bunnbase.base.eth"}}}}}}}}},"/.well-known/agent.json":{"get":{"summary":"Ficha de descubrimiento EIP-8004","description":"Endpoint estándar legible por máquinas/agentes de IA para auto-descubrimiento.","responses":{"200":{"description":"OK"}}}},"/.well-known/x402-routes":{"get":{"summary":"Manifiesto de rutas x402 — Bazaar Dynamic Routes","description":"Endpoint público que devuelve el manifiesto completo de todas las rutas x402 pagables.\nUsado por el crawler de Bazaar/CDP para indexar TODOS los endpoints de una sola vez\nsin requerir pagos individuales por endpoint.\nReferencia: https://github.com/x402-foundation/x402/blob/main/docs/extensions/bazaar.mdx\n","responses":{"200":{"description":"Manifiesto de rutas x402 completo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BazaarManifest"}}}}}}},"/api/x402-routes":{"get":{"summary":"Alias del manifiesto x402 (diagnóstico)","description":"Alias de /.well-known/x402-routes para diagnóstico manual y documentación.","responses":{"200":{"description":"Manifiesto de rutas x402 completo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BazaarManifest"}}}}}}},"/capabilities":{"get":{"summary":"Lista de capacidades del agente","responses":{"200":{"description":"OK"}}}},"/ask":{"post":{"summary":"Consulta pública al agente (Free Tier)","description":"Envía un prompt al agente BunnBase con límite de tasa básico. Sin pago requerido.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","example":"¿Cuál es el balance actual del vault?"}}}}}},"responses":{"200":{"description":"OK"}}}},"/api/premium-ask":{"post":{"summary":"Consulta Premium al agente de IA (x402 — $0.05 USDC)","description":"Acceso prioritario al cerebro de BunnBase (Gemini 2.5 Flash + AgentKit completo).\n**Precio:** $0.05 USDC por solicitud\n**Red:** eip155:8453 (Base Mainnet)\n**Token:** USDC — 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","description":"Tu pregunta o tarea para el agente de IA","example":"Analyze Aave v3 yields on Base"},"sessionId":{"type":"string","description":"ID de sesión opcional para continuidad de conversación"}}}}}},"responses":{"200":{"description":"Respuesta del agente de IA","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"string"},"metadata":{"type":"object","properties":{"model":{"type":"string","example":"gemini-2.5-flash"},"tokens":{"type":"integer"}}}}}}}},"402":{"description":"Payment Required — x402 challenge","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/bridge":{"post":{"deprecated":true,"summary":"[RETIRED — 410 Gone] Legacy BunnPay M2M USDC Bridge","description":"Permanently retired (returns `410 Gone`). Custodial USDC bridging via BunnBase's hot wallet is disabled.\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetAddress","amountUsdc"],"properties":{"targetAddress":{"type":"string","description":"Dirección wallet destinataria (0x...)","example":"0x0000000000000000000000000000000000000000"},"amountUsdc":{"type":"string","description":"Monto a enviar en USDC","example":"5.00"}}}}}},"responses":{"200":{"description":"Transacción completada exitosamente.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"txHash":{"type":"string"},"amountSent":{"type":"string"},"fee":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/lend/vault":{"get":{"summary":"Métricas de Bóveda Coinbase CDP Lend (Morpho Steakhouse)","description":"Retorna APY actual, contrato on-chain en Base, Vault ID y rendimiento para usuarios.","responses":{"200":{"description":"OK"}}}},"/api/lend/redeem-fees":{"post":{"summary":"Redimir comisiones acumuladas de rendimiento (Yield Cut)","description":"Cobra el 20% de comisiones generadas por los usuarios y las convierte en USDC líquido en la wallet del agente.","responses":{"200":{"description":"OK"}}}},"/api/vault/status":{"get":{"summary":"Estado general de BunnVault (free)","description":"Retorna balances globales del pool, fondos en Aave y estado operativo.","responses":{"200":{"description":"OK"}}}},"/api/vault/balance/{address}":{"get":{"summary":"Balance de un depositante en BunnVault (free)","description":"Retorna balance USDC, porcentaje de participación del pool, APY estimado y rendimiento diario.","parameters":[{"in":"path","name":"address","required":true,"schema":{"type":"string"},"example":"0x0000000000000000000000000000000000000001"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string"},"balance":{"type":"string"},"currency":{"type":"string"},"poolShare":{"type":"string"},"estimatedAPY":{"type":"string"},"estimatedDailyYield":{"type":"string"},"status":{"type":"string"},"history":{"type":"array","items":{"type":"object"}}}}}}}}}},"/api/vault/apy":{"get":{"summary":"APY de Aave v3 USDC en tiempo real (x402 — $0.005 USDC)","description":"Feed en tiempo real del APY de USDC en Aave v3 en Base Mainnet.\n**Precio:** $0.005 USDC por solicitud\n**Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"responses":{"200":{"description":"APY actual de Aave v3 USDC","content":{"application/json":{"schema":{"type":"object","properties":{"apy":{"type":"number","example":0.0487},"apyPercent":{"type":"string","example":"4.87%"},"protocol":{"type":"string","example":"Aave v3"},"asset":{"type":"string","example":"USDC"},"network":{"type":"string","example":"Base Mainnet"},"timestamp":{"type":"integer"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/vault/withdraw-message":{"get":{"deprecated":true,"summary":"[RETIRED] Legacy EIP-191 withdrawal message","description":"Retired (410 Gone). All Earn deposits and withdrawals now interact directly with the non-custodial Morpho VaultV2 ERC-4626 contract (0x98FE7d3fd95A44FbFE80c1594F6203Ad8e48D3Fe) on Base Mainnet.","parameters":[{"in":"query","name":"address","required":true,"schema":{"type":"string"}},{"in":"query","name":"amount","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"timestamp":{"type":"integer"}}}}}}}}},"/api/vault/withdraw":{"post":{"deprecated":true,"summary":"[RETIRED] Legacy custodial USDC withdrawal","description":"Retired (410 Gone). Withdraw directly via ERC-4626 withdraw()/redeem() on Morpho VaultV2 (0x98FE7d3fd95A44FbFE80c1594F6203Ad8e48D3Fe) on Base Mainnet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","amount","timestamp","signature"],"properties":{"address":{"type":"string"},"amount":{"type":"string"},"timestamp":{"type":"integer"},"signature":{"type":"string"}}}}}},"responses":{"200":{"description":"Retiro procesado on-chain en Base."},"400":{"description":"Firma inválida, desactualizada o parámetros incorrectos."}}}},"/api/vault/reputation":{"post":{"summary":"Oráculo de reputación on-chain via EAS (x402 — $0.005 USDC)","description":"Calcula el Trust Score de un agente basado en atestaciones EAS y actividad histórica en Base.\n**Precio:** $0.005 USDC por solicitud\n**Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address"],"properties":{"address":{"type":"string","description":"Dirección del agente a consultar (0x...)","example":"0x0000000000000000000000000000000000000001"}}}}}},"responses":{"200":{"description":"Trust Score y datos de reputación","content":{"application/json":{"schema":{"type":"object","properties":{"trustScore":{"type":"integer","description":"Puntaje de confianza 0–100","example":85},"totalAttestations":{"type":"integer","example":10},"history":{"type":"array","items":{"type":"object"}},"address":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/vault/manage":{"post":{"deprecated":true,"summary":"[RETIRED — 410 Gone] Legacy Custodial Treasury-as-a-Service","description":"Permanently retired (returns `410 Gone`). Use `POST /api/lend/route` ($0.02 USDC x402) for 100% non-custodial Morpho VaultV2 ERC-4626 calldata routing.\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agentAddress"],"properties":{"agentAddress":{"type":"string","description":"Dirección wallet del agente a gestionar (0x...)","example":"0x0000000000000000000000000000000000000001"},"action":{"type":"string","enum":["deposit","withdraw","rebalance","status"],"description":"Acción de treasury a ejecutar"},"amountUsdc":{"type":"string","description":"Monto en USDC para depósito o retiro"}}}}}},"responses":{"200":{"description":"Estado de la gestión del treasury","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"active"},"currentBalance":{"type":"string","example":"10.00 USDC"},"aaveBalance":{"type":"string","example":"9.50 USDC"},"pendingYield":{"type":"string","example":"0.04 USDC"},"lastAction":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/mcp":{"post":{"summary":"BunnBase MCP Server — Model Context Protocol (x402 — $0.05 USDC)","description":"Ejecuta herramientas y consultas en el agente BunnBase vía Model Context Protocol (MCP).\nSoporta: tools/list, tools/call, resources/list.\n**Precio:** $0.05 USDC por llamada\n**Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["method"],"properties":{"method":{"type":"string","description":"Método MCP (tools/list, tools/call, etc.)","example":"tools/call"},"params":{"type":"object","description":"Parámetros del método MCP","example":{"name":"get_bunncoin_info","arguments":{}}},"id":{"type":"string","description":"ID de solicitud JSON-RPC opcional"}}}}}},"responses":{"200":{"description":"Respuesta JSON-RPC 2.0 del servidor MCP","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","example":"2.0"},"result":{"type":"object"},"id":{"type":"string"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/bet/forecasts":{"get":{"summary":"Pronósticos activos del Prediction Market (free)","description":"Retorna los pronósticos de precio cripto activos generados por BunnBase.","responses":{"200":{"description":"Lista de pronósticos activos","content":{"application/json":{"schema":{"type":"object","properties":{"forecasts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"asset":{"type":"string"},"direction":{"type":"string","enum":["up","down"]},"confidence":{"type":"number"},"expiresAt":{"type":"string","format":"date-time"}}}}}}}}}}}},"/api/bet/place":{"post":{"summary":"Apostar USDC en el Prediction Market (x402 — mín $0.50 USDC)","description":"Apuesta USDC contra el pronóstico de precio a 1 hora del agente BunnBase.\nSi el agente pierde, recibes 2x tu apuesta.\n**Precio mínimo:** $0.50 USDC | **Máximo:** $5.00 USDC\n**Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["forecastId","amount"],"properties":{"forecastId":{"type":"string","description":"ID del pronóstico de /api/bet/forecasts","example":"fb-BTC-1h-up-12345"},"amount":{"type":"number","description":"Monto de apuesta en USDC (mín $0.50, máx $5.00)","example":1},"userAddress":{"type":"string","description":"Tu wallet address para recibir pagos (0x...)"}}}}}},"responses":{"200":{"description":"Apuesta registrada exitosamente","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"bet_placed"},"betId":{"type":"string"},"potentialPayout":{"type":"string","example":"$2.00 USDC"},"forecastId":{"type":"string"},"resolves":{"type":"string","format":"date-time"}}}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/stocks/live-console":{"get":{"summary":"Telemetría en vivo de acciones tokenizadas Coinbase B20 (Gratis)","description":"Retorna las posiciones on-chain de acciones tokenizadas B20 del agente soberano BunnBase,\nestado de los oráculos Chainlink 24/5, multiplicadores ERC-8056 y progreso del Compute-Hedge.\n","responses":{"200":{"description":"Estado en vivo de BunnConsole B20","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/stocks/b20-preflight/{ticker}":{"get":{"summary":"B20 Pre-Flight Safety Oracle (x402 — $0.005 USDC)","description":"Oráculo A2A de seguridad pre-swap para acciones tokenizadas Coinbase B20 en Base Mainnet.\nVerifica ventana 24/5 y heartbeat de Chainlink, multiplicador de dividendos ERC-8056 (`uiMultiplier`),\n`paused_features` de acciones corporativas y spread en pools Uniswap V3.\n**Precio:** $0.005 USDC | **Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"parameters":[{"name":"ticker","in":"path","required":true,"description":"Símbolo del activo B20 (ej. NVDA, GOOGL, MSFT, AAPL, AMZN, META, TSLA)","schema":{"type":"string","example":"NVDA"}},{"name":"amountUsdc","in":"query","required":false,"description":"Tamaño opcional en USDC para cotizar slippage en Uniswap V3 (default 1.00)","schema":{"type":"number","example":1}}],"responses":{"200":{"description":"Veredicto de seguridad Pre-Flight y cotización on-chain","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment Required ($0.005 USDC on Base)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/stocks/compute-hedge":{"post":{"summary":"Sovereign Compute-Hedge Basket API (x402 — $0.02 USDC)","description":"Recibe el gasto mensual estimado de cómputo LLM/GPU de un agente autónomo y su proveedor principal\n(`gemini`, `openai`, `anthropic`, `aws`, `gcp`, `llama`) y devuelve una canasta ponderada de acciones\ntokenizadas Coinbase B20 en Base con cotizaciones en vivo de Uniswap V3 y verificación Chainlink 24/5.\n**Precio:** $0.02 USDC | **Red:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["monthlyCostUsd"],"properties":{"provider":{"type":"string","description":"Proveedor primario de inferencia/GPU (gemini, openai, anthropic, aws, gcp, llama)","example":"gemini"},"monthlyCostUsd":{"type":"number","description":"Gasto mensual estimado de cómputo en USD","example":25}}}}}},"responses":{"200":{"description":"Canasta B20 recomendada con cotizaciones de Uniswap V3 en vivo","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment Required ($0.02 USDC on Base)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/lend/route":{"post":{"summary":"Morpho Yield & Calldata Router (x402 — $0.02 USDC)","description":"100% non-custodial ERC-4626 calldata router for Morpho VaultV2 (`0x98FE7d3fd95A44FbFE80c1594F6203Ad8e48D3Fe`) on Base Mainnet.\nReturns live APY, `previewDeposit`/`previewWithdraw` simulation, and ready-to-sign `approve` + `deposit`/`withdraw` calldata.\n**Price:** $0.02 USDC | **Network:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet","amountUsdc"],"properties":{"wallet":{"type":"string","example":"0x1234567890abcdef1234567890abcdef12345678"},"amountUsdc":{"type":"number","example":100},"action":{"type":"string","enum":["deposit","withdraw"],"default":"deposit"}}}}}},"responses":{"200":{"description":"Live Morpho VaultV2 telemetry and ready-to-sign ERC-4626 calldata","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment Required ($0.02 USDC on Base)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/agents/verify":{"post":{"summary":"KYA — Know Your Agent Verifier (x402 — $0.01 USDC)","description":"Multi-signal Know-Your-Agent verification on Base Mainnet: checks ERC-8004 Identity Registry,\nEAS Reputation Score, Base on-chain activity, and optional SSRF-safe `/.well-known/agent.json` liveness.\n**Price:** $0.01 USDC | **Network:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","example":"0xcDd5CB6ab2b9c5f3D2Bae896CE516b65010C1f4E"},"agentId":{"type":"integer","example":55673},"endpointUrl":{"type":"string","example":"https://bunnvault.xyz"}}}}}},"responses":{"200":{"description":"Composite KYA Trust Score (0-100) and multi-signal breakdown","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment Required ($0.01 USDC on Base)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/stocks/b20-scanner":{"get":{"summary":"B20 Liquidity & Spread Scanner (x402 — $0.02 USDC)","description":"Multi-ticker Coinbase B20 tokenized stock scanner on Base Mainnet (`NVDAc`, `GOOGLc`, `ANTc`, `MSFTc`, `AAPLc`, `METAc`).\nReturns Chainlink 24/5 status, ERC-8056 dividend multiplier, Uniswap V3 spread vs NAV, and non-custodial swap calldata.\n**Price:** $0.02 USDC | **Network:** eip155:8453 (Base Mainnet)\n","security":[{"X402Payment":[]}],"parameters":[{"name":"tickers","in":"query","required":false,"schema":{"type":"string","example":"NVDA,GOOGL,ANT,MSFT,AAPL,META"}},{"name":"amountUsdc","in":"query","required":false,"schema":{"type":"number","example":10}},{"name":"recipient","in":"query","required":false,"schema":{"type":"string","example":"0x1234567890abcdef1234567890abcdef12345678"}}],"responses":{"200":{"description":"Ranked B20 liquidity & spread scan with optional ready-to-sign swap calldata","content":{"application/json":{"schema":{"type":"object"}}}},"402":{"description":"Payment Required ($0.02 USDC on Base)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}}},"components":{"securitySchemes":{"X402Payment":{"type":"apiKey","in":"header","name":"X-PAYMENT","description":"Payment proof generado por @x402/fetch o @coinbase/x402 SDK tras recibir el HTTP 402 challenge.\nFlujo:\n1. Hacer la solicitud sin cabecera de pago → recibir HTTP 402 con X402Challenge\n2. Firmar el payment con @x402/fetch o npx awal x402 pay <url>\n3. Reintentar con la cabecera X-PAYMENT incluida\n"}},"schemas":{"X402Challenge":{"type":"object","description":"HTTP 402 Payment Required — Challenge del protocolo x402 v2.\nEl cliente procesa este challenge con @x402/fetch o el SDK de Coinbase.\n","required":["x402Version","accepts","error"],"properties":{"x402Version":{"type":"integer","example":2},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string","example":"exact"},"network":{"type":"string","example":"eip155:8453"},"payTo":{"type":"string","example":"0xcDd5CB6ab2b9c5f3D2Bae896CE516b65010C1f4E"},"asset":{"type":"string","example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"amount":{"type":"string","description":"Monto en unidades atómicas de USDC (6 decimales)","example":"100000"},"maxTimeoutSeconds":{"type":"integer","example":60}}}},"error":{"type":"string","example":"Payment required"}}},"BazaarManifest":{"type":"object","description":"Manifiesto de rutas x402 para indexación automática en Bazaar/Agentic Market","properties":{"x402Version":{"type":"integer","example":2},"provider":{"type":"object","properties":{"name":{"type":"string","example":"BunnVault"},"url":{"type":"string","example":"https://bunnvault.xyz"},"description":{"type":"string"},"iconUrl":{"type":"string","example":"https://bunnvault.xyz/vault/bunnvault-icon.png"},"category":{"type":"string","example":"DeFi"},"tags":{"type":"array","items":{"type":"string"}}}},"generatedAt":{"type":"string","format":"date-time"},"routes":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"method":{"type":"string"},"description":{"type":"string"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}}}}}