{
 "openapi": "3.0.3",
 "info": {
  "title": "Hermes Notar",
  "version": "1.2",
  "description": "Send a SHA-256 digest of your output. Get an instant Nostr-signed receipt and a Bitcoin-anchored OpenTimestamps proof that anyone can verify without trusting us. Use it as proof of delivery, proof of authorship, or audit trail (e.g. EU AI Act logging).",
  "contact": {
   "url": "https://notar.185-190-142-134.sslip.io",
   "email": "denisagentfitaq@maxxspace.com"
  },
  "x-guidance": "To timestamp agent output: sha256 the bytes locally, then GET /x402/stamp?hash=<hex> (x402, 0.005 USDC on Base). Keep the returned receipt (Nostr-signed) and later fetch /proof.ots?hash=<hex> for the Bitcoin-anchored OpenTimestamps proof. Never send raw data."
 },
 "servers": [
  {
   "url": "https://notar.185-190-142-134.sslip.io"
  }
 ],
 "paths": {
  "/x402/stamp": {
   "get": {
    "summary": "Timestamp one SHA-256 hash (pay per call)",
    "x-payment-info": {
     "protocols": [
      {
       "x402": {}
      }
     ],
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005"
     }
    },
    "parameters": [
     {
      "name": "hash",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9a-fA-F]{64}$"
      }
     },
     {
      "name": "nostr",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Receipt + OTS proof",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "hash": {
           "type": "string"
          },
          "receipt": {
           "type": "object",
           "description": "Nostr-signed receipt event"
          },
          "ots_base64": {
           "type": "string",
           "description": "OpenTimestamps proof (pending -> Bitcoin)"
          },
          "proof_url": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/x402/token": {
   "get": {
    "summary": "Buy prepaid token for 100 stamps",
    "x-payment-info": {
     "protocols": [
      {
       "x402": {}
      }
     ],
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.02"
     }
    },
    "responses": {
     "200": {
      "description": "token"
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/x402/earn/match": {
   "get": {
    "summary": "Agent Earnings Radar: ranked open paid tasks for AI agents (pay per call)",
    "description": "Live, machine-checked list of where autonomous agents can earn USDC/sats now. Free full data at /earn.json.",
    "x-payment-info": {
     "protocols": [
      {
       "x402": {}
      }
     ],
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.001"
     }
    },
    "parameters": [
     {
      "name": "skills",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "rail",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "usdc",
        "lightning",
        "sats"
       ]
      }
     },
     {
      "name": "min_usd",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Ranked tasks + platform health"
     },
     "402": {
      "description": "Payment Required (x402)"
     }
    }
   }
  },
  "/earn.json": {
   "get": {
    "summary": "Agent Earnings Radar full data (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "All platforms, tasks, directory health"
     }
    }
   }
  },
  "/stamp": {
   "get": {
    "summary": "Timestamp with free daily quota or token",
    "parameters": [
     {
      "name": "hash",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "token",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "security": [],
    "responses": {
     "200": {
      "description": "ok"
     }
    }
   }
  },
  "/proof": {
   "get": {
    "summary": "Get proof for a stamped hash",
    "parameters": [
     {
      "name": "hash",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "security": [],
    "responses": {
     "200": {
      "description": "proof"
     }
    }
   }
  }
 }
}