k402
Testnet research software — unaudited, not for real value. Get set up on testnet-10 →
reading the registry…

Agents are paying agents on this rail. Watch one, below.

Every API a vending machine. Every agent a customer with a wallet.

An agent asks a service for work and gets an HTTP 402 with the price inside. It pays on Kaspa L1, the payment is accepted on Kaspa in about a second, and it asks again with the proof. No account, no API key, no custodian. Every service here speaks k402, the Kaspa x402 v2 standardkaspa-x402.org (opens kaspa-x402.org). Humans run the services and supervise the agents; the agents do the buying.

Services here settle in KAS, most on kaspa:mainnet; Base-native services are paid in KAS too, the router settling the Base leg. Services priced in agent money, kUSD, live on the Kaspa Agent Market on kaspa:testnet-10 today.

Autonomous software can't open a bank account, pass KYC, or hold a card. kUSD gives an agent stable-denominated money whose rules are covenant-enforced and whose state it can verify against a node; k402 gives it a way to pay per call with no account or API key; the market gives it discovery, settlement-proven reputation, and operator-set spend limits. Humans supervise; agents transact.

Fig. 1 — one paid call, as it happened on testnet-10t = 0.00 s
  1. 0.00 sPOST /summarize (unpaid)
    an agent asks summarize.kaspa-402.org for work, with no account and no key
  2. 0.35 s402 Payment Required
    the price is in the response: 0.05 kUSD to the provider's key
  3. 7.36 spayment broadcast
    the agent builds a 0.05 kUSD covenant box and sends it · tx d01fc924…6610c8
  4. 15.14 s200 POST again, with the proof → OK
    the provider verified the box on a node and did the work · 284 bytes back
replay at 4× · recorded 2026-11-18 · the transaction
…
services listed
…
passed the 402 probe
one unpaid request each
…
kUSD settlements verified
…
last settlement
Fig. 2 — one unpaid request, live, to a listed service

One real unpaid request to a listed service. Nothing is paid by this page.

$ curl -si "<a listed service>"
# → 402 Payment Required, a payment-required header, then an agent pays and retries. Press the button to see it live.

To run the paid leg yourself: get set up on testnet-10.

I'm building an agent

Five steps from nothing to a paid call: funds, read the 402, pay in KAS or kUSD, verify on a node, then sell.

I'm selling an API

Put a 402 in front of your endpoint, validate it here (one unpaid probe, nothing charged), then list it for agents to find.

§ 1
The whole protocol, in three moves.
1 · the agent calls

It requests a resource. The service answers 402 with a PAYMENT-REQUIRED header: every way to pay, with the amount and the address.

2 · the agent pays

In KAS (@kaspa-x402/client) or in kUSD (k402), on Kaspa L1, in one transaction, and retries with the proof in a PAYMENT-SIGNATURE header.

3 · the chain settles

Value moved on Kaspa L1; the agent gets the result and can verify the settlement against a node. No middleman held the funds.

§ 2
Three layers, one product. This site is the rails.
§ 3
The directory. Each listing answered a live, unpaid 402 probe before it appeared; an agent can repeat that check itself.

Services agents pay

Selling an API? Put a 402 in front of it and list it here. One unpaid probe is the only gate; kUSD-priced services list on the Kaspa Agent Market.

List your service
§ 4
Agents start here. From nothing to a paid call, then to selling. The machine copy of this page is /llms.txt.

Agents start here

This site is machine-readable — point your agent at /llms.txt (and /llms.json) and it gets the same story, names and steps as a human reader.

curl -s https://www.kaspa-402.org/llms.txt | head -40
  1. 1 · get funds

    A Kaspa key is the only account. On testnet-10, TKAS comes from the faucet; kUSD is bought from the kUSD PSM in the browser wallet or with the k402 client.

    # testnet-10 coins for a kaspatest: address (make one in /kusd/app or with your agent's wallet)
    open https://faucet-tn10.kaspanet.io/
  2. 2 · read the 402

    Call the resource unpaid. The PAYMENT-REQUIRED header is base64 JSON: accepts[] lists each way to pay — scheme, network, amount, payTo.

    curl -si "https://kaspa-402-ask.kaspadev.workers.dev/exact" | grep -i -E "^HTTP|^payment-required" | cut -c1-80
  3. 3 · pay, in KAS or kUSD

    KAS: @kaspa-x402/client (exact, batch-settlement). kUSD: the k402 Python client (pip install k402) picks the best kUSD-priced provider and pays it inside the bounds its operator set.

    npm i kx402 && npx kx402 fetch-sdk      # KAS, Node
    pip install k402                            # kUSD, Python
  4. 4 · verify on a node

    A KAS payment is a transaction to payTo. A kUSD payment is a covenant box of exactly the quoted cents at the offer's key, checkable against any Kaspa node.

    # KAS: the txid the client returned, on the network it paid on
    curl -s "https://api-tn10.kaspa.org/transactions/<txid>" | head -c 400
    # kUSD: the registry's node-verified settlements
    curl -s "https://market.kaspa-402.org/registry/activity?limit=5"
  5. 5 · sell

    Answer 402 yourself: @kaspa-x402/server for KAS, k402 (K402(kusd=…)) for kUSD. Submit the KAS endpoint above; list the kUSD one on the Kaspa Agent Market.

    npm i @kaspa-x402/server                 # answer 402 for KAS, then list it at /list
    pip install k402                            # K402(kusd=...) for kUSD, then list on the market
§ 5
How covenants back this.

How covenants back this

today · kUSD settlement

kUSD is not an IOU on an account: each unit is state inside a Kaspa L1 covenant, minted against KAS in vaults, redeemable at a permissionless reserve, priced by a five-operator oracle — rules the chain enforces, with no bridge, no L2 and no trusted issuer. A kUSD payment is therefore a covenant output a node can check: exact cents, the right family, the offer's own key. That is what makes the market's reputation settlement-verified. The kUSD code.

roadmap · KCC-0402 payment channels

For streaming and sub-cent micro-settlement, k402 defines covenant payment channels: an agent locks KAS in an L1 covenant and pays per call with signed vouchers; the provider can claim at most what was signed, and the agent reclaims the rest. The channel covenant and its tooling are in the k402 code.

Today all five kUSD oracle operator keys are held by the deployer; independent operators are a pre-mainnet gate.

§ 6
Attested data: answers from our own mainnet node, signed by a registered attester, anchored on chain every hour.

Attested data, from a node that signs its answers

Two paid endpoints run next to our mainnet node. Each answer is a signed envelope that states exactly what the node's index holds, the hash of every served answer is merkle-anchored in a mainnet transaction once an hour, and a node-less agent can verify both offline. Each costs 1 kUSD cent per call (KAS accepted); both are listed on the Kaspa Agent Market.

attest.receipt

Settlement receipt

For a Kaspa mainnet txid: accepted, seen or unknown, the accepting block, blue score, confirmations and when our node first saw it. Unknown always comes with the coverage window it was judged against.

attest.fees

Fee and inclusion forecast

The node's fee buckets plus what only a node operator watching its mempool can measure: first-seen to acceptance delays by feerate over the last hour, on a fixed grid with a 50-sample floor.

Verify any answer: verify.py checks the signature offline; with the proof from attest.kaspa-402.org/audit/<hour> and any Kaspa node it checks the hourly anchor on chain. Attesters, weights and disputes: /attesters.

§ 7
Pay from an agent: the same call in three languages.
# see the paywall: one unpaid request to a listed service
curl -si "https://kaspa-402-ask.kaspadev.workers.dev/exact" | head -3
# HTTP/2 402 Payment Required
# payment-required: eyJhY2NlcHRzIjpb...   (base64 JSON: accepts[] = scheme, network, amount, payTo)
# paying needs a client that signs a Kaspa transaction: see the Python and TypeScript tabs

Full example: examples/agent-quickstart.mjs on GitHub.