Skip to content
AgenticRAG
  • Discover
  • Marketplace
  • Console
  • Atlas
  • Protocol
  • Analytics
—credits
Agentic RAG Paywall

A knowledge API priced per answer. Agents discover the price from a 402, settle on Stellar, and get a cited response.

Live on Stellar testnet

Product

  • Console
  • Knowledge library
  • Analytics

Protocol

  • x402 walkthrough
  • Integration guide
  • OpenAPI reference

Stack

  • Next.js 16 · React 19
  • FastAPI · Python 3.12
  • Gemini · ChromaDB
  • Stellar SDK · x402

© 2026 Agentic RAG Paywall · MIT licensed

Source
Agent Discovery Network

AI agents that find, judge and pay for services on their own

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.

Explore it yourself

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

Payment is part of the protocol

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.

  1. 1

    Call

    The agent requests an answer with no credential.

  2. 2

    402

    The server replies with destination, amount, and memo.

  3. 3

    Settle

    The agent pays on Stellar. Ledger closes in ~5s.

  4. 4

    Redeem

    The hash is verified on-chain and buys query credits.

  5. 5

    Answer

    The retry streams back, cited, one credit spent.

Run it live
the wire
$ 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

Engineering the demo does not hide

Each of these is inspectable in the running product — not a claim on a slide.

Discovery, not configuration

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.

Capability sets the ceiling

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.

Priced in the response

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.

Credits, not sessions

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.

Hybrid retrieval

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.

Citations that resolve

Every claim carries a marker that opens the exact passage: document, section breadcrumb, page number, and similarity score.

Confidence you can audit

Scored from retrieval similarity and citation coverage — never the model's own self-assessment, which is poorly calibrated. Expand it to see every input.

Failure is free

If generation fails or the connection drops mid-stream, the credit is refunded automatically. Retrying is always safe.

Retrieval pipeline

From a dropped file to a cited claim

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.

01

Parse

PDF · DOCX · MD · TXT · CSV

02

Chunk

Heading-aware, sentence overlap

03

Embed

Gemini · 3072-dim vectors

04

Retrieve

Dense + BM25 · RRF fusion

05

Ground

Numbered context, forced citations

06

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

Because the buyer is not a person

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 + invoiceCard per callx402 on Stellar
Signup requiredYesYesNo
Cost per callAmortised$0.30 + 2.9%~$0.0000011
SettlementMonthly invoice2–7 days~5 seconds
Works for an agentNoNoYes

Ask it something right now

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.

Open the consoleUpload a document

Press ⌘K anywhere to search the knowledge base

Built as an open, inspectable reference for the agentic economy · see the live numbers