# Try Radius

*Create a wallet, send SBC, and pay for an API request*

Everything on this page runs on Radius Testnet with test funds. Each step calls the same `radius-sdk` functions you use in your own code, and links every transaction to the testnet explorer.

## 1. Create and fund a wallet

Create a wallet, then click **Get testnet SBC**. The faucet sends 0.5 SBC, the payment asset, and a small amount of RUSD, the native fee asset.

Create and fund a testnet wallet with radius-sdk:

```javascript
import { createRadiusFetch } from 'radius-sdk/client';
import { generatePrivateKey } from 'viem/accounts';

const payFetch = createRadiusFetch({ network: 'testnet', signer: generatePrivateKey(), maxPerRequest: '0.01 SBC' });
console.log('wallet', payFetch.address);
console.log(await payFetch.fund()); // 0.5 SBC and 0.001 RUSD from the testnet faucet
console.log(await payFetch.balances());
```

The private key is generated in your browser and stays in its local storage. The other examples in these docs use the same wallet. In your own code, `createRadiusFetch` takes the key as `signer`, and `fund()` calls the [testnet faucet](/build/wallet.md).

## 2. Send SBC

Send SBC to any address. The default recipient is the testnet faucet, so the test funds go back to it.

Send SBC from a funded testnet wallet with radius-sdk:

```javascript
import { createRadiusFetch } from 'radius-sdk/client';

const payFetch = createRadiusFetch({ network: 'testnet', signer: process.env.RADIUS_PRIVATE_KEY, maxPerRequest: '0.01 SBC' });
const tx = await payFetch.send('0xRecipientAddress', '0.01 SBC'); // waits for the receipt
console.log(tx.status, tx.explorerUrl);
```

The time includes signing, sending, and waiting for the transaction receipt: Radius confirms transactions with sub-second finality. The fee is a fixed gas price paid in RUSD. A wallet that holds only SBC can still send, because the [Turnstile](/reference/fees.md#turnstile) converts SBC to RUSD when a transaction needs gas.

## 3. Pay for an API request

This page's API sells an IP reputation lookup for 0.001 SBC per request, and a full report for 0.05 SBC. Payments go back to the testnet faucet. It is built with `radiusPayments` from `radius-sdk/hono`, like the seller in [accept payments](/build/accept-payments.md).

1. Click **Request without paying**. The API answers `402 Payment Required` and describes the price in the `PAYMENT-REQUIRED` header.
2. Click **Pay and request**. The client reads the offer, checks it against your limit, signs a payment authorization, and sends the request again. The API settles the payment and returns the data in the same response.
3. Choose the report endpoint and pay again. It costs more than your 0.01 SBC limit, so the client refuses before it signs anything.

Pay for an x402 endpoint within a per-request limit with radius-sdk:

```javascript
import { createRadiusFetch, getPaymentReceipt } from 'radius-sdk/client';

const payFetch = createRadiusFetch({ network: 'testnet', signer: process.env.RADIUS_PRIVATE_KEY, maxPerRequest: '0.01 SBC' });
const res = await payFetch('https://docs.radiustech.xyz/api/try/lookup?ip=9.9.9.9'); // 0.001 SBC
console.log(res.status, await res.json(), getPaymentReceipt(res, payFetch.network));
// https://docs.radiustech.xyz/api/try/report costs 0.05 SBC: this client refuses it (price_above_limit).
```

The wallet pays without an approval transaction. The Radius facilitator sponsors the one-time Permit2 approval for SBC, so a new wallet needs only SBC to pay. See [x402 payments](/build/x402.md) for the full request lifecycle.

## Build it yourself

* [Accept payments](/build/accept-payments.md): charge for API routes in a Hono app or Cloudflare Worker.
* [Make payments](/build/make-payments.md): pay x402 endpoints from an app or agent, within a limit.
* [Sell a data lookup](/build/tutorials/sell-data.md) and [buy a data lookup](/build/tutorials/buy-data.md): build both sides of this page's API on testnet.
* [radius-sdk reference](/reference/radius-sdk.md): every option and function used on this page.
