NexusPay · docs
x402 · testnet USDC · Gemini

The agent that buys its own data

NexusPay takes a natural-language question, decides which paid sources are worth buying, pays per call over the x402 protocol, and synthesizes the answer — inside a strict budget, with every payment logged.

terminal
# one command brings up the whole thing
$ make ui
# or ask the agent directly
$ curl -X POST localhost:8000/query -d '{"query":"sentiment on open source LLMs"}'
 plan · pay /sentiment $0.002 · pay /news $0.001 · answer ✓

Why NexusPay

A reference implementation for autonomous, pay-per-call data pipelines.

Autonomous decisioning

An LLM reads your query and the source catalog, then picks exactly which sources to buy.

Machine-native payments

Each purchase settles over the x402 HTTP protocol with testnet USDC — no subscriptions, no human approval.

Budget discipline

Per-query and daily caps are enforced before any money moves. The agent cannot overspend.

Fully auditable

Every payment attempt — success or failure — is written to SQLite with its reasoning.

How it works

One POST request travels through five stages.

Plan

Gemini selects the sources worth buying for your question.

Budget

Per-query and daily caps are checked before any call.

Pay

Each source is paid for over x402: 402 → sign → verify → 200.

Synthesize

The purchased data becomes one coherent answer.

Log

Every settlement lands in the spend log for audit.

Read the documentation

Architecture, the x402 handshake, every module, and the algorithms behind it.

Static HTML for SEO SPA for speed AI-ready · llms.txt + raw markdown