{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentSpec API",
    "version": "0.2.0",
    "description": "Inspect OpenAPI specs, MCP tools, and API docs, then generate agent-ready x402 Bazaar metadata.",
    "x-guidance": "Use AgentSpec when you need to evaluate whether an API or MCP tool surface is ready for autonomous agents. Call POST /inspect/openapi with an OpenAPI document, POST /inspect/mcp with MCP tool metadata, POST /score/agent-readiness for a compact score, or POST /generate/bazaar-metadata to draft an x402 Bazaar listing payload."
  },
  "servers": [
    {
      "url": "https://agentspec-one.vercel.app"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Return service health.",
        "responses": {
          "200": {
            "description": "Service is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "service": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "ok",
                    "service"
                  ]
                },
                "example": {
                  "ok": true,
                  "service": "AgentSpec"
                }
              }
            }
          }
        }
      }
    },
    "/x402/routes": {
      "get": {
        "operationId": "listX402Routes",
        "summary": "List AgentSpec paid route metadata.",
        "responses": {
          "200": {
            "description": "Paid route catalog and current payment configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/inspect/openapi": {
      "post": {
        "operationId": "inspect_openapi",
        "summary": "Inspect an OpenAPI spec and return agent-readiness score, risks, recommendations, and x402 Bazaar candidates.",
        "description": "Inspect an OpenAPI spec and return agent-readiness score, risks, recommendations, and x402 Bazaar candidates. Price suggestion: 0.03 USDC per call.",
        "x-agentspec-pricing": {
          "amount": "0.03",
          "currency": "USDC",
          "unit": "per call",
          "category": "developer-tools"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.030000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "spec": {
                  "openapi": "3.1.0",
                  "info": {
                    "title": "Example",
                    "version": "1.0.0"
                  },
                  "paths": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "score": 86,
                  "grade": "B",
                  "recommendations": []
                }
              }
            }
          },
          "402": {
            "description": "Payment required when x402 payment mode is enabled.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 payment requirements JSON.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "x402Version": {
                      "type": "integer"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "error",
                    "x402Version",
                    "accepts"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "501": {
            "description": "Payment signature was supplied, but local no-dependency settlement is not configured."
          }
        }
      }
    },
    "/inspect/mcp": {
      "post": {
        "operationId": "inspect_mcp",
        "summary": "Inspect MCP tools and return agent-readiness score, risky tools, missing schemas, and marketplace candidates.",
        "description": "Inspect MCP tools and return agent-readiness score, risky tools, missing schemas, and marketplace candidates. Price suggestion: 0.03 USDC per call.",
        "x-agentspec-pricing": {
          "amount": "0.03",
          "currency": "USDC",
          "unit": "per call",
          "category": "developer-tools"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.030000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "name": "Example service"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "score": 86,
                  "grade": "B",
                  "recommendations": []
                }
              }
            }
          },
          "402": {
            "description": "Payment required when x402 payment mode is enabled.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 payment requirements JSON.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "x402Version": {
                      "type": "integer"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "error",
                    "x402Version",
                    "accepts"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "501": {
            "description": "Payment signature was supplied, but local no-dependency settlement is not configured."
          }
        }
      }
    },
    "/generate/bazaar-metadata": {
      "post": {
        "operationId": "generate_bazaar_metadata",
        "summary": "Generate x402 Bazaar metadata draft from an AgentSpec report or service description.",
        "description": "Generate x402 Bazaar metadata draft from an AgentSpec report or service description. Price suggestion: 0.05 USDC per call.",
        "x-agentspec-pricing": {
          "amount": "0.05",
          "currency": "USDC",
          "unit": "per call",
          "category": "developer-tools"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.050000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "name": "Example service"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "score": 86,
                  "grade": "B",
                  "recommendations": []
                }
              }
            }
          },
          "402": {
            "description": "Payment required when x402 payment mode is enabled.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 payment requirements JSON.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "x402Version": {
                      "type": "integer"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "error",
                    "x402Version",
                    "accepts"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "501": {
            "description": "Payment signature was supplied, but local no-dependency settlement is not configured."
          }
        }
      }
    },
    "/score/agent-readiness": {
      "post": {
        "operationId": "score_agent_readiness",
        "summary": "Return a compact agent-readiness score for OpenAPI or MCP input.",
        "description": "Return a compact agent-readiness score for OpenAPI or MCP input. Price suggestion: 0.02 USDC per call.",
        "x-agentspec-pricing": {
          "amount": "0.02",
          "currency": "USDC",
          "unit": "per call",
          "category": "developer-tools"
        },
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              },
              "example": {
                "name": "Example service"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "example": {
                  "score": 86,
                  "grade": "B",
                  "recommendations": []
                }
              }
            }
          },
          "402": {
            "description": "Payment required when x402 payment mode is enabled.",
            "headers": {
              "PAYMENT-REQUIRED": {
                "description": "Base64-encoded x402 payment requirements JSON.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "x402Version": {
                      "type": "integer"
                    },
                    "accepts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "required": [
                    "error",
                    "x402Version",
                    "accepts"
                  ],
                  "additionalProperties": true
                }
              }
            }
          },
          "501": {
            "description": "Payment signature was supplied, but local no-dependency settlement is not configured."
          }
        }
      }
    }
  }
}