{
  "openapi": "3.1.0",
  "info": {
    "title": "Reverse Agent API by reverse.captcha",
    "version": "0.5.0",
    "description": "Pay-per-use security and web utilities for autonomous agents. The catalog includes Agent Identity & Access, Web Evidence Snapshot, and Source Freshness Check. Authorization proves control of an approved key, not absence of human direction.",
    "x-guidance": "Pay-per-call security and web utilities for autonomous agents, paid in USDC on Base via x402 (no account or API key). POST /v1/paid/evidence {url} fetches a public HTTPS URL and returns a point-in-time evidence package (status, redirects, SHA-256 content hash, metadata, excerpt). POST /v1/paid/freshness {url, max_age_seconds} says whether a source is fresh, stale or unknown from observable timestamps. POST /v1/paid/register {name, public_key} registers an Ed25519 agent identity and returns a signed BOT PASSPORT; POST /v1/paid/tiers/pro {agent_id} upgrades it. Failed fetches are never charged.",
    "contact": {
      "name": "reverse.captcha",
      "url": "https://reversecaptcha.fun"
    }
  },
  "servers": [
    {
      "url": "https://reversecaptcha.fun"
    }
  ],
  "x-discovery": {
    "ownershipProofs": [
      "0x87e8d821649a61815e4fa61d892fca13b7d07028"
    ]
  },
  "paths": {
    "/v1/paid/register": {
      "post": {
        "operationId": "registerReverseCaptchaAgent",
        "summary": "Agent Identity & Access",
        "description": "Returns a signed BOT PASSPORT. The passport attests to key registration; it does not prove the agent is free from human control.",
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0x87e8d821649a61815e4fa61d892fca13b7d07028"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "public_key"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "public_key": {
                    "type": "string",
                    "description": "PEM-encoded Ed25519 public key. Never send a private key."
                  },
                  "capabilities": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent identity, signed BOT PASSPORT, and payment receipt"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/v1/paid/evidence": {
      "post": {
        "operationId": "snapshotUrlEvidence",
        "summary": "Web Evidence Snapshot",
        "description": "Returns status, final URL, selected provenance headers, content hash, page metadata, and a bounded text excerpt. Private and local network targets are blocked.",
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.030000"
          },
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0x87e8d821649a61815e4fa61d892fca13b7d07028"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Evidence snapshot and payment receipt"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/v1/paid/freshness": {
      "post": {
        "operationId": "checkSourceFreshness",
        "summary": "Source Freshness Check",
        "description": "Checks observable HTTP and publisher-declared timestamps against a requested maximum age. The result does not prove factual accuracy, authorship, or event time.",
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0x87e8d821649a61815e4fa61d892fca13b7d07028"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                  },
                  "max_age_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 2678400,
                    "default": 86400
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Freshness assessment, date evidence, bounded snapshot, and payment receipt"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          }
        }
      }
    },
    "/v1/services": {
      "get": {
        "operationId": "listAgentServices",
        "summary": "List paid agent services and prices",
        "security": [],
        "responses": {
          "200": {
            "description": "Service catalog"
          }
        }
      }
    },
    "/.well-known/reverse-captcha": {
      "get": {
        "operationId": "discoverReverseCaptcha",
        "summary": "Discover Reverse CAPTCHA protocol endpoints",
        "security": [],
        "responses": {
          "200": {
            "description": "Protocol discovery document"
          }
        }
      }
    },
    "/v1/paid/tiers/pro": {
      "post": {
        "operationId": "activateProTier",
        "summary": "Upgrade a registered agent to the Pro tier",
        "description": "Activate the hosted Pro tier for an agent registered via /v1/paid/register. Returns an updated signed passport.",
        "x-payment-info": {
          "protocols": [
            {
              "x402": {}
            }
          ],
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.050000"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "description": "Agent id from /v1/paid/register, e.g. bot_..."
                  }
                },
                "required": [
                  "agent_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tier activated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "PaymentRequired": {
        "description": "x402 v2 payment required",
        "headers": {
          "PAYMENT-REQUIRED": {
            "description": "Base64-encoded x402 v2 PaymentRequired object with Bazaar discovery metadata.",
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}