Skip to content
LogoLogo

Build with LLMs

Use LLM workflows to integrate with Radius

View as Markdown

Use this page to run faster, safer Radius development with LLM-assisted workflows. The goal is simple: give the model Radius-specific context, use the right execution tool for the job, and verify outputs before shipping.

This page is about a development assistant helping you build. For an agent that pays for resources itself, see set up an agent to pay.

Why this works for Radius

Radius docs and skills are available in Markdown-friendly formats, which makes them easy for LLM tools to parse and reason about.

  • Append .md to docs URLs when you need plain text context
  • Use /llms.txt for a compact index of key docs
  • Use /llms-full.txt for broader corpus-style ingestion
  • Use /skills/radius-dev.md, /skills/dripping-faucet.md, /skills/x402.md, and /skills/sell-api.md when an agent needs durable operating instructions

These formats reduce UI noise and preserve heading structure for better model responses.

LayerUse thisWhy
Radius contextDocs markdown + Radius skillsKeeps the model grounded in current Radius rules
x402 payments in coderadius-sdkradiusPayments to charge for routes, createRadiusFetch to pay
Local wallet and executionradius-cliHandles agent wallets, signing, balances, sends, reads, and x402 CLI requests
Other chain access in codeviemContract calls, RPC reads, and transactions outside x402
React wallet UXwagmi + viemStandard hooks for browser wallets
Smart contractsFoundryContract builds, tests, scripts, and deployments

Treat skills as guidance, and pick the tool by where the payment happens:

  • x402 in TypeScript: use radius-sdk. Ask the assistant for radiusPayments (Hono, including Cloudflare Workers) to charge for routes, and createRadiusFetch to pay. See Accept payments and Make payments.
  • In a terminal or agent shell: use radius-cli, for wallets and for paying x402 endpoints.
  • Everything else on chain: use viem.

Do not ask an assistant to hand-build x402 headers, signatures, or Permit2 approvals; the SDK and CLI already do this. Build against the protocol directly only when neither fits, for example a server framework other than Hono or another language; see x402 payments.

Setup checklist

1) Install Radius skills for guidance

The canonical source for current Radius skills is radiustechsystems/tools. Use it for new installs and updates. The older skills and radius-dev-skill repository names are retired sources.

Claude Code

/plugin marketplace add radiustechsystems/tools
/plugin install radius@tools

The radius plugin includes the radius-dev, dripping-faucet, x402 (paying and the protocol), and sell-api (charging for an API or for articles and pages) skills.

Update it with claude plugin update radius@tools. Plugin 0.2.0 changes the install identity from radius-dev@radius-cli to radius@tools. For an existing user-scoped installation, migrate once after the renamed plugin is published:

claude plugin uninstall radius-dev@radius-cli --scope user
claude plugin marketplace remove radius-cli --scope user
claude plugin marketplace add radiustechsystems/tools --scope user
claude plugin install radius@tools --scope user

For project or local installations, use the corresponding scope instead. Individual skill names remain the same; plugin commands use the radius prefix, for example /radius:sell-api.

npx skills

npx skills add radiustechsystems/tools

For Codex, run this from your application directory:

npx skills add radiustechsystems/tools --agent codex \
  --skill radius-dev dripping-faucet x402 sell-api --copy
npx skills list --agent codex

This installs all four skill directories, including references and scripts, under your project's .agents/skills. Start a new Codex conversation after installation so it can discover them.

Public flat files

Agents can also read the generated skill references directly:

  • https://docs.radiustech.xyz/skills/radius-dev.md
  • https://docs.radiustech.xyz/skills/dripping-faucet.md
  • https://docs.radiustech.xyz/skills/x402.md
  • https://docs.radiustech.xyz/skills/sell-api.md

These flat files combine the instructions and Markdown references. Install the full skill directories when the workflow needs supporting scripts or templates.

2) Install and verify radius-cli

npx radius-cli --help

Or install globally:

npm install -g radius-cli
command -v radius-cli
radius-cli --help

Use radius-cli version 0.4.0 or later; earlier versions name the payment command wallet x402. Verify that your installed binary exposes the payment command:

radius-cli wallet pay --help

3) Scope the agent wallet

Use a project-scoped Radius home so test wallets do not leak across demos, repos, or agent runs:

export RADIUS_HOME=.radius
export RADIUS_NETWORK=testnet
 
radius-cli wallet address
radius-cli wallet balance --json

1) Prime the model with project constraints

Start every session with the rules your integration must follow.

Include at minimum:

  • Chain ID: 72344
  • RPC URL: https://rpc.testnet.radiustech.xyz
  • Native fee token: RUSD
  • Stablecoin token: SBC
  • Tooling standards: radius-sdk for x402 payments in code, radius-cli for local wallet execution, viem for other chain access, Foundry for contracts, pnpm for package workflows

Also include links or excerpts from:

  • /reference/network
  • /reference/radius-sdk
  • /reference/radius-cli
  • /reference/fees
  • /reference/json-rpc/methods
  • /reference/ethereum-compatibility
  • /build/tooling

2) Ask for one scoped task at a time

Avoid broad prompts like “build my app.” Use narrow prompts with explicit output shape.

Good prompt pattern:

  • Task objective
  • Input context
  • Expected output format
  • Non-negotiable constraints

Example scope:

  • “Create a defineChain config using Radius testnet values (chain ID 72344, RPC endpoint {TESTNET_RPC_URL}).”

3) Require deterministic outputs

Ask the model to return:

  • Exact file edits
  • Minimal diffs
  • Copy-paste-ready commands
  • Short rationale tied to Radius behavior differences

This reduces rework and makes review faster.

4) Validate every generated change

Before merging:

  1. Run your type checks and tests.
  2. Verify app code uses Radius-compatible fee behavior.
  3. Confirm no Ethereum assumptions leak into block behavior logic.
  4. Confirm x402 code uses radius-sdk (radiusPayments, createRadiusFetch) and terminal or agent-shell payments use radius-cli, with no hand-built payment headers.

Fund wallets with the dripping-faucet skill

Use the dripping-faucet skill to fund testnet wallets inside an agentic workflow. The skill should use radius-cli for the local wallet address, challenge signing, and balance verification.

Claude Code prompt:

claude "Read docs.radiustech.xyz/skills/dripping-faucet.md and fund a local testnet wallet. Use RADIUS_HOME=.radius, RADIUS_NETWORK=testnet, and radius-cli for wallet address, signing, and balance checks."

The skill triggers on prompts like "fund my wallet", "get testnet tokens", "drip SBC", or "use the faucet".

In code, createRadiusFetch(...).fund() from radius-sdk/client requests the same testnet drip for its signer; see wallet helpers. For the full API reference and programmatic examples, see Fund a wallet.

Pay for endpoints with radius-cli

For an agent or terminal session, use radius-cli wallet pay instead of hand-building payment headers.

RADIUS_HOME=.radius RADIUS_NETWORK=testnet \
  radius-cli wallet pay get https://example.com/protected \
  --threshold 0.001 \
  --json \
  -y

--threshold is in display units such as SBC, not raw 6-decimal integer units. Use it for non-interactive agent runs so the command refuses unexpectedly expensive requests.

Prompt templates you can reuse

Prepare the agent

“Use Radius Testnet. Read /reference/network.md, /reference/radius-sdk.md, /reference/radius-cli.md, /build/tooling.md, and /skills/radius-dev.md. Use radius-sdk for x402 payments in code, radius-cli for local wallet operations, and viem for other chain access. Return a short plan before editing.”

Generate x402 code

“Read /build/accept-payments.md and /reference/radius-sdk.md. Add radiusPayments from radius-sdk/hono to this Hono app so GET /api/lookup costs 0.001 SBC on testnet, paid to the address in PAY_TO. Do not hand-build x402 headers. Return the changed files and a curl command that shows the 402.”

Generate integration code

“Using viem, generate a Radius testnet chain config with id: 72344 and RPC https://rpc.testnet.radiustech.xyz. No fee overrides are needed because viem estimates fees correctly with the Radius chain definition. Return only the final TypeScript file content.”

Audit an implementation

“Review this transaction flow for Radius compatibility. Check fee configuration, JSON-RPC method assumptions, block-related logic, SBC decimal handling, and whether local wallet operations should use radius-cli. Return: (1) critical issues, (2) exact code changes, (3) a short validation checklist.”

Create and fund a testnet wallet

“Read https://docs.radiustech.xyz/skills/dripping-faucet.md. Create or use a project-scoped testnet wallet with RADIUS_HOME=.radius RADIUS_NETWORK=testnet radius-cli wallet address, fund it from the testnet faucet, and verify the SBC balance with radius-cli wallet balance --json. Do not print private keys.”

Pay for an endpoint

“Use radius-cli wallet pay get <URL> with RADIUS_HOME=.radius, RADIUS_NETWORK=testnet, --threshold 0.001, --json, and -y. Do not manually construct x402 headers unless radius-cli is unavailable.”

Create a migration plan

“Migrate this ethers.js snippet to viem for Radius. Keep behavior identical. Return: (1) migration diff, (2) risks, (3) test plan.”

Common mistakes to avoid

  • Treating Radius like Ethereum for block semantics
  • Relying on external automatic fee defaults
  • Using Foundry or ad hoc scripts as the default agent wallet surface
  • Reusing one global wallet across unrelated agent demos
  • Passing raw private keys as CLI arguments
  • Mixing toolchains without a clear reason
  • Asking for large multi-feature output in one prompt
  • Accepting generated code without runtime validation

Practical tips

  • Keep a reusable “Radius context block” in your editor snippets.
  • Ask the model to cite the exact page section used for each decision.
  • Prefer iterative prompt loops: plan → patch → verify.
  • Store approved prompts with your project docs so the team reuses proven patterns.
  • Convert repeatable prompts into composable skills as they stabilize.
  • Revisit your installed skills periodically so your agent setup stays current as new skills become available.
  • Use --json for CLI output that another agent or script needs to parse.