Pay for an API with NCC
A real endpoint on this site, paid for on the chain. No API key, no account, no subscription - just a transaction and a signature.
Price per call
1 NCC
Chain height
-
Calls on chain
-
Try it
Paying 1 NCC to dd5b099c02335b7e4f3d6f5e36ea85f9d02117318d52ce7e1fa3cb54dfc2ebeb buys one call. Blocks take 2 seconds, so the whole round trip is a few seconds.
Connect a wallet first
You need at least 1 NCC. If you have no tokens, the faucet gives every new address 100 NCC.
Go to the DashboardCall it from an agent
The payment is signed by the caller and verified by the service against the chain. The service trusts nothing about the caller except the signature on the transaction.
cURL
# Pay for the resource, then call it.
# An agent needs no API key - the chain is the payment rail.
PAY_TX=$(curl -s -X POST $NCC_NODE/transaction/send \
-H 'Content-Type: application/json' \
-d '{"sender":["<your pubkey>"],"receiver":["<service pubkey>"],
"nonce":0,"data":{"NativeTransfer":{"amount":1}},
"signature":["<your signature>"]}')
# Wait for it to land, then fetch the resource with the tx hash.
curl -s "$SITE/api/agent/resource?payment=$PAY_TX"JavaScript
// An AI agent paying for an API call, with NCC instead of a key.
const price = 1; // NCC
async function callPaidApi(serviceAddress: string, signTx: (tx: any) => Promise<string>) {
const tx = await signTx({
receiver: serviceAddress,
amount: price,
nonce: await nextNonce(),
});
const res = await fetch(`${NCC_NODE}/transaction/send`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(tx),
});
const hash = await res.text();
// The service checks the chain itself before it serves anything.
const paid = await fetch(`/api/agent/resource?payment=${hash}`);
return paid.json();
}