#15331·langflow

Feature request: x402 Pay-Per-Call Component — answers HTTP 402, settles per call in Nano (XNO)

Author: dhyabi2Created Sep 23, 2026Updated Sep 24, 2026

Feature request: x402 Pay-Per-Call Component (answers HTTP 402, settles per call in Nano/XNO)

Problem

A growing number of agent APIs are priced per call over the x402 protocol (HTTP 402 Payment Required with a machine-readable payment envelope in the accepts[] field) — no signup, no merchant account, pay per invocation. Langflow flows today cannot call such an endpoint without custom code: there is no Component that understands a 402 envelope, quotes a price, settles, and retries.

Proposed Component

An open-source, free Langflow Component that:

  1. calls an x402-priced MCP tool endpoint with the flow's inputs;
  2. if the server answers 402 Payment Required with a valid accepts[] envelope (network/asset/amount/payTo), reads the quoted price and rail;
  3. if a payer (Nano/XNO wallet seed) is configured, signs a feeless exact-scheme transfer for the quoted amount, sends it, retries with the payment proof, and returns the result;
  4. if no payer is set, returns the payment challenge so a user/wallet can complete it — and never moves money on a malformed 402 (scoped to trigger only on an explicit 402 with a valid envelope; fails cleanly otherwise).

Nano (XNO) is instant, feeless and green (zero gas), so sub-cent per-call prices have no floor — a natural per-call settlement rail for tool endpoints.

Reference implementation (tested)

I built and tested a working implementation of this Component shape — X402PayPerCall — using the standard Langflow Component class (Component, Input, Output) with the x402-exact spec and the existing building blocks (feeless402, @x402nano/exact, no re-invention). Tests cover:

  • envelope parsing (v2 exact + v1),
  • no-wallet → returns challenge and spends nothing,
  • wallet → signs, sends, retries with PAYMENT-SIGNATURE; over-price-cap refuses and spends nothing,
  • malformed/empty 402 → never pays.

Ask

Would you accept an x402 pay-per-call Component example in the Langflow component marketplace (or as a contribution PR per docs.langflow.org/contributing-components), so any flow can drop in a tool that settles per call in Nano? I can open the PR with the component source + tests + a README per the contributing guide.

Links