Key0Config object to any framework integration to stand up payment-gated endpoints:
- Express —
key0Router({ config, adapter, store, seenTxStore }) - Hono —
key0App({ config, adapter, store, seenTxStore }) - Fastify —
fastify.register(key0Plugin, { config, adapter, store, seenTxStore }) - Factory —
createKey0({ config, adapter, store, seenTxStore })
Identity
Fields that populate the A2A agent discovery card.Payment
Product Catalog
Challenge
Credential Issuance
Per-Request Proxy (Standalone Gateway)
Enable standalone gateway mode for top-levelroutes. In standalone mode, clients call the route directly, Key0 returns a 402 challenge for paid routes, and then proxies the request to your backend after payment. Subscription plans still use POST /x402/access.
Only one of
fetchResource or proxyTo is needed. Use proxyTo for simple URL forwarding; use fetchResource when you need full control over the request.Lifecycle Hooks
Optional callbacks fired during the challenge lifecycle. Both are fire-and-forget — failures are logged but do not affect the payment flow.MCP
Customization
Settlement
Control how on-chain settlement is performed. By default, settlement is routed through the Coinbase Developer Platform facilitator.Supporting Types
Plan
Defines a pricing tier that buyers can select.Route
ProxyToConfig
FetchResourceParams
Passed to yourfetchResource callback after on-chain settlement.
FetchResourceResult
Returned by yourfetchResource callback.
PaymentInfo
Available inreq.key0Payment (embedded mode) and FetchResourceParams.paymentInfo (standalone mode).
IssueTokenParams
Passed tofetchResourceCredentials after payment verification.
TokenIssuanceResult
Returned fromfetchResourceCredentials.
Minimal Example
A working configuration with only the required fields:Full Example
All optional fields included:Related
Embedded Quickstart
Get started with SellerConfig in your existing Express/Hono/Fastify app.
Factory
createKey0() — the factory that wires SellerConfig into the full SDK.

