x402 କଣ।
x402 ହେଉଛି HTTP-native payments ପାଇଁ ଗୋଟିଏ open protocol, ଯାହା Coinbase ଦ୍ୱାରା 2024 ର ଶେଷ ଭାଗରେ ପ୍ରକାଶିତ। ଏହା server କିପରି 402 Payment Required କୁ ଗୋଟିଏ structured JSON body ସହିତ ଫେରାଏ - acceptable payment requirements (scheme, network, chain id, recipient address, USDC base units ରେ amount, ଏବଂ ଗୋଟିଏ payment-request id) ର ତାଲିକା - ସେଥିର ରୂପରେଖା ଦେଏ, ଯାହାଦ୍ୱାରା machine client response କୁ parse କରିପାରେ, on-chain pay କରିପାରେ, ଏବଂ X-Payment header ସହିତ original call କୁ retry କରିପାରେ, ସବୁ programmatically।
HTTP 402 ବିଶ୍ୱରେ ତିନି ଦଶକ ଧରି ବ୍ୟବହାର ହୋଇନଥିଲା। x402 ଏହାକୁ କାମ କରାଇଛି।
The 402 Payment Required status code was reserved in the original HTTP spec for "future use" and never received a standardized implementation. For three decades, every actual payment flow on the web was built on top of 200 / 401 / 403: a server returns 401 when authentication is missing, the client signs up via a separate UI flow, gets credentials, and re-authenticates. The signup happens out of band. None of this works for AI agents, which cannot complete signup forms.
x402 fixes this by giving 402 a usable specification. A server can return 402 with structured machine-readable payment instructions; a client can parse those instructions, pay, and retry, all without ever touching a signup form. The protocol is the missing piece between "AI agents can call APIs" and "AI agents can pay for the APIs they call". Before x402, the only practical agent payment paths were pre-paid balance accounts (with manual top-up) or proprietary integrations per API. Both broke at scale.
x402 ର strategic importance ହେଉଛି ଏହା ଏକ standard set କରେ ଯାହା ଉପରେ ecosystem ର ଅନ୍ୟାନ୍ୟ ଅଂଶ build କରିପାରେ। Wallet ଗୁଡ଼ିକ ଗୋଟିଏଥର x402 handler implement କରନ୍ତି, ଏବଂ ପ୍ରତ୍ୟେକ x402-compliant API ସେହି wallet ସହିତ କାମ କରେ। Server framework ଗୁଡ଼ିକ ଗୋଟିଏଥର x402 middleware implement କରନ୍ତି, ଏବଂ ପ୍ରତ୍ୟେକ x402-aware client ସେମାନଙ୍କୁ ଦେୟ କରିପାରେ। Facilitator (underlying payment settle କରୁଥିବା service) lock-in ପରିବର୍ତ୍ତେ quality of service ଉପରେ ପ୍ରତିସ୍ପର୍ଧା କରନ୍ତି।
ଏକ ପ୍ରତିକ୍ରିୟା, ଏକ ପୁନର୍ପ୍ରୟାସ, ଏକ ପେମେଣ୍ଟ।
Lifecycle ରେ ତିନୋଟି state ଅଛି: unpaid call, payment, retried call। ତଳେ unpaid-call response wire ଉପରେ ପ୍ରକୃତରେ କିପରି ଦେଖାଯାଏ ସେଥି ଦିଆଯାଇଛି।
HTTP/1.1 402 Payment Required Content-Type: application/json { "resource": "POST /api/research-query", "accepts": [ { "scheme": "exact-usdc", "network": "mainnet", "chainId": "eip155:8453", "payToAddress": "0xAgent...", "amountWeiUsdc": "50000", "paymentRequestId": "pr_01J9...", "maxAgeSeconds": 60 } ] }
- Status code 402. Distinct from 401 (auth missing) and 403 (auth refused). The presence of 402 signals "payment is the missing input."
- resource + accepts[]. body ରେ protected resource ର ନାମ ଥାଏ ଏବଂ ଗୋଟିଏ କିମ୍ବା ଅଧିକ ଗ୍ରହଣଯୋଗ୍ୟ payment requirement ତାଲିକାଭୁକ୍ତ ହୁଏ। ଏକ migration ଦୁଇଟି requirement (ଯଥା mainnet ଏବଂ testnet) quote କରି client କୁ ବାଛିବାକୁ ଦେଇପାରେ।
- scheme / network / chainId. payment scheme (exact-usdc), chain (mainnet ହେଉଛି Base), ଏବଂ ଏହାର CAIP-2 id। ପେ କରିବା ପୂର୍ବରୁ client ଏଗୁଡ଼ିକ ସହିତ match କରେ।
- payToAddress / amountWeiUsdc. recipient wallet ଏବଂ USDC base units ରେ ସଠିକ୍ amount (50000 = 0.05 USDC, 6 decimals)। ପେ କରିବା ପୂର୍ବରୁ client ଉଭୟକୁ verify କରେ।
- paymentRequestId + maxAgeSeconds. id ଟି ପେମେଣ୍ଟକୁ ଏହି quote ସହିତ ଯୋଡ଼େ; maxAgeSeconds ହେଉଛି ପେମେଣ୍ଟ କେତେ ନୂତନ ହେବା ଦରକାର। ଭିନ୍ନ id କୁ ସନ୍ଦର୍ଭ କରୁଥିବା କିମ୍ବା window ଠାରୁ ପୁରୁଣା ପେମେଣ୍ଟ ଅସ୍ୱୀକୃତ ହୁଏ।
- retry ରେ X-Payment header ଥାଏ। କ୍ଲାଏଣ୍ଟ on-chain ରେ ପେମେଣ୍ଟ କରେ, ତାପରେ ପେମେଣ୍ଟ ପ୍ରମାଣ କରୁଥିବା X-Payment header ସହିତ ମୂଳ request ପୁଣିଥରେ ପଠାଏ। ସର୍ଭର ଏହାକୁ verify କରି ପ୍ରକୃତ result ଫେରାଏ। response headers କିମ୍ବା hosted page x402 wire ର ଅଂଶ ନୁହେଁ।
x402 ବନ୍ୟାରେ।
ତିନି କଠିନ ନିଯୁକ୍ତି, ପ୍ରତିଟି ଲେୟରରେ ଗ୍ରହଣ କିପରି ପକ୍କା ହେଉଛି ତାହା ଅନୁସାରେ କ୍ରମବଦ୍ଧ।
MCP server unpaid tool call କୁ 402 challenge ଫେରାଉଛି
ଏକ paid MCP tool Claude Desktop ଠାରୁ ଏକ invocation ପାଏ ଏବଂ caller ଏପର୍ଯ୍ୟନ୍ତ paid ଭାବେ marked ହୋଇନାହିଁ। server ଏକ requirePayment challenge ତିଆରି କରେ - price ଏବଂ hostedUrl ଧାରଣ କରୁଥିବା 402 - ଏବଂ ଏହାକୁ tool error ଭାବରେ ଫେରାଏ। Claude Desktop chat ରେ link ଦେଖାଏ; user $0.05 USDC ପେ କରେ; ସେହି ଏକେ tool କୁ ପରବର୍ତ୍ତୀ call ସଫଳ ହୁଏ।
API ଏଣ୍ଡପଏଣ୍ଟ ଗେଟିଂ ପର-କଲ୍ ବିଲିଂ
x402 server adapter ର ପଛରେ ଥିବା ଏକ research API ପ୍ରତି call $0.50 ନେଉଛି। ଏକ AI agent endpoint କୁ call କରେ, amount ଏବଂ recipient ତାଲିକାଭୁକ୍ତ 402 ପାଏ, ନିଜ wallet ରୁ Base ଉପରେ ପେ କରେ, ଏବଂ X-Payment header ସହିତ request କୁ ପୁଣି issue କରେ। adapter header କୁ verify କରି paid response ଫେରାଏ। ସମ୍ପୂର୍ଣ୍ଣ loop 60 seconds ଠାରୁ କମ୍ ସମୟରେ ସମାପ୍ତ ହୁଏ।
x402-ଜାଣିଥିବା ୱାଲେଟ୍ ଦ୍ୱାରା କାର୍ଯ୍ୟକ୍ରମ ଭାବେ ଦେୟ କରୁଥିବା ଏଜେଣ୍ଟ
ଏକ agent ର runtime x402-aware ଅଟେ (ଏହା spec କୁ implement କରେ)। ଯେତେବେଳେ ଏହା 402 ସମ୍ମୁଖୀନ ହୁଏ, ଏହା accepts[] ରୁ payToAddress ଏବଂ amount ପଢ଼େ, ତାହାର pre-authorized wallet ରୁ (ତାହାର spend permission ଭିତରେ) transfer sign କରେ, Base ଉପରେ broadcast କରେ, ଏବଂ X-Payment header ସହିତ original call କୁ retry କରେ। କୌଣସି ମାନବ ଜଡ଼ା ନାହିଁ; loop 5-10 seconds ରେ ସମାପ୍ତ ହୁଏ।
ଷ୍ଟ୍ୟାକ୍ରେ x402 କୁ କଣ ଘେରାଇଛି।
x402 ହେଉଛି ପ୍ରୋଟୋକଲ୍। ଏହି ତିନି ଶବ୍ଦ ସେହି ଧାରଣାଗୁଡିକୁ ଆବରଣ କରେ ଯାହା ଏହା ଉପରେ ବସିଥାଏ ଏବଂ ଯେଉଁ ଉପଯୋଗକ୍ଷମତାଗୁଡିକୁ ଏହା ସକ୍ଷମ କରେ।