No endpoint is configured anywhere. An agent arrives with a question, reads a live marketplace of AI services, ranks them on capability, reputation, price and latency, settles a 402 micropayment on Stellar with whichever one wins, and comes back with a cited answer — in about three seconds.
30 seconds, entirely autonomous, using live data · or press D anywhere
0
Answers delivered
0.000 XLM
Settled on Stellar
0
Indexed passages
—
Mean latency
Live from this deployment · Gemini on testnet
The handshake
402 Payment Required sat unused in the HTTP spec for thirty years. It turns out to be exactly the right primitive when the client is software with a wallet and no patience for a signup form.
Call
The agent requests an answer with no credential.
402
The server replies with destination, amount, and memo.
Settle
The agent pays on Stellar. Ledger closes in ~5s.
Redeem
The hash is verified on-chain and buys query credits.
Answer
The retry streams back, cited, one credit spent.
$ curl -X POST https://agentic-rag-paywall-api.onrender.com/api/v1/rag/query \
-d '{"query":"Why does the memo matter?",
"agent_id":"agent_researcher"}'
← HTTP/1.1 402 Payment Required
X-Payment-Address: GAGKTSAT…K4J63NWKH
X-Payment-Amount: 0.01
X-Payment-Asset: XLM
X-Payment-Network: testnet
X-Payment-Memo: x402-9f3a21c8
X-Payment-Credits: 10
# agent signs and submits on Stellar … 3.1s
$ curl -X POST …/payments/verify \
-d '{"transaction_hash":"11d2e29a…",
"agent_id":"agent_researcher",
"challenge_id":"chal_4b7e…"}'
← HTTP/1.1 200 OK
{ "verified": true,
"mode": "live",
"credits_granted": 10,
"access_token": "argp.eyJhaWQiOi…" }
$ curl …/rag/query -H "Authorization: Bearer argp.…"
← HTTP/1.1 200 OK
{ "answer": "A memo attributes an incoming
payment to a specific challenge [1]…",
"citations": [
{ "marker": 1,
"locator": "The Stellar Network › Memos",
"score": 0.85, "used": true } ],
"confidence": { "percent": 89,
"label": "High confidence" },
"cost_xlm": 0.01,
"credits_remaining": 9 }What is actually built
Each of these is inspectable in the running product — not a claim on a slide.
Providers publish capabilities, price, latency and payment terms to an open registry. The agent enumerates it at request time — nothing is hard-coded, and a service listed a minute ago is rankable immediately.
Competence multiplies the score rather than adding to it, so a cheap generalist can never outbid the domain expert. Price and speed compete only among providers that can actually answer.
An unpaid call returns 402 with the address, the exact amount, and a memo that binds the payment to the request. Agents discover the price from the endpoint, not a pricing page.
The token proves identity; the ledger holds value. Each answer debits one credit inside the transaction that records it, so a stolen token buys nothing once the balance is spent.
Dense Gemini embeddings fused with BM25 through Reciprocal Rank Fusion. Paraphrase and rare literal tokens both land — and the fusion is visible in the UI.
Every claim carries a marker that opens the exact passage: document, section breadcrumb, page number, and similarity score.
Scored from retrieval similarity and citation coverage — never the model's own self-assessment, which is poorly calibrated. Expand it to see every input.
If generation fails or the connection drops mid-stream, the credit is refunded automatically. Retrying is always safe.
Retrieval pipeline
Six stages, all instrumented. The console shows you the trace for every answer: what each retriever ranked, how fusion reordered it, and why a candidate was dropped.
Parse
PDF · DOCX · MD · TXT · CSV
Chunk
Heading-aware, sentence overlap
Embed
Gemini · 3072-dim vectors
Retrieve
Dense + BM25 · RRF fusion
Ground
Numbered context, forced citations
Score
Confidence from evidence
Streaming
Tokens arrive as they are generated; the retrieval trace lands before the first word.
No hallucination budget
The model answers only from numbered context and is told to refuse when it cannot.
Free retrieval
Semantic search costs nothing — you only pay when a model writes.
Why not just use Stripe
Card rails assume a human who can wait days for settlement and accept a fixed fee larger than the purchase. Neither holds when a research agent needs one answer from an API it discovered thirty seconds ago.
| API key + invoice | Card per call | x402 on Stellar | |
|---|---|---|---|
| Signup required | Yes | Yes | No |
| Cost per call | Amortised | $0.30 + 2.9% | ~$0.0000011 |
| Settlement | Monthly invoice | 2–7 days | ~5 seconds |
| Works for an agent | No | No | Yes |
The knowledge base ships seeded with primary material on Stellar consensus, the x402 protocol, retrieval architecture, and agent economics. Or drop in your own PDF and query that instead.
Press ⌘K anywhere to search the knowledge base
Built as an open, inspectable reference for the agentic economy · see the live numbers