Skip to main content
The central configuration object for Key0. Pass it wrapped in a Key0Config object to any framework integration to stand up payment-gated endpoints:
  • Expresskey0Router({ config, adapter, store, seenTxStore })
  • Honokey0App({ config, adapter, store, seenTxStore })
  • Fastifyfastify.register(key0Plugin, { config, adapter, store, seenTxStore })
  • FactorycreateKey0({ 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-level routes. 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 your fetchResource callback after on-chain settlement.

FetchResourceResult

Returned by your fetchResource callback.

PaymentInfo

Available in req.key0Payment (embedded mode) and FetchResourceParams.paymentInfo (standalone mode).

IssueTokenParams

Passed to fetchResourceCredentials after payment verification.

TokenIssuanceResult

Returned from fetchResourceCredentials.

Minimal Example

A working configuration with only the required fields:

Full Example

All optional fields included:

Embedded Quickstart

Get started with SellerConfig in your existing Express/Hono/Fastify app.

Factory

createKey0() — the factory that wires SellerConfig into the full SDK.