ଆପଣଙ୍କର API କୁ AI ଏଜେଣ୍ଟମାନେ ବିକ୍ରୟ କରନ୍ତୁ।
AI ଏଜେଣ୍ଟଗୁଡିକ କ୍ରେଡିଟ୍ କାର୍ଡ ଫର୍ମ ପୂରଣ କରିପାରିବେ ନାହିଁ। ସେମାନେ ଆପଣଙ୍କୁ USDC ରେ ପେମେଣ୍ଟ କରିପାରିବେ। Blockchain0x ସେହି ଏକ API କଲ୍ କରେ।
ଆପଣଙ୍କର API ମାନବଙ୍କ ପାଇଁ ନିର୍ମାଣ କରାଯାଇଥିଲା। ଆପଣଙ୍କର କଲର୍ମାନେ ବର୍ତ୍ତମାନ ଏଜେଣ୍ଟ।
API revenue ର ପରବର୍ତ୍ତୀ ଦଶକ human signup ଠାରୁ ଆସିବ ନାହିଁ। ଏହା AI agents ମାନେ ତାଙ୍କ users ଙ୍କ ପକ୍ଷରୁ APIs କଲ୍ କରିବାରୁ ଆସିବ, ପ୍ରାୟତଃ programmatically ଏବଂ କୌଣସି human in the loop ବିନା। ସେହି agents ଆପଣଙ୍କ existing checkout ବ୍ୟବହାର କରିପାରିବେ ନାହିଁ। ସେମାନେ credit card form ପୂରଣ କରିପାରିବେ ନାହିଁ, account ତିଆରି କରିପାରିବେ ନାହିଁ, confirmation email ଉପରେ click କରିପାରିବେ ନାହିଁ, password ମନେ ରଖିପାରିବେ ନାହିଁ।
ସେମାନେ କଣ କରିପାରିବେ ହେଉଛି 402 Payment Required ପ୍ରତିକ୍ରିୟାକୁ ପଢ଼ିବା, JSON ଦେହରୁ USDC ର ରାଶି ଏବଂ ଗ୍ରାହକକୁ ପାର୍ସ କରିବା, Base ଉପରେ ଦେୟ କରିବା, ଏବଂ ଦେୟର ପ୍ରମାଣ ସହିତ କଲ୍ କୁ ପୁନର୍ଦ୍ଧାର କରିବା। ଏହା ଏଜେଣ୍ଟ-ଚାଳିତ API ବ୍ୟବସାୟର ସମ୍ପୂର୍ଣ୍ଣ ଆକାର। ଖର୍ଚ୍ଚ ମୋଡେଲ୍ (ସ୍ଥାବଳରେ ପ୍ରତି-କଲ୍ ବିଲିଂ) ମଧ୍ୟ ଏଜେଣ୍ଟ ବ୍ୟବହାର ଆକାରକୁ କାର୍ଡ-ଆଧାରିତ ସବସ୍କ୍ରିପ୍ସନ୍ଗୁଡିକ ଠାରୁ ଅଧିକ ଭଲ ଭାବରେ ମିଳେ: କାର୍ଡଗୁଡିକ $1 ର ଲେନଦେନରେ ବିଫଳ ହୁଏ; Base ଉପରେ USDC ଗ୍ୟାସ୍ରେ ସେଣ୍ଟ ଖର୍ଚ୍ଚ କରେ; ମେସିନ୍ଗୁଡିକ ମଧ୍ୟରେ ଚାର୍ଜ୍ବ୍ୟାକ୍ ଘଟେ ନାହିଁ।
Blockchain0x ହେଉଛି bridge। pricing table ରେ ଆପଣ ଯେ routes ପାଇଁ charge କରିବାକୁ ଚାହାନ୍ତି ସେଗୁଡିକ ତାଲିକା କରନ୍ତୁ ଏବଂ x402 adapter mount କରନ୍ତୁ। ଯେତେବେଳେ ଏକ unpaid call priced route କୁ hit କରେ, adapter ସଠିକ୍ କ’ଣ pay କରିବାକୁ ପଡିବ ତାହା ବର୍ଣ୍ଣନା କରି 402 ଫେରାଇଦିଏ। agent Base ରେ pay କରେ ଏବଂ X-Payment header ସହିତ ପୁନଃଚେଷ୍ଟା କରେ; adapter ଏହା verify କରେ ଏବଂ ଆପଣଙ୍କ handler ଚାଲେ। ଆପଣ USDC collect କରନ୍ତି ଏବଂ ପୂର୍ବବତ୍ ନିଜ API ଚଳାନ୍ତି। ଆପଣଙ୍କ business logic ରେ କିଛି ବଦଳେ ନାହିଁ; billing layer ପାଖେଇ ଚାଲେ।
HTTP status code ଶେଷରେ ଏକ use ପାଇଲା।
HTTP 402 was reserved in the original spec for "future use" and never standardized. For thirty years it sat unused while the internet built per-account subscription billing on top of 200/401/403. With Coinbase's x402 protocol, 402 finally has a standard implementation: any API that needs payment-before-it-runs can return a structured 402, and any client that understands the spec can pay and retry.
HTTP/1.1 402 Payment Required
Content-Type: application/json
{
"resource": "POST /api/expensive-operation",
"accepts": [
{
"scheme": "exact-usdc",
"network": "mainnet",
"chainId": "eip155:8453",
"payToAddress": "0xYourAgentWalletAddress",
"amountWeiUsdc": "500000",
"paymentRequestId": "pr_demo",
"maxAgeSeconds": 60
}
]
}accepts[] ଆବଶ୍ୟକତା କଣ ଅର୍ଥ କରେ
- scheme - payment scheme। exact-usdc ର ଅର୍ଥ ହେଉଛି EVM chain ରେ ସଠିକ୍ USDC amount। ପେ କରିବା ପୂର୍ବରୁ client ଏହା ସହିତ match କରେ।
- network / chainId - settle କରିବା ପାଇଁ chain (mainnet ହେଉଛି Base, CAIP-2 eip155:8453)। ଏକ migration accepts ରେ ଦୁଇଟି requirement ଦେଖାଇ ଉଭୟ network କୁ quote କରିପାରେ।
- payToAddress / amountWeiUsdc - recipient wallet ଏବଂ USDC base units ରେ ସଠିକ୍ amount (500000 = 0.50 USDC, 6 decimals)। ପେ କରିବା ପୂର୍ବରୁ client ଉଭୟକୁ verify କରେ।
- paymentRequestId - ପେମେଣ୍ଟକୁ ଏହି quote ସହିତ ଯୋଡ଼େ। route ରେ ଥିବା quote ଠାରୁ ଭିନ୍ନ paymentRequestId କୁ ସନ୍ଦର୍ଭ କରୁଥିବା X-Payment କୁ adapter ଅସ୍ୱୀକୃତ କରେ।
- maxAgeSeconds - ପେମେଣ୍ଟ କେତେ ନୂତନ ହେବା ଦରକାର। ଏହି window ଠାରୁ ପୁରୁଣା ପେମେଣ୍ଟ ଅସ୍ୱୀକୃତ ହୁଏ ଏବଂ caller କୁ ପୁଣି ପେ କରିବାକୁ ପଡ଼େ।
x402 machine-to-machine: x402-aware client accepts ପଢ଼େ, ବାଛାଯାଇଥିବା requirement କୁ on-chain pay କରେ, ତାପରେ X-Payment header ସହିତ request କୁ ପୁନଃ ପଠାଏ, ଯାହାକୁ adapter verify କରେ। x402 କଥା ନକହୁଥିବା client କେବଳ 402 ପାଏ ଏବଂ କୌଣସି result ପାଉନାହିଁ, ଯାହା ଠିକ୍ outcome (call ପାଇଁ ଭୁଗତାନ ହୋଇନଥିଲା)। ଏହି flow ରେ କୌଣସି hosted checkout page ନାହିଁ; payment caller ର wallet ଦ୍ୱାରା programmatically settle ହୁଏ।
ଗୋଟିଏ ମୂଲ୍ୟ ତାଲିକା। ତିନି ଭାଷା। ସମାନ ଆକୃତି।
ଆପଣ ଗୋଟିଏ adapter mount କରି METHOD plus path ଆଧାରିତ ଗୋଟିଏ pricing table ଦିଅନ୍ତି। ଏହା କେବଳ ଆପଣ ତାଲିକାଭୁକ୍ତ routes କୁ gate କରେ; ଆପଣଙ୍କ handler କେବେ ମଧ୍ୟ unpaid call ଦେଖେ ନାହିଁ, କାରଣ ସେ ଚାଲିବା ସମୟରେ X-Payment header ପୂର୍ବରୁ verify ହୋଇଯାଇଥାଏ। Python, TypeScript, ଏବଂ Go ମଧ୍ୟରେ shape ସମାନ - X-Payment wire format ଏକେ, ସେଥିପାଇଁ ଗୋଟିଏ Go server Python client ଦ୍ୱାରା built headers ଗ୍ରହଣ କରେ।
from flask import Flask
from blockchain0x import Client
from blockchain0x_x402.server import x402_before_request_factory, PricingEntry
sdk = Client() # reads BLOCKCHAIN0X_API_KEY
app = Flask(__name__)
# Only routes named in the pricing table are gated.
app.before_request(x402_before_request_factory(
sdk=sdk,
pricing={
"POST /api/expensive-operation": PricingEntry(
amount_usdc="0.50",
pay_to_address="0xYourAgentWalletAddress",
payment_request_id="pr_demo",
),
},
))
@app.route("/api/expensive-operation", methods=["POST"])
def expensive_operation():
return run_the_work() # only runs after X-Payment verifiesimport express from "express";
import { createClient } from "@blockchain0x/node";
import { createX402Middleware } from "@blockchain0x/x402/server/express";
const sdk = createClient({ apiKey: process.env.BLOCKCHAIN0X_API_KEY! });
const app = express();
// Only routes named in the pricing table are gated.
app.use(createX402Middleware({
sdk,
pricing: {
"POST /api/expensive-operation": {
amountUsdc: "0.50",
payToAddress: "0xYourAgentWalletAddress",
paymentRequestId: "pr_demo",
},
},
}));
app.post("/api/expensive-operation", async (req, res) => {
res.json(await runTheWork()); // req.x402Payment holds the verified payment
});import (
"net/http"
x402 "tosh-labs/blockchain0x-x402-go"
)
func main() {
pricing := map[string]x402.PricingEntry{
"POST /api/expensive-operation": {
AmountUSDC: "0.50",
PayToAddress: "0xYourAgentWalletAddress",
PaymentRequestID: "pr_demo",
},
}
// serverSdk is your Blockchain0x Go SDK client.
h := x402.Middleware(x402.ServerOptions{Sdk: serverSdk, Pricing: pricing})(
http.HandlerFunc(expensiveOperation))
http.Handle("/api/expensive-operation", h)
http.ListenAndServe(":8080", nil)
}ଆମେ Express ଏବଂ Fastify (Node), ASGI (Starlette ଏବଂ FastAPI) ଏବଂ Flask (Python) ପାଇଁ ସର୍ଭର୍ ଅଡାପ୍ଟର୍ଗୁଡିକୁ ଶିପ୍ କରୁଛୁ, ଏବଂ Go's net/http। ଅନ୍ୟ ଫ୍ରେମ୍ୱର୍କଗୁଡିକ ପାଇଁ, 402 ଦେହ ଏବଂ X-Payment ହେଡର୍ ସାଧାରଣ HTTP ଯାହା @blockchain0x/x402 ରେ ଥିବା ତାର ହେଲ୍ପର୍ଗୁଡିକ ନିର୍ମାଣ କରେ ଏବଂ ପାର୍ସ କରେ - ଆପଣଙ୍କର ଷ୍ଟ୍ୟାକ୍ର ଇଡିଓମ୍ରେ ଚେକ୍ ହାତେ ଲେଖନ୍ତୁ। Ruby ଏବଂ JVM x402 ପ୍ୟାକେଜ୍ଗୁଡିକ କ୍ଲାଇଏଣ୍ଟ ପାଇଁ ପ୍ରକାଶିତ ହୋଇଛି।
ପ୍ରତି ଟୁଲ୍ ପାଇଁ କେବେ ହାତ ଆଗେଇବେ।
Stripe ମାନବ ଚେକ୍ଆଉଟ୍ ପାଇଁ ସଠିକ୍ ଟୁଲ୍। Blockchain0x ଏଜେଣ୍ଟ ଚେକ୍ଆଉଟ୍ ପାଇଁ ସଠିକ୍ ଟୁଲ୍। ସେମାନେ ଭିନ୍ନ ସମସ୍ୟାଗୁଡିକୁ ସମାଧାନ କରନ୍ତି ଏବଂ ସାଧାରଣ API ରେ ପାଖାପାଖି ବସନ୍ତି।
| ମାପ | Blockchain0x | Stripe Checkout |
|---|---|---|
| କ୍ରେତା | କୌଣସି HTTP କ୍ଲାଇଏଣ୍ଟ (ମାନବ କିମ୍ବା AI ଏଜେଣ୍ଟ) | ବ୍ରାଉଜରରେ ମାନବ |
| ଭୁଗତାନ ପୂର୍ବରୁ ଅନୁମତି ଆବଶ୍ୟକ | ନା - ପ୍ରଥମ call ରେ payment requirements ସହ 402 ଫେରେ | ହଁ - email + card form |
| ସମାଧାନ ଗତି | 5 ସେକେଣ୍ଡ (USDC on Base) | 2-7 ଦିନ (କାର୍ଡ ନେଟୱର୍କ) |
| ଚାର୍ଜ୍ବ୍ୟାକ୍ ଝୁମକ | କିଛି ନାହିଁ (USDC final) | 120 ଦିନ ପର୍ଯ୍ୟନ୍ତ ଚାର୍ଜ୍ବ୍ୟାକ୍ ଜାଲ |
| ପ୍ରତି-ଲେନଦେନ ଖର୍ଚ୍ଚ ଅର୍ଥଶାସ୍ତ୍ର | ପ୍ରତି call $0.01-$0.10 ରେ କାମ କରେ (Base gas + ଆମ fee) | କାର୍ଡ୍ ଫିସ୍ଗୁଡିକ $1 ରୁ କମ୍ ଲେନଦେନକୁ ଅର୍ଥନୈତିକ ଭାବେ ଅସମ୍ଭବ କରେ |
| ପୁନର୍ଦ୍ଧାନ | ମ୍ୟାନୁଆଲ୍ - ଆପଣଙ୍କର କୋଡ୍ USDC କୁ ପେୟର୍ ଠିକଣାକୁ ପୁନଃ ପଠାଏ | Stripe ଡ୍ୟାସ୍ବୋର୍ଡ ଦ୍ୱାରା ସ୍ୱୟଂଚାଳିତ |
| ଆନ୍ତର୍ଜାତୀୟ ସହାୟତା | ସେଇ ୱାଲେଟ୍, କୌଣସି ଦେଶ, କୌଣସି ଅତିରିକ୍ତ କନଫିଗରେସନ୍ ନାହିଁ | ପ୍ରତି-ଦେଶ ଲାଇସେନ୍ସିଂ, ମୁଦ୍ରା ପରିବର୍ତ୍ତନ, ଅଞ୍ଚଳୀୟ ନିୟମ |
| ଏହା ପାଇଁ ସର୍ବୋତ୍ତମ | ପ୍ରୋଗ୍ରାମାଟିକ୍ ଏଜେଣ୍ଟ-ଚାଳିତ API ଉପଭୋଗ | ମାନବ-ଚାଳିତ ଚେକଆଉଟ୍ (SaaS ସାଇନ୍ଅପ୍, ଇ-କମର୍ସ) |
ଅଧିକାଂଶ API provider ଯେ pattern ରେ ଆସନ୍ତି: human signup flow (ଆପଣଙ୍କ dashboard, ଆପଣଙ୍କ subscription product page) ପାଇଁ Stripe ରଖନ୍ତୁ; programmatic agent access ପାଇଁ API edge ରେ Blockchain0x ଯୋଡ଼ନ୍ତୁ। x402 adapter କେବଳ ଆପଣ ତାହାର pricing table ରେ ରଖିଥିବା route ଗୁଡ଼ିକୁ gate କରେ, ସେହିପାଇଁ ଆପଣଙ୍କ human, Stripe-authenticated route ଗୁଡ଼ିକ ଅସ୍ପୃଶ୍ୟ ରହେ। agents କୁ priced route ଉପରେ ଏବଂ humans କୁ ଅନ୍ୟ ସବୁଠାରେ ନିର୍ଦ୍ଦେଶ କରନ୍ତୁ, ଏବଂ ଉଭୟ audience ଏକେ API code ଦ୍ୱାରା ସେବା ପାଉଛନ୍ତି।
ପ୍ରୋ ପ୍ରାରମ୍ଭିକ ଟ୍ରାଫିକ୍ ପାଇଁ। ଅଡିଟ୍ ଲଗ୍ ଆବଶ୍ୟକତା ହେବାବେଳେ ବ୍ୟବସାୟ।
API ପ୍ରଦାତା ସାଧାରଣତଃ ପ୍ରଥମ ଦିନରୁ Pro ରେ ଆରମ୍ଭ କରନ୍ତି: Free କେବଳ ପଢିବାକୁ ଅଛି, ଏବଂ x402 ଅଡାପ୍ଟରକୁ ଦେୟ ସଂଖ୍ୟା କରିବା ପାଇଁ API ପ୍ରବେଶ ଆବଶ୍ୟକ, ଏବଂ ସେଗୁଡିକୁ ଟ୍ରାକ୍ କରିବା ପାଇଁ webhook ଆବଶ୍ୟକ। ଉଚ୍ଚ-ଟ୍ରାଫିକ୍ API ମାସିକ ଆୟତନ ବୃଦ୍ଧି ପାଇଁ ବ୍ୟବସାୟ ଅଞ୍ଚଳକୁ ଗଲା। ସଠିକ୍ ପ୍ରତି-ଏଜେଣ୍ଟ ଖର୍ଚ୍ଚ ପାଇଁ ମୂଲ୍ୟ ପୃଷ୍ଠାକୁ ଦେଖନ୍ତୁ ଏବଂ କେଉଁଠି ତିଆରି ଅଛି।
- Free: କେବଳ dashboard ଏବଂ metadata exploration ପାଇଁ ଉପଯୋଗୀ। Read-only, ସେହିପରି adapter payments settle କରିପାରେ ନାହିଁ।
- Pro: live API monetization ପାଇଁ default। Full API access, webhooks, exports.
- Business: ଯେତେବେଳେ compliance ପାଇଁ audit logs କିମ୍ବା higher API rate limits ଦରକାର।