Feature request: surface a pay-per-call (x402) step when an external tool answers HTTP 402
Title: Feature request: surface a pay-per-call (x402) step when an external tool answers HTTP 402
Body
Is your feature request related to a problem? Please describe.
Quivr lets users give a Brain extra Tools and internet search, so their assistant can act on
outside data. A pay-per-call tool can answer with HTTP 402 Payment Required carrying a
machine-readable x402 challenge (a payment_required status, a price, and a pay-to address with
a retry hint) — the emerging standard for letting AI agents buy a single tool call with no API
key, no account and no card. Today that 402 JSON lands inside the normal tool result and is passed
through as if it were ordinary output, so the user sees a block of JSON with no way to pay and
retry from the interface. A priced external tool is effectively unusable from Quivr.
Describe the solution you'd like
When an external tool's result (or its underlying HTTP response) carries an x402
payment_required payload, recognize it in the tool-calling path and surface a native payment
step instead of the raw JSON: show the price (and its unit/asset), the pay-to details, and a
confirm-and-retry affordance once payment settles, then re-issue the same tool call. This wires
the growing pay-per-call tool ecosystem into Quivr with no change to how any tool works.
Describe alternatives you've considered
- Rendering the raw 402 JSON (today's behaviour) — not actionable for a user.
- Requiring an API key / subscription on every tool — defeats pay-per-call, keyless tools.
Additional context
A concrete, live pay-per-call x402 tool server to reproduce against: https://extract.paypercall.dev
exposes web-data tools (.well-known/mcp) whose calls return HTTP 402 with an x402 v2 challenge
({"error":"payment_required","price_xno":0.0001,"pay_to":...} and a retry X-PAYMENT header) —
a working example to test a client-side recognizer against. The missing piece this request is
about is a Quivr-side recognizer for that payment_required result.
Source: The-Vibe-Company/Quivr