{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentResolver API",
    "version": "0.1.0",
    "description": "Free capability resolution across AgentResolver-owned capabilities, live MCP directories, and x402 marketplace services."
  },
  "servers": [
    { "url": "https://agentresolver.vercel.app" }
  ],
  "paths": {
    "/api/resolve": {
      "post": {
        "operationId": "resolveCapability",
        "summary": "Resolve a natural-language goal to machine capabilities",
        "description": "Resolution is free. The resolver searches AgentResolver-owned capabilities, privacy-safe live MCP directory matches, and x402 marketplace services. Arbitrary goal text is not forwarded to MCP directories; only locally derived generic capability terms may be used for third-party MCP search.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["goal"],
                "properties": {
                  "goal": { "type": "string", "maxLength": 1000 },
                  "url": { "type": "string", "format": "uri", "maxLength": 2048 },
                  "limit": { "type": "integer", "minimum": 1, "maximum": 10, "default": 3 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolution containing owned, mcp, and marketplace match arrays"
          },
          "400": { "description": "Invalid input" }
        }
      }
    },
    "/api/execute": {
      "post": {
        "operationId": "executeCapability",
        "summary": "Resolve the direct endpoint for a free capability; generic paid execution is disabled",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["capabilityId"],
                "properties": {
                  "capabilityId": { "type": "string" },
                  "input": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Direct endpoint guidance for a free capability" },
          "404": { "description": "Unknown capability" },
          "503": {
            "description": "Capability is not live or generic paid execution is intentionally disabled"
          }
        }
      }
    }
  }
}
