x402 Cloud
Deploy paid API endpoints in minutes. Bankr handles hosting, payments, and discovery.
x402 Cloud lets you deploy serverless API endpoints that agents and developers pay for automatically using the x402 payment protocol. Write a simple handler function, set your price, deploy with one command — and start earning.
Manage your endpoints at bankr.bot/x402 — view usage, revenue, logs, and configure settings.
Why x402 Cloud?
| Feature | Benefit |
|---|---|
| Zero x402 knowledge required | Write plain Request → Response handlers. We wrap the payment layer. |
| Deploy in seconds | bankr x402 deploy bundles and ships your code instantly |
| Any token on Base | Accept USDC by default, or price in any ERC-20 — see Custom Tokens |
| Real-time logs | See every paid request, payment, and console output in the dashboard |
| Agent discovery | Endpoints enabled for discovery are listed in the public marketplace and findable by AI agents |
| Secure secrets | Environment variables are encrypted at rest and isolated per account |
| Usage-based pricing | Set a max price, settle only the actual cost with the upto scheme |
| Settle-after-response | Payments are only collected if your endpoint returns successfully |
How It Works
Developer Agent / Client
│ │
│ bankr x402 deploy │ GET /weather?city=London
│──────────────────► │─────────────────────────►
│ │ ◄── 402 + PaymentRequirements
│ Handler runs on │
│ Bankr infrastructure │ Signs payment, retries
│ │─────────────────────────►
│ │ ◄── 200 { temp: 72 }
│ │
│ Revenue appears │ Payment settled on-chain
│ in dashboard │
- You write a handler and deploy via CLI
- An agent calls your endpoint — gets a 402 with pricing
- The agent's wallet signs a payment and retries
- Bankr verifies the payment, runs your handler, settles on-chain
- You see the request, logs, and revenue in your dashboard
Create Endpoints via Chat
You can create, deploy, and manage x402 endpoints entirely through the Bankr agent — no CLI or local setup needed. Describe what you want and Bankr writes the TypeScript handler, deploys it, and gives you the live URL.
create an x402 endpoint called "sentiment" that takes a stock ticker
and returns a sentiment score from recent news. charge $0.005 per request.
The agent handles the full lifecycle:
| Action | Example prompt |
|---|---|
| Create | "deploy an x402 endpoint called hello that returns a joke for $0.001" |
| Update code | "update my sentiment endpoint to also return a confidence score" |
| Update config | "change the price of my sentiment endpoint to $0.01" |
| Pause/Resume | "pause the sentiment endpoint" |
| View logs | "show me the recent logs for my hello endpoint" |
| Delete | "delete the hello endpoint" |
| List all | "list my x402 endpoints" |
| Inspect | "show details for my sentiment endpoint" |
Endpoints created through chat are identical to CLI-deployed ones — same runtime, same URL format (https://x402.bankr.bot/<wallet>/<name>), same billing. You can manage chat-created endpoints with the CLI and vice versa.
Handler Context
Your handler receives a ctx object with optional capabilities you can enable at deploy time:
| Capability | What it provides | Use case |
|---|---|---|
ctx.files | Read/write persistent files scoped to /x402/<name> | CSV ledgers, JSON state, uploaded assets |
ctx.appKV | Key-value store shared with your Bankr apps | Drive app dashboards from endpoint data |
ctx.askAgent | Send a prompt to your Bankr agent | Trigger Telegram notifications after payment |
Each capability is opt-in — the agent declares what your handler needs when deploying (with the CLI, add the files, appKV or agent block in bankr.x402.json) and only those fields are populated at runtime.
Environment Variables
Endpoints can read secrets via process.env. Declare the variable names at deploy time (values are never passed through chat). Set the actual values through Terminal Settings or the CLI. The agent's x402 env vars are stored in a separate encrypted scope from your regular agent env vars.
The Marketplace
The public x402 marketplace at bankr.bot/terminal/x402/discover is browsable by anyone, no account needed. It lists only endpoints Bankr has enabled for discovery — a new deployment isn't listed automatically, though anyone can call it by its URL. Each service card shows how many endpoints it exposes, its price, network and tags; opening one shows every route in full — methods, description, price, the request/response schema and the live URL to call.
What you put in your config file is what the marketplace shows, so it is worth filling in:
| Field | Where it shows up |
|---|---|
description | The card body and the detail drawer |
category | The card's badge and the category filter chips |
tags | Card chips (the first four) and search matching |
schema | The request/response schema block in the drawer |
The same catalogue backs agent discovery and the CLI's
bankr x402 search, so one
well-described endpoint is findable from chat, the terminal and the browser
alike.
Pricing
No monthly fees: the first 1,000 settled requests each month on USDC- or EURC-priced endpoints are fee-free, then a 5% platform fee is taken at settlement, and earnings go straight to your wallet. See Pricing.