Introducing a new way to review your PRs.

Read the announcement

solana-foundation / pay

CLI for Agentic payments (x402, MPP, AP2).

View on GitHub

30 documents · Updated Nov 11, 2026

docs / payment-debugger-web-ui

Payment debugger web UI

The payment debugger web UI is a Vite-based browser tool for watching paid HTTP traffic as it happens. It turns request activity into readable flows so an engineer can see payment gates, retries, session channel use, receipts, model work, and provider health in one place. The page sits between the browser application and the service that correlates raw requests; see the payment debugger browser application and the payment debugger API correlation layer pages for those child views. The related debugger UI and correlation API page gives another view of this boundary.

System purpose

The web UI gives a live view of payment and inference traffic served by the local or deployed payment service. The browser does not discover payment meaning on its own. The API observes completed requests, groups related requests into flows, and sends a small event stream that the UI renders.

Product boundary

The browser application is a read view over recent activity. It helps an engineer answer three questions: which request is active, which payment or inference steps completed, and what evidence supports the result. It is not a wallet, a ledger, or a long-term record of traffic.

The service keeps recent data in memory and sends it to connected browsers. A flow contains the request path, protocol, status, timing, events, and selected payment or inference data. This shared shape lets the list, detail view, and filters describe the same activity.

References: web-ui/README.md• L1-16 web-ui/…/types.ts• L115-151 web-ui/…/index.ts• L24-34

Runtime placement

In local development, Vite serves the browser on port 5173 while the Express service runs on port 3000. Vite forwards the payment and debugger paths to Express, so the browser uses one set of paths in both modes. A deployed build serves the static browser files and rewrites those same paths to the server function.

The same browser assets can also run beside a gateway proxy in the embedded payment binary. This gives gateway users a debugger without changing the basic browser-to-API relationship.

References: web-ui/package.json• L6-14 web-ui/vite.config.ts• L4-16 web-ui/vercel.json• L1-11 web-ui/README.md• L12-29

Live activity stream

The live activity stream carries both the first view of recent flows and later changes. The browser opens a Server-Sent Events (SSE) stream, where SSE means a one-way HTTP stream of small messages from the service to the browser.

This diagram shows how a completed request becomes a visible flow and how the browser keeps that flow current.

flowchart LR
    A[HTTP request and response] --> B[Request capture]
    B --> C[Flow correlation]
    C --> D[SSE message]
    D --> E[Browser state]
    E --> F[Flow list and detail view]

Flow lifecycle

The service first sends the viewer address and a snapshot of current flows. It then sends flow creation and update messages as new payment activity arrives. The browser marks the stream as connected and applies each message to its local state.

The correlation layer recognizes MPP, x402, and session activity. It can also show a successful paid request when the matching challenge was not captured. A payment-required flow becomes failed when no payment retry arrives within the service timeout, which keeps stale work visible instead of leaving it active forever.

References: web-ui/…/index.ts• L120-185 web-ui/…/index.ts• L187-213 web-ui/…/correlation.ts• L52-89 web-ui/…/useFlows.ts• L87-147

Flow states

The flow list uses status and timing to make the current point in a payment exchange clear. The detail view expands the same state into a step track and an event log.

StateMeaning in the user view
in-progressThe request is still waiting for its upstream result.
payment-requiredThe service returned a payment gate and waits for a retry.
payment-receivedThe paid retry was seen but the resource is not yet shown as delivered.
resource-deliveredThe paid request completed and the resource was returned.
failedThe exchange failed or became stale.

References: web-ui/…/types.ts• L6-22 web-ui/…/FlowRow.tsx• L44-86 web-ui/…/SequenceDiagram.tsx• L45-76 web-ui/…/EventLog.tsx• L41-67

Browser inspection views

The main view has a flow area and a collapsible side area. The flow area supports selection, search, status filters, and clearing the recent view. Selecting a row exposes the sequence diagram, event evidence, and the panel that best matches the flow type.

Payment flow views

MPP and x402 traffic appears as a flat list of payment flows. Each row shows the protocol, resource path, status, amount when known, duration, and start time. The detail view shows the order of the request, payment gate, paid request, and resource delivery.

The payment panel turns challenge data into a view of the payer and recipient shares. It also handles signed authentication and subscription access as access events rather than as a false zero-value payment. When the response contains a usable receipt, the view links to the settlement record on pay.sh.

References: web-ui/…/App.tsx• L43-62 web-ui/…/FlowRow.tsx• L49-85 web-ui/…/FlowDetail.tsx• L16-41 web-ui/…/PaymentSplits.tsx• L195-240 web-ui/…/ReceiptLink.tsx• L15-61

Session channel views

A session channel is a funded payment path that can carry several requests. The UI presents its state, cap, cumulative watermark, remaining value, voucher count, and recipient splits so an engineer can relate many paid calls to one channel.

The session view also shows whether the channel is opening, open, settling, closed, or failed. It links recipient accounts to a Solana explorer using the configured network, which helps connect the browser evidence to on-chain account activity.

References: web-ui/…/types.ts• L32-64 web-ui/…/SessionChannel.tsx• L311-325 web-ui/…/SessionChannel.tsx• L376-524 web-ui/…/useConfig.tsx• L92-104

Inference activity views

Inference mode uses the same live stream to show model work in addition to payment work. An inference flow records the provider, model, endpoint kind, streaming choice, time to first token, token counts, and token rate when the service reports them.

Connection groups

A connection is a summary of related requests from one client context. Inference mode groups flows by connection and places the newest active connection first. Each group gives a compact view of request success, model use, token totals, and paid value. Flows that cannot be matched to a connection remain visible in an other group.

The mode changes the toolbar from flow filters to connection counts and model search. A selected request still opens its detail view, so group totals and request-level evidence can be read together.

References: web-ui/…/connections.ts• L34-89 web-ui/…/ConnectionGroup.tsx• L38-98 web-ui/…/FlowList.tsx• L75-123 web-ui/…/App.tsx• L64-79

Inference detail

An unmetered inference request uses a short request → first token → completed timeline. A request that also carries payment data keeps the full payment sequence, because the payment exchange is part of the evidence an engineer needs to inspect.

The detail panel separates model facts from payment facts. It marks a live request, shows time to first token and throughput, and keeps missing measurements explicit instead of treating them as zero.

References: web-ui/…/inference.ts• L39-99 web-ui/…/InferencePanel.tsx• L20-68 web-ui/…/FlowDetail.tsx• L19-38

Provider catalog

The provider catalog shows the proxy providers known to the running service. A provider is an upstream model or data service that the gateway can reach through a configured proxy. The side panel shows whether each provider is up, its endpoint port when known, its model list, its version, and available model price notes.

Provider data can start with the service configuration and then be replaced by live provider-status messages. Model badges use provider colors when the service supplies a safe color value. This keeps the catalog useful before the first live status message while allowing current health data to take precedence.

References: web-ui/…/types.ts• L68-95 web-ui/…/useFlows.ts• L10-20 web-ui/…/ProviderSidebar.tsx• L9-89 web-ui/…/inference.ts• L26-37

The browser reads service configuration from the debugger API. That configuration supplies the page title, network, RPC address, payment recipient, endpoint catalog, and optional inference mode and provider list. The sidebar uses it to show available endpoints, prices, network details, recipient links, and a first request command.

Receipt and account links depend on the configured network. Known network names map to pay.sh receipt views or Solana explorer views; an unknown receipt network can prevent a generated link, while a direct receipt URL from the service remains usable.

References: web-ui/…/useConfig.tsx• L7-35 web-ui/…/index.ts• L215-278 web-ui/…/Sidebar.tsx• L45-149 web-ui/…/ReceiptLink.tsx• L10-30

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the flow and SSE message shapes aligned between web-ui/…/types.ts, the correlation service, and the browser reducer. A new message type is invisible until each side accepts it.
  • Keep the debugger stream and config paths aligned across web-ui/…/useFlows.ts, web-ui/…/useConfig.tsx, web-ui/vite.config.ts, and web-ui/vercel.json.
  • Keep mode and provider fields aligned between the config response, the mode switch, connection groups, model badges, and the provider side panel.
  • Keep payment header and receipt parsing aligned with the protocol data used by the sequence, split, session, and receipt views.
  • Keep session field changes aligned between challenge decoding, authorization updates, session metrics, and recipient split display.

Important failure modes

TriggerConsequenceGuard
The SSE route is unavailable or the connection drops.The toolbar shows a disconnected state and no new flows reach the browser.Check the service and the /__402/pdb/logs/stream route before debugging a missing request.
A payment challenge does not contain recognized MPP or x402 data.The request is not turned into a payment flow, or the detail view cannot draw payment splits.Inspect the captured response headers and body against the protocol contract.
A payment gate receives no retry for the timeout window.The flow changes to failed and stays visible as a stale exchange.Check the client retry and payment credential path.
A successful response has no receipt signature or receipt URL.The detail view has no View receipt link.Check the response receipt headers and payload before tracing the network link.
A configured provider is down or reports no models.The provider is shown as not detected and model choices are absent.Check the provider endpoint and its live status data.

Key files

FileWhy to read it
web-ui/README.mdStates the product goal, operating modes, local start path, and deployment shape.
web-ui/vite.config.tsShows how the Vite browser reaches the local service during development.
web-ui/…/index.tsShows the service boundary for request capture, config, flow streaming, and demo payment routes.
web-ui/…/correlation.tsShows how request evidence becomes a payment flow and how stale flows fail.
web-ui/…/types.tsDefines the shared vocabulary for flows, sessions, inference data, providers, connections, and SSE messages.
web-ui/…/App.tsxShows how configuration, live state, modes, filters, and the two-pane view fit together.
web-ui/…/useFlows.tsShows how the browser receives and applies snapshots and live updates.
web-ui/…/FlowDetail.tsxShows how payment, session, and inference evidence is selected for a flow.
web-ui/…/SessionChannel.tsxShows the user-facing model for cumulative session payment and recipient shares.
web-ui/…/ProviderSidebar.tsxShows the provider health, model, version, and pricing view.