[ HTTP 402 ] · MULTI-TOKEN ON-CHAIN

HTTP 402 payments for AI agents & tokenized APIs

Price API routes in compute units, return a standards-aligned 402 quote, and accept wallet-signed EIP-712 payment proofs on retry. Channel keeps balances non-custodial while settling supported ERC-20 tokens such as USDC and USDT.

  • Handshake 402 → 200 quote, sign, retry
  • Custody Self-custodial wallet-held keys
  • Authorization EIP-712 wallet-signed proofs
Payment flow 402 → sign → 200
CLIENT AI Agent ChannelCash SDK
402 Paid API Fee quote
WALLET Channel EIP-712 sign
200 Response Data returned
agent-client.ts Live

Non-custodial payments,
verified at the protocol layer

Channel is an HTTP 402 payment protocol, not a custodial processor. User balances remain on-chain in supported ERC-20 tokens, while each API call is authorized by an EIP-712 proof and reconciled through the on-chain ledger.

USDC · USDT ERC-20 settlement
EIP-712 Typed authorizations
Token-aware Micro-unit pricing
402 → 200 HTTP negotiation
01

On-chain ledger

ERC-20 deposits, payer balances, settlement batches, withdrawals, and subscriptions are accounted for on the Channel ledger contract.

ChannelLedger.sol
02

Payment manifest

Publish endpoint pricing at /.well-known/payment-manifest.json, including token address, unit price, base fee, and ledger contract.

Open pricing
03

Precision pricing

Quote fees from compute units and token decimals, enabling deterministic micro-pricing without minimum card charges.

Compute units
04

P2P & subscriptions

Use the same ledger primitives for peer transfers, QR invoices, subscription renewals, and gated API access.

Peer + plans

Wire format & on-chain reference

Typed-data payment proofs, HTTP 402 negotiation, nonce-based replay protection, and ledger settlement for supported ERC-20 tokens.

Schema channel.protocol.v1
Network Base Sepolia · local Hardhat
Handshake 402 → sign → retry → 200
Tokens USDC · USDT · ERC-20 registry

01 Cryptography

Standard
EIP-712 typed structured data
Algorithm
ECDSA on curve secp256k1
Payment struct
LedgerPayment — off-chain spend authorization for a single paid request
Settle struct
LedgerAuth — validator co-signed settlement, withdrawal, and subscription authorization
Payment domain
name = SaaS host · version = 1 · chainId · verifyingContract
Ledger domain
ChannelLedger v1 · batch settle · subscription renewal
Nonce
timestamp_ms × 10⁶ + random · replay protection per payer

02 HTTP wire format

402 body
PAYMENT_REQUIRED · compute units · token · estimatedFee · nonce context
Auth header
X-Payment-Auth — base64 JSON { proof, sig, domain } carrying typed-data authorization
Payer headers
X-Channel-Payer · X-Channel-Max-Amount · X-Channel-Client-Source
Pricing
compute units × unit price + base fee → feeMicro in token micro-units

03 On-chain ledger

Contract
ChannelLedger.sol — balances · settle · withdraw · subscriptions
Deposit
CREATE2 ChannelDepositProxy · deterministic per payer
Tokens
supportedTokens registry · token decimals · USDC · USDT · extensible
Co-sign
Platform validator EIP-712 authorization for settlement batches and ledger mutations
Sync
Wallet sync every 30s · pending signature batch to chain

EIP-712 struct definitions

Solidity-compatible field layout
LedgerPayment off-chain sign
struct LedgerPayment {
  address payer;
  address payee;
  address proxyAddress;
  address token;
  uint256 amount;
  uint256 nonce;
  uint64  expiry;
}
LedgerAuth on-chain settle
struct LedgerAuth {
  address payer;
  address payee;
  address token;
  uint256 amount;
  uint256 nonce;
  uint64  expiry;
}

Autonomous agents need
verifiable spend authorization

Agents can call paid APIs thousands of times per session while Channel enforces per-request pricing, max-spend limits, and wallet-signed EIP-712 proofs.

01

Headless SDK

ChannelCash wallet client for LangChain, CrewAI, backend workers, and custom runtimes

02

Wallet-signed proofs

Private keys remain in wallet context; agents submit signed payment proofs, not API secrets

03

Metered spend

Set max amounts per inference, tool call, query, or data request in supported tokens

04

Human review

Escalate high-value or interactive approvals to browser extension or mobile wallet flows

agent-client.ts consumer
const pay = withChannel(client);
const { data, fee } = await pay(
  "/api/v1/greeting",
  {},
  { maxAmount: "0.01" }
);
agent-runtime.trace Live
SDK 01

ChannelCash SDK init

GET /api/v1/greeting
402 02

PAYMENT_REQUIRED

estimatedFee · computeUnits
WALLET 03

Sign LedgerPayment

EIP-712 · X-Payment-Auth
200 04

Verify & deliver

token settled · response JSON
> pay("/api/v1/greeting")

Your keys. On-chain balances. Local signatures.

Channel never takes custody of user funds. Wallets hold the signing keys, balances remain on-chain, and payment authorizations are produced locally by extension, mobile, or headless clients.

Browser extension

Chrome

Connect sites, inspect spend requests, sign EIP-712 payloads, and approve peer transfers directly in the browser.

  • Website approvals
  • Payment review
  • P2P send

Mobile app

iOS Android

PIN and biometrics, QR receive requests, account profiles, and remote approvals from your phone.

  • PIN and biometrics
  • QR receive
  • Remote approve

HD multi-account

BIP-39

HD-derived accounts from one recovery phrase, with @username profiles and per-account activity.

  • @username
  • Derived keys
  • Activity stats
Scan to pay

Waiting for $5.00

Waiting for payment…

@alice · Channel

Payment received

+$5.00 USDT

Credited to @alice

From @bob Just now

"Signing happens at the edge. Settlement remains verifiable on-chain."

Quote, authorize,
verify, settle

The SDK discovers pricing from the payment manifest or a 402 quote, asks the wallet to sign a typed LedgerPayment, retries with X-Payment-Auth, and lets the provider verify before serving the paid response.

Client / Agent ChannelCash · self-custodial wallet
Build request 0.001 USDC → 0x4f3a…9c2
0.3 ms
Sign EIP-712 proof
2.1 ms
Attach payment header X-Payment-Auth: 0x9b2f…a7c1
2.3 ms
Response received
{
  "greeting": "Hello, agent",
  "paid": "0.001 USDC",
  "tx": "0x9b2f…a7c1"
}
≈ 20 ms round-trip
Merchant Server Channel middleware · your API
Verify proof EIP-712 signature ✓
7.4 ms
Settle on ledger debit 0.001 USDC · tx 0x7e…
12.8 ms
Run API handler GET /api/v1/greeting
16.4 ms
Return 200 + data 200 OK · application/json
16.8 ms

Providers: wrap routes with monetize() middleware · Merchants: reconcile signed requests, ledger balances, and supported tokens

Middleware for providers.
Wallet clients for consumers.

Typed SDKs for Node.js and browsers, HTTP 402 middleware, wallet providers, payment manifests, and Solidity contracts in one integration stack.

Node.js Channel Node.js SDK
TypeScript Typed SDKs
React Web demo · wallet flows
Browser Channel Browser SDK
Express monetize() middleware
Expo Mobile wallet app
Solidity ChannelLedger.sol
Python Coming soon
server.ts
// Gate an Express route with HTTP 402
import { setupChannel } from "@channel-sdk/nodejs";

const { monetize } = setupChannel(app, endpoints, { merchantWallet });

app.get("/api/v1/greeting",
  monetize(5),
  (req, res) => res.json({
    message: "Hello",
    fee: req.payment!.fee
  })
);
// AI agent or backend — self-custodial wallet
import { ChannelClient, withChannel } from "@channel-sdk/nodejs";

const client = new ChannelClient({
  baseUrl: process.env.DEMO_SAAS_URL,
  mnemonic: process.env.CHANNEL_MNEMONIC,
  clientSource: "ChannelCash",
});
const pay = withChannel(client);

const { data, fee } = await pay(
  "/api/v1/greeting",
  {},
  { maxAmount: "0.01" }
);
console.log(data, fee);
// Browser — extension signs, wallet holds keys
import {
  ChannelBrowserClient,
  ExtensionWalletProvider,
  withChannelBrowser,
} from "@channel-sdk/browser";

const wallet = new ExtensionWalletProvider();
const client = new ChannelBrowserClient({
  baseUrl: import.meta.env.VITE_DEMO_SAAS_URL,
  wallet,
});
const pay = withChannelBrowser(client);

await wallet.connect({ origin: window.location.origin });
const { data, fee } = await pay(
  "/api/v1/greeting",
  {},
  { maxAmount: "0.01" }
);
Packages Monorepo · typed SDKs · open source
@channel-sdk/nodejs available

Express middleware, 402 negotiation, headless agents, ChannelCash wallet client

@channel-sdk/browser available

Extension and mobile wallet providers for connection, EIP-712 signing, and approvals

react-demo available

Browser demo for wallet connection, paid requests, and approval flows

ChannelLedger.sol available

Multi-token ledger · EIP-712 domains · validator co-sign

expo-wallet available

React Native wallet · HD accounts · PIN · biometrics · QR approvals

@channel-sdk/python soon

Agent frameworks · LangChain tool payments · spend policies

Join the community
while we launch

Channel isn't live yet — follow along for protocol updates, early access, and launch news on Telegram and X.

Crypto investor? Express your interest
AI agents Micropayments ERC-20 settlement Subscriptions