{
  "openapi": "3.1.0",
  "info": {
    "title": "aipp.dev Smart Router API",
    "version": "1.0.0",
    "description": "Intelligent, dual-rail HTTP 402 router for autonomous AI agents.",
    "contact": {
      "email": "info@aipp.dev",
      "url": "https://aipp.dev"
    }
  },
  "servers": [
    {
      "url": "https://aipp.dev",
      "description": "Production Smart Router"
    }
  ],
  "paths": {
    "/v1/route": {
      "post": {
        "summary": "Find optimal provider route for agent intent",
        "description": "Compares live providers by price, latency, and uptime, returning the winning endpoint.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["intent"],
                "properties": {
                  "intent": { "type": "string", "example": "bitcoin fees" },
                  "paymentRail": { "type": "string", "enum": ["l402", "x402", "mpp"], "default": "l402" },
                  "maxBudgetSats": { "type": "integer", "default": 100 },
                  "minConformanceScore": { "type": "integer", "default": 80 }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Routing successful with selected quote and alternatives." },
          "400": { "description": "Invalid intent or no eligible provider found." }
        }
      }
    },
    "/v1/execute": {
      "post": {
        "summary": "Execute intent with 402 micropayment",
        "description": "Relays payment challenge and streams verified execution result.",
        "responses": {
          "200": { "description": "Execution verified and payload returned." },
          "402": { "description": "Payment required challenge (L402 or x402)." }
        }
      }
    },
    "/v1/taxonomy": {
      "get": {
        "summary": "Retrieve indexed capabilities taxonomy",
        "responses": {
          "200": { "description": "Taxonomy tree and category counts." }
        }
      }
    },
    "/v1/capabilities": {
      "get": {
        "summary": "Search indexed provider capabilities",
        "responses": {
          "200": { "description": "List of matching capabilities and health metrics." }
        }
      }
    }
  }
}
