{"_id":"@bsvkey/x402-bsv-client","_rev":"15-599ba47a43e734eb2855fa66c2eeda12","name":"@bsvkey/x402-bsv-client","dist-tags":{"latest":"0.7.1"},"versions":{"0.1.0":{"name":"@bsvkey/x402-bsv-client","version":"0.1.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.1.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"08b97f1464bef61e5d94c62ed6041ca1e6640301","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.1.0.tgz","fileCount":5,"integrity":"sha512-dS+haH81GXf5sG8SXBku1SY0oQmDL1Sl+EmnkkvfsjqNb0AjfzMOQ5SOxJPggxRTPA0ekLGzCYlUR4+vfoa2hQ==","signatures":[{"sig":"MEYCIQCWnWcvhYvDN6313sPJ/hxP1qICPq9SER1g8iGAhsmsEwIhAOhwkwYm/U8cwZRBI5DoCcm+HMoZEd5TWanxa1zKNxfE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11504},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js"},"gitHead":"6e8eba6814a5adf6ec5fb13c5e6a37e0565358da","_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"peerDependencies":{"@bsv/sdk":"^1"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.1.0_1788580255226_0.27092157231418756","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bsvkey/x402-bsv-client","version":"0.1.1","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.1.1","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"fbbfee46e65930acbeb60ae0f3aabe731a3d6982","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.1.1.tgz","fileCount":5,"integrity":"sha512-y8T+i0UBVxYmVTTbB757i7XCpzqKx9vHtIZpVqLuUWKtZk/DQJdtA6gyF3fBFzQci/rKR7XIGfL0Vql3lGVHpQ==","signatures":[{"sig":"MEUCIQCe/3oBRj8Qk6ufp4zk6Rucb1PLYBTsLJ0uOOFEm+LjJAIgXqGtHmUY7BqcXtNblFc0QyTZIc+WxCwRJGN6yXQ6IXg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCfl6JiT3rGuMBY9A1ZoON0IhYUNVYQEhSuDYmeHViLJwIgTXOfUbEq1FK8Zr0KaFADVa9YNx6myBcnSCDxa6oOZjA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12948},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js"},"gitHead":"4abd261efdf96d703d0f648781bae67d509b550e","_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"peerDependencies":{"@bsv/sdk":"^1"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.1.1_1788620112866_0.25316858762787775","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bsvkey/x402-bsv-client","version":"0.2.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.2.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"fc3085f23601e7d0862b393a435944d4129d5377","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.2.0.tgz","fileCount":5,"integrity":"sha512-AMpgLshfDRA6FEgnj3aMm3GosFNZtjdieANP/AqvTeAYFRMLqkuFFRrkJ+OqJGjICCinYW2XMqkEPbiXB0Z1FQ==","signatures":[{"sig":"MEQCIGFNmf2bdrDt40JIqX2xT9Zv5faesdbMHGZVIyGUjbe8AiBUDZ46DqSOOjgheBTrctCKhA9YOF4jxyGCTPkaUX4csw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDuH6qfep0kp6sgDpe25Ef/0ndkoqeu5LAa4xs3ZVPaSAiEAo1TNS5qO4k6sbTdbccg2WBIp6Cq5QIWbkPFNzSzIjrs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13206},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js"},"gitHead":"d1d5c30d2df88fa18218fab86adcd91f4d507830","_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.2.0_1788750930338_0.28450242285932315","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@bsvkey/x402-bsv-client","version":"0.3.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.3.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"e7c94e651078dcebf69070f690921d168d53ec2a","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.3.0.tgz","fileCount":6,"integrity":"sha512-Go26ZcKMJu+YMEMCpZ3l+RB3P4pk9k0yMzJBJbyPGRwLvclB+eh6Fu+eOV90p9jt5hf+HkkYUSMaXuPeAIepbw==","signatures":[{"sig":"MEUCIQCisBp9XUb2pY9BiWEjWM6FbgOlvsa21mewc8ABr5fGoQIgb+3o4qiWgDaYp8IOaCbLltFxK+CqWM7ja8BtED+1o/4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIGARgvYZQV99/rVrR59cCyAcyXKKCM+GiJi6o7mGli4JAiAWS5p1pcg7FhD0NyKmBoaXheFwmBWGdKIx4/PgYDZHPw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20631},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"a32e05c0723e2797185ff94b941b5fd6e93f36a2","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.3.0_1788789453516_0.5406933109997014","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@bsvkey/x402-bsv-client","version":"0.3.1","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.3.1","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"eef575ef88e741807853b80ce00af0a39f7a9dc8","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.3.1.tgz","fileCount":6,"integrity":"sha512-SIM0JO6LztWsa1OE9Jzq3M84gO3JvDeaxyaqHo0oPXwzBPbVNCwniVCC8Mffkj9g3A9b7yhagiakvIRnd0o59A==","signatures":[{"sig":"MEQCIF9iW8KJVJJYvJcDFpxrQfopsKVgu5lU2sXSMDy/+EL+AiAC7+hWhJQKDuRTOGFOT4nOJjA+eId/sN9xyB+f+HzteA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICtH+Ozsc3dEav/1SXHOQQqhzh++fqHwqjM083b1Sl9pAiEAj6FJFJK/yK0CwR+q19dZw+zBYh51m5oEGEJqHVTHlP8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20613},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"987ed7a30e4855685e59b4e64b905ebe5f10cbbe","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.3.1_1788789538455_0.5815974491471849","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bsvkey/x402-bsv-client","version":"0.4.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"dab1f3bbab4168b14020ee6cd257de7cdb77c376","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.0.tgz","fileCount":6,"integrity":"sha512-ZtDz6jCl9NDQOoaoHHhIojEnM0eDEkNGhAYoybWQ1VVw33lNeQ5JB9F65GT+9rhXYTjn9el3IA0lNalpdn+a7Q==","signatures":[{"sig":"MEQCIFg5w6I4VxFfWVCmh7FhqmsckRAmL3TbqkOZ5OXL413RAiAUbGs9znxQyNPYDDHXQhuusREGfCZnxZtfnBEWeuV+Cw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCdsStcq/78QPKy8QfGE6TvXu0R/Qy5Kgv17nxST5fGiQIgDX57EputfXWuc7QVFNFCJ0aaLYKgeNC0evIXbBr8Dqc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24068},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"d5823581cc80c6a6f958f679f57ae3542c944aba","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.0_1788805820891_0.6985056724441885","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@bsvkey/x402-bsv-client","version":"0.4.1","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.1","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"697247b41d86d43c17b778fd536cd0588c750ab5","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.1.tgz","fileCount":6,"integrity":"sha512-dKFyhlmrY/H08oyHAN93/uXLP/XfOFMoImDpqePDX60pJFAjfEzh3TaEbJrIs2SL4Sx+aYJui6n6jmdwhPAYRw==","signatures":[{"sig":"MEYCIQCvXKyNcNc1YMzUqAzeNVjoPLxEPMwx65aN76vfhQQkPgIhANtRzYDFp4w92Hh5tflKtIfa3FnmBTFrcN2aMTlmrajA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFQkPFZwdE8IUZcDx3jH2+jmX/7Je5f/aH9ee7Pt4p33AiEA6WEmOY2pJw4icwBZzf+HeP5qzMoXf3h5LYMmaUc9708=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24068},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"93acb5b52b50e1eae83481b9fe5b4ca096fa67b5","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.1_1788806019208_0.3101618951514278","host":"s3://npm-registry-packages-npm-production"}},"0.4.2":{"name":"@bsvkey/x402-bsv-client","version":"0.4.2","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.2","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"3fa00806e49db3d49839f7f6029051d4c14d8ef0","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.2.tgz","fileCount":6,"integrity":"sha512-3lZDuT3JVyY+0dFTwic0tpXrgK++cxE0vCfFtI1k6kolOxfQrI6JFIFULNcAMKlTs7eEjCJ+kb2tSweOAJTlag==","signatures":[{"sig":"MEUCICoWHYconuSz7YI6ScbcoJ/Vn0GCnYRTgdkWLjPOidBbAiEA4hv045zoTr9yN6/5Qw8lBnSsGyt3/K4bz79fgO7qjIo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDhKw97AdHq9BuyAdJY+vgEBBIypRvugTFh+tCY1X6UNAiEA+wru/hN8dTMaTVpqYPEXP7/fklSjn5NazMto5dXMcb0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26033},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"853b97b1bd520be3ddcfcd6be0998222bc2bcb4d","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.2_1788808421735_0.29480235918411","host":"s3://npm-registry-packages-npm-production"}},"0.4.3":{"name":"@bsvkey/x402-bsv-client","version":"0.4.3","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.3","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"6ac901fa2251c9e60df08cf66f81afe172102e3b","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.3.tgz","fileCount":6,"integrity":"sha512-SYIakWsQur3F5GGIaaS0mOf449pDS6ZArcEq0n4LEL1Be0ieUwtFaM8G+OS21hOMhv1AD1BCCAaf+inJTIE2Ew==","signatures":[{"sig":"MEYCIQDzX2hHAkY+ckyMVwPcxUojXc4whDPcUd/gVQ18pu+7HQIhAJXuSvvG+AjCSFfRMRQwbNn77mptvLZuBVua7dT+H4l1","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCn0zoSJ7ptWMqkHUvlEQZqY3e1SBvX2HLscvl539trJwIgJUgU1zMsu0TkcMUInx50631o3Hk3ygdlkhxHJBPKP+I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27542},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"6708b9f9a7bc2466beee7b582bcd5ef73dee7558","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.3_1788918601138_0.5985416000965178","host":"s3://npm-registry-packages-npm-production"}},"0.4.4":{"name":"@bsvkey/x402-bsv-client","version":"0.4.4","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.4","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"3556ee14cf442ccd8abcca0c73bd5c216e0350cd","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.4.tgz","fileCount":6,"integrity":"sha512-NWDJ8/TD2PSTxkLye3Q72v81gi2+ysBPuS2eFCRWkQgEPEeKInQNF/5DXIXPV1UY21TFE8NBeNcu1mPNDnStIg==","signatures":[{"sig":"MEUCIEQSoyVzCN+n1FTmO3odROsTaeeqbImW9dBJDpzkt8kdAiEAsCsroZgMSbAHlIzMJYFRvuspMO/uM5hFaomBCvpNp+U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDboALZTsqD+llJXtzqmJGatlAUcSazKN3kH2p9hK2brgIhAKJbOHFPFQmI7r4mcvrxpaSs3p0DazIS2hqV23RL2CXu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28288},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"2481467ac305aa2e798d868bcd59b036e34776a4","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.4_1788919890103_0.5389853799442454","host":"s3://npm-registry-packages-npm-production"}},"0.4.5":{"name":"@bsvkey/x402-bsv-client","version":"0.4.5","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.4.5","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"38c81c91f97d1f99dec7a9c875c1adcee17129fb","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.4.5.tgz","fileCount":6,"integrity":"sha512-rN7BBp8+KPHA4R2WLmOzdjy17iDlOTkxtkUIrLYwUwYkvkGda41yj//G46JgVDDSe9jRZyHHPSTRHh61ubDqHA==","signatures":[{"sig":"MEYCIQDQmaajwuS7kr22RXsOCEKG5U6GeVKOu1/Kssbv4tk3LgIhANd0/t4VyfLjfPI6PmVuYwlBC0v3QaQNEjU+4anx+vaN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFI1SiVviudWpDTcdyn6Gq37umR8n9H9H6ltEb5wgrysAiEAgzqcN2kk/90LQz9yE/bNxvxl3Vi569vvVLw2OHmhw1s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29522},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"eb9b883722af2e23d4ce80c21285a531598680b0","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.4.5_1789053233476_0.5970503050264271","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@bsvkey/x402-bsv-client","version":"0.5.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.5.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"baf987f0189ab000455281b262e045fc3969d30e","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.5.0.tgz","fileCount":7,"integrity":"sha512-ungvBChwPxfMIk3QIVRz2TW27HfJsH86qTRVWuOuxgPFyxDqCseNpTDuwqpe8GV7QqIt2OL4wNYeNYnuvIwruA==","signatures":[{"sig":"MEYCIQCwEzHMna9vVzDRLD9aaWI3JayKYv0V4hkHtX8S7Re5YwIhALa9tg4Ya7in+thCDjQoFNygtv+UFopvtw3v5d8oBx1C","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIGsi2trnEsXSHVqe7YBZ6QeIDl4OWk783Oh6Z+hft4amAiAck9YPGIpYytg5374OfCFGEqUdtVBTMHJJv2YwptzPHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41976},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./x402-receipt":"./x402-receipt.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"eb9b883722af2e23d4ce80c21285a531598680b0","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts and per-call x402 delivered receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.5.0_1790042087388_0.9982184627630384","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@bsvkey/x402-bsv-client","version":"0.6.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.6.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"d95fc2d398e04df912e305c9d8c0e3ce769f490f","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.6.0.tgz","fileCount":7,"integrity":"sha512-+pNSCAZei40EADAHHJ/6xtiGLfhcbIDPED2HlbVxyBbgyuIamNVe+5RpYZsw9OedF8iGIgn8/ZZ0Bn2hkQ6DPw==","signatures":[{"sig":"MEUCIDeJY8sWqI0P0giUrvd7mekabIAnB2rHF9sgzj9Uzdh+AiEA4TFRHAdT3xe3bdOEwDKfmx8nRCqpFPeNarm5GtEZjBc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD0Cix7/etnIcmMK76OPuEfj6BmZK3bWAZMFRRoKg7enAIhAIzNbosCFM44M8vAf5mPZH7f3yONLCRbf5oHMq9EcIoO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45603},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./x402-receipt":"./x402-receipt.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"fad3beecfab9f4de8b4fd9644d4f13521698fa71","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts and per-call x402 delivered receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.6.0_1790139782872_0.44249690368228967","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@bsvkey/x402-bsv-client","version":"0.7.0","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","_id":"@bsvkey/x402-bsv-client@0.7.0","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"homepage":"https://inference.bsvkey.com/v1/x402","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"89b1a249a46ff47e7124c413ed5589ce70526e32","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.7.0.tgz","fileCount":7,"integrity":"sha512-KiqhwQeZAhqna+hodbI6vxrnG8MLYU0+zi4be44j4rGttz8uiDabiSSxSA05lLONec5ikaQJ1VtGKc7hmXJ7EA==","signatures":[{"sig":"MEUCIQCi4Yle8JlLwcIB6slmO/w5ikV5EAMFIP4rqKeszuLvwwIgAcusAmMf5KeGlBfGDUakrXB8KFf7Sg7ymssbilZ9IA8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIE864OteQAe43C6v2V/AgzVyZPHEERmIxjJpu4wXB2XxAiAD7LlFbf4TwThdPqqfxekedozne/VNu/nx0fQa1ICvBg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46621},"main":"index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./index.js","./x402-receipt":"./x402-receipt.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"c4a627cc93eeabe8adb551cf2632683706221e62","scripts":{"test":"node --test"},"_npmUser":{"name":"interence","email":"support@embryospace.com"},"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts and per-call x402 delivered receipts.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"tmp":"tmp/x402-bsv-client_0.7.0_1790140417364_0.0977118486862143","host":"s3://npm-registry-packages-npm-production"}},"0.7.1":{"_id":"@bsvkey/x402-bsv-client@0.7.1","bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"dist":{"shasum":"1d28ca81a703d5a5151d09c5fd95d8e97b65bad5","tarball":"https://registry.npmjs.org/@bsvkey/x402-bsv-client/-/x402-bsv-client-0.7.1.tgz","fileCount":7,"integrity":"sha512-2bAauTo7llAzqY5SzdluViKsj+ObFfkAQrqg4MilG39IjAYREa5tdS2RLotOAT9dtBT0CZeKIyGtle/xGRQXKg==","signatures":[{"sig":"MEYCIQClE9477o1OX1RhniceGsB83IFk13AfSXvdDaPQSHNYTwIhAObRxinBebVh9RttJsO0npb43CPknW0vNxSwAjscxMGG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEomD+wMLqTZjgvUHtIa9Duat+S82XcHoS4Rfb96JV2/AiAFJ84fVVwKHx/otonj94YfvEFV8SlFAbhHzroW8ZSklQ=="}],"unpackedSize":46667},"main":"index.js","name":"@bsvkey/x402-bsv-client","type":"module","author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"engines":{"node":">=18"},"exports":{".":"./index.js","./x402-receipt":"./x402-receipt.js","./usage-receipt":"./usage-receipt.js"},"gitHead":"c87a0207ec1b8d9cd1dc448e179216356407900a","license":"MIT","scripts":{"test":"node --test"},"version":"0.7.1","_npmUser":{"name":"interence","email":"support@embryospace.com"},"homepage":"https://inference.bsvkey.com/v1/x402","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"_npmVersion":"11.11.0","description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts and per-call x402 delivered receipts.","directories":{},"maintainers":[{"name":"interence","email":"support@embryospace.com"}],"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"@bsv/sdk":"^2.4.2"},"peerDependencies":{"@bsv/sdk":"^2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x402-bsv-client_0.7.1_1790225423993_0.995505366525562"}}},"time":{"created":"2026-09-05T03:50:54.877Z","modified":"2026-09-24T04:50:24.257Z","0.1.0":"2026-09-05T03:50:55.383Z","0.1.1":"2026-09-05T14:55:12.965Z","0.2.0":"2026-09-07T03:15:30.431Z","0.3.0":"2026-09-07T13:57:33.588Z","0.3.1":"2026-09-07T13:58:58.541Z","0.4.0":"2026-09-07T18:30:20.969Z","0.4.1":"2026-09-07T18:33:39.296Z","0.4.2":"2026-09-07T19:13:41.833Z","0.4.3":"2026-09-09T01:50:01.241Z","0.4.4":"2026-09-09T02:11:30.202Z","0.4.5":"2026-09-10T15:13:53.584Z","0.5.0":"2026-09-22T01:54:47.469Z","0.6.0":"2026-09-23T05:03:02.985Z","0.7.0":"2026-09-23T05:13:37.440Z","0.7.1":"2026-09-24T04:50:24.072Z"},"bugs":{"url":"https://github.com/BSVKey/x402-bsv-client/issues"},"author":{"url":"DBA BSVKey","name":"Embryo Space Inc."},"license":"MIT","homepage":"https://inference.bsvkey.com/v1/x402","keywords":["x402","bsv","micropayments","ai-agents","402","payments","http-402","usage-receipt","verifiable"],"repository":{"url":"git+https://github.com/BSVKey/x402-bsv-client.git","type":"git"},"description":"Pay an x402 HTTP 402 in BSV — the missing bsv-p2pkh payment builder for x402 agents. Also verifies BSVKey inference usage receipts and per-call x402 delivered receipts.","maintainers":[{"name":"interence","email":"support@embryospace.com"}],"readme":"# @bsvkey/x402-bsv-client\n\n[![npm version](https://img.shields.io/npm/v/@bsvkey/x402-bsv-client.svg)](https://www.npmjs.com/package/@bsvkey/x402-bsv-client)\n[![license: MIT](https://img.shields.io/npm/l/@bsvkey/x402-bsv-client.svg)](./LICENSE)\n[![node](https://img.shields.io/node/v/@bsvkey/x402-bsv-client.svg)](https://nodejs.org)\n\nPay an [x402](https://x402.org) `402 Payment Required` **in BSV**, in one line.\n\n**Live gateway:** [inference.bsvkey.com/#x402](https://inference.bsvkey.com/#x402) · discovery at [`/v1/x402`](https://inference.bsvkey.com/v1/x402)\n\nx402 ships payment builders for EVM (EIP-3009) and Solana. This is the missing\none for the **`bsv-p2pkh`** scheme — so an AI agent can pay a BSV-settled x402\nendpoint (like `inference.bsvkey.com`) with true sub-cent, per-call micropayments.\n\n```bash\nnpm i @bsvkey/x402-bsv-client @bsv/sdk\n```\n\n## Use it\n\n```js\nimport { fetchWithX402, readSettlement } from '@bsvkey/x402-bsv-client';\n\nconst res = await fetchWithX402(\n  'https://inference.bsvkey.com/v1/x402/chat/completions',\n  {\n    method: 'POST',\n    headers: { 'content-type': 'application/json' },\n    body: JSON.stringify({ model: 'grok-4.3', messages: [{ role: 'user', content: 'Say hi in 3 words' }] }),\n  },\n  { wif: process.env.BSV_WIF } // a funded BSV private key (WIF)\n);\n\nconst data = await res.json();\nconsole.log(data.choices[0].message.content);        // the answer\nconsole.log(readSettlement(res));                     // { success, transaction (on-chain txid), network, ... }\n```\n\nThat's the whole x402 handshake, handled for you:\n\n1. `POST` the request → server replies **402** with the quoted price.\n2. This lib builds + signs a BSV tx paying the quoted amount to the server's `payTo`.\n3. Retries with the `X-PAYMENT` header → server settles on-chain and returns **200** + the answer.\n\n## Lower level\n\n```js\nimport { buildX402Payment } from '@bsvkey/x402-bsv-client';\n\n// Given an x402 402 response body, produce the base64 X-PAYMENT header value:\nconst xPayment = await buildX402Payment(body402, wif);\n```\n\n## Notes\n\n- **Key format:** `wif` accepts either a **WIF** (starts `K`/`L`/`5`) or a **12/24-word\n  recovery phrase** (derived on the BSV path `m/44'/236'/0'/0/0`, the same one\n  inference.bsvkey.com uses) — so a wallet generated on the site works here directly.\n- **Funding:** the key's address must hold enough BSV to cover the quoted amount + a\n  small fee. Fund it like any BSV address (the `payTo`/QR flow on inference.bsvkey.com works).\n- **Back-to-back calls are safe:** the client chains each payment off its own change,\n  so a loop of paid calls won't double-spend while the mempool catches up.\n- **Non-custodial:** your key never leaves the process; the signed transaction pays the\n  server's address directly.\n- **Networks:** `bsv` (mainnet) and `bsv-testnet`. Testnet lets you dry-run for free.\n\n## Verify usage receipts\n\nIf you use the BSVKey inference broker over a **prepaid channel**, every settled\ncall returns a signed `usageReceipt`. This package verifies them offline, so you\ncan audit the broker's meter without trusting its word and without a round-trip.\n\n```js\nimport { verifyReceiptChain } from '@bsvkey/x402-bsv-client/usage-receipt';\n\n// Pin the broker key once (GET https://inference.bsvkey.com/v1/receipt-key).\nconst { receiptPubKey } = await (await fetch('https://inference.bsvkey.com/v1/receipt-key')).json();\n\n// `receipts` = the usageReceipt from each call on your channel.\nconst audit = await verifyReceiptChain(receipts, {\n  expectedSigner: receiptPubKey,   // REQUIRED (0.7.0+): missing refuses with 'unpinned'\n  channelId: myChannelId,\n  fundedSats: myChannelFundedSats,\n});\n// { ok: true, count, cumSats, cumTokens }  — or { ok: false, reason, seq }\n```\n\n`verifyReceiptChain` checks, across the whole chain, that: each signature\nrecovers to the pinned broker key, every receipt is for your channel, the\nsequence has no gap or replay, the running totals reconcile\n(`cumSats`/`cumTokens`), spending never exceeds the funded amount, and each\n**charge** recomputes from the published formula (you can be charged less, never\nmore). An **empty chain is refused** (`reason: 'empty_chain'`) — it proves\nnothing, so a client that lost its receipts fails the check rather than passing\nvacuously.\n\nTwo things worth pinning down as an unattended client:\n\n- **`fundedSats` is yours to supply.** The receipt carries a `fundedSats`, but\n  that is the broker's own signed assertion, not proof of the funding\n  transaction. For \"spending never exceeds what the channel actually paid\" to\n  mean the on-chain amount, pass `opts.fundedSats` set to the amount **you**\n  funded. When you do, a receipt that claims **more** funding than you supplied\n  is rejected (`funded_mismatch`), so the broker can't widen the cap by signing a\n  larger number, and `cumSats` is bounded by each receipt's own `fundedSats`.\n  **Top-ups are supported:** `fundedSats` may rise across the chain (a drop is\n  rejected as `funded_decreased`), so after you top a channel up, pass your new\n  **current total** and the whole chain — the receipts before and after the\n  top-up — verifies in one call. Omit `opts.fundedSats` and the check falls back\n  to the broker-asserted number.\n- **Pass `opts.channelId`.** The \"my channel and no other\" check only runs when\n  you pass the channel you funded; without it a receipt for a different channel\n  is not rejected.\n- **The receipt is the ledger; the balance endpoint is a cache.** The broker's\n  `GET /v1/channels/:id` can lag the signed receipt by ~20s. Trust the receipt's\n  `cumSats`/`balanceSatsAfter`; treat the endpoint as eventually-consistent.\n\nSingle-receipt helpers: `verifyReceipt(receipt)` → `{ ok, signer }`,\n`verifyCharge(receipt)`, and `verifyMeter(receipt, { messages, completion })` (or\n`{ system, prompt, completion }` on the raw `/v1/infer` path — see below).\n\n### Verify the meter (the token count itself)\n\nThe v2 receipt binds the exact bytes and is metered by a pinned, deterministic\ntokenizer, so you recompute the token count from what you sent and received.\n\n**On the OpenAI-compatible `/v1/chat/completions` path, pass the same `messages`\narray you sent** — that endpoint meters the *flattened* messages (system joined\nwith `\\n`; every other turn rendered as `User: …` / `Assistant: …`, joined with\n`\\n`), so `verifyMeter` needs the messages to reproduce that transform for you:\n\n```js\nimport { verifyMeter } from '@bsvkey/x402-bsv-client/usage-receipt';\nconst m = verifyMeter(receipt, { messages, completion }); // { ok } / { ok:false, reason }\n```\n\nOn the broker-native `/v1/infer` path (raw fields), pass `{ system, prompt, completion }`\ninstead. (`messagesToPrompt(messages)` is exported if you want the flattened\n`{ system, prompt }` yourself.)\n\n**What this proves:** the broker signed these exact numbers (non-repudiable), the\ntoken count is the published function of the exact bytes you exchanged, the charge\nis the published function of those tokens, none were double-counted, and the\ntotals stay within what you funded. **What it does not prove:** that\n`bsvkey-meter/1` equals a model provider's internal token count (it is BSVKey's\nown published unit). Spec: https://inference.bsvkey.com/usage-receipts.md\n\n### Hidden tokens (usage-receipt/3, 0.6.0+)\n\nThinking models (Claude Sonnet 5, Opus 5, Opus 5.5, Fable 5.1) reason before they\nanswer, and the provider bills that reasoning as output tokens you never see. A\ncall with such tokens gets a `bsvkey.usage-receipt/3`: the v2 fields plus\n`hiddenInputTokens`, `hiddenOutputTokens`, `hiddenSource` (`provider` or\n`estimate`) and `maxOutputTokens`. Every other call stays v2, unchanged.\n\nThe same verifiers handle both. For v3, `verifyCharge` bills the hidden tokens at\nthe receipt's own rates and refuses `hidden_output_exceeds_allowance` if the hidden\noutput is larger than the room your own `max_tokens` left; `verifyMeter` still\nchecks the visible tokens against your bytes. The hidden counts are the\nprovider's usage as relayed by the broker (`provider`), or the broker's published\nestimate when the provider reported none (`estimate`). Versions before 0.6.0\nreject v3 with `bad_schema`.\n\n## Verify per-call x402 receipts\n\nThe prepaid-channel path returns a `usageReceipt` (above). The **per-call** paths\n(`/v1/x402/chat/completions`, `/v1/x402/base/chat/completions`) return a per-call\n**delivered receipt** instead: schema `bsvkey.x402-receipt/1`, no channel or\nbalances, binding one response to one on-chain settlement. Its verifier is a\nseparate schema, so the channel verifier rejects it with `unknown_field:rail`.\nAccept a receipt with **`verifyX402ReceiptFull`** (per call) or **`verifyReceiptChain`**\n(channel). Both refuse unless you pass `expectedSigner`. `verifyAnyReceipt` only\nchecks integrity and hands back the signer: it is not an acceptance check on its\nown, because a receipt re-signed by any key passes it.\n\n```js\nimport { readSettlement, verifyX402ReceiptFull } from '@bsvkey/x402-bsv-client';\n\nconst res = await fetchWithX402(url, init, { wif });\nconst receipt = (await res.clone().json()).receipt;   // the delivered receipt\nconst paid = readSettlement(res);                     // { txid, payer, ... } YOU paid\n\nconst { receiptPubKey } = await (await fetch('https://inference.bsvkey.com/v1/receipt-key')).json();\nconst v = await verifyX402ReceiptFull(receipt, {\n  expectedSigner: receiptPubKey,       // REQUIRED: the pinned broker key; missing refuses\n  settlementRef: paid.txid,            // REQUIRED — the tx you paid, from your context\n  payer: paid.payer,                   // optional — the address you paid from\n  messages, completion,                // the response you hold\n}); // { ok:true, signer } / { ok:false, reason }\n```\n\n**Bind it to your own payment.** A receipt is a *bearer object*: recomputing its\nid, recovering its signer, and matching the delivered bytes are all true for\nwhoever holds it. It is **yours** only when you check its `settlementRef` against\nthe txid you actually paid — which is why `settlementRef` is **required** and an\nunbound check *refuses* rather than passing. Pass it from `readSettlement(res)`,\nnever read it back out of the receipt. The same goes for the signer: it is\n**yours to pin**, so `expectedSigner` is also required and a missing pin refuses\n(`unpinned`) instead of accepting whatever key signed it. Lower-level pieces if\nyou want them (none of these is an acceptance check alone):\n`verifyAnyReceipt` (integrity + returns the signer, for either schema),\n`verifyX402Receipt` (authorship), `bindX402Receipt(receipt, { settlementRef, payTo, amountAtomic, payer })`\n(the binding), `verifyX402Delivery(receipt, { messages, completion })` (the bytes).\n\n**What this proves:** the broker signed that this exact response was delivered for\nthat settlement, and — once bound — for **your** settlement. **What it does not\nprove:** that the compute was correct.\n\nMIT.\n","readmeFilename":"README.md"}