rail402-cli

rail402-cli is a skill for Claude Code, Codex from tolgayayci/rail402. It costs 72 tokens per session (987 once invoked), scanned A, original, Apache-2.0.

A command-line tool for finding and paying for x402 APIs on the Stellar test network using USDC. x402 is a payment method that lets an API request include payment, while Stellar is a blockchain network.

In plain words
What is it for?
Finding APIs in the x402 Bazaar, paying for calls within a spending cap, funding a test wallet, and checking settlements on the explorer.
Why use it?
It lets an agent access paid APIs from the shell while enforcing a maximum payment amount and returning machine-readable results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Finding APIs in the x402 Bazaar, paying for calls within a spending cap, funding a test wallet, and checking settlements on the explorer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tolgayayci/rail402/skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tolgayayci/rail402 --skill skill
Clone the repo
git clone --depth 1 https://github.com/tolgayayci/rail402

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rail402-cli

README.md
[![agentmods](https://agentmods.dev/badge/skills/tolgayayci/rail402/skill/github.svg)](https://agentmods.dev/skills/tolgayayci/rail402/skill)
Your own site
<a href="https://agentmods.dev/skills/tolgayayci/rail402/skill"><img src="https://agentmods.dev/badge/skills/tolgayayci/rail402/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rail402-cli

Your own site · 80×15
<a href="https://agentmods.dev/skills/tolgayayci/rail402/skill"><img src="https://agentmods.dev/badge/skills/tolgayayci/rail402/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 987 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00072 $0.00987
Opus 5 $0.00036 $0.00494
Sonnet 5 $0.00014 $0.00197
Haiku 4.5 $0.00007 $0.00099

Measured 9d ago against content hash c14d11c312f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

rail402-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

apps/cli/skill/SKILL.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rail402 — command-line x402 payments on Stellar

rail402 lets you (or an agent you drive) discover paid APIs, pay for them under a spend cap, and verify the settlement on Stellar, entirely from the shell. It speaks x402 v2, sponsors fees (the buyer needs no XLM), and defaults to Rail402's hosted testnet infrastructure — all free, no API keys.

Install

npm install -g @rail402.dev/cli    # or prefix any command with: npx @rail402.dev/cli

The rules that keep spending safe

  1. Every payment needs an explicit --max cap, a decimal in the asset's units (--max 0.10 = 0.10 USDC). The CLI refuses to spend more, and never pays an unbounded amount.
  2. Store the key in an env var, never interactively: export RAIL402_SECRET=S.... Agents cannot type a password.
  3. Always pass --json. Output is then one object: { "ok": true, "data": {...} } on success, or { "ok": false, "error": { "code", "reason", "retryable" } } on failure. Branch on ok and read error.code — do not parse human prose.
  4. Testnet only. Low stakes by construction.

The loop

# 1. Get a funded testnet account (only once). Save the secret it prints.
rail402 fund --json
export RAIL402_SECRET=<secret-from-step-1>
# (For real USDC, fund the address at https://faucet.circle.com — friendbot only gives XLM.)

# 2. Discover a paid API in natural language.
rail402 search "convert usdc amounts to stroops" --json

# 3. Discover the cheapest match AND pay it, capped:
rail402 buy "convert usdc amounts to stroops" --max 0.10 --json
#   → data.paid.transaction is the settlement hash; data.body is the API's response.

#    …or pay a specific URL you already have (add query params the endpoint needs):
rail402 pay "https://api.example/convert" --max 0.10 --query amount=100 --json

# 4. Verify the settlement on the explorer.
rail402 tx <transaction-hash> --json

Reading results

  • Paid successfully: data.paid is present — { amount (atomic units), asset, transaction } — and data.body is the resource's response. data.explorer is a link to the settlement.
  • Reached but not charged: data.paid is absent and data.status is the resource's HTTP status (e.g. a 400 because a required query param was missing — add it with --query k=v and retry).
  • Refused: ok is false. Common error.code values:
    • mcp_budget_exceeded — the price is above your --max; raise the cap or pick another resource.
    • mcp_budget_required — you forgot --max.
    • config_no_signer — no RAIL402_SECRET set; run rail402 fund first.
    • mcp_resource_not_found — nothing in the Bazaar matched within budget.
    • mcp_upstream_error — a network/HTTP problem (retryable: true).

Read the full file on GitHub · 78 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 78 lines · 72 tokens per session scan A c14d11c312f4

Subscribe to this mod's changes

rail402-cli is a skill published in the GitHub repository tolgayayci/rail402 (0 stars, last pushed 6d ago), licensed Apache-2.0. It adds 72 tokens to every session and 987 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

nirium-agentic-payments

Scaffold and run an x402 paid API server on Stellar with open-source client libraries: charge AI agents per API call with x402Serve(), a function from the nirium SDK that runs entirely on your own server, scaffold that server with nirium-cli in one command, and separately read live protocol data through the nirium-mcp…

nirium-protocol/nirium-sdk · 128 tokens

x402-stellar-payments

Use when asked to "pay for" a URL, add a "paid endpoint", handle HTTP 402, or work with x402 payments on Stellar.

CodeStrux/x402-stellar-kit · 38 tokens

stellar-forge

Eval-driven coding harness for building production Stellar dApps. Routes tasks to 6 specialist agents, verifies output with structured evals, steers on failure, e2e-tests with Stellar Agentic Kit hooks, and knowledge-graphs every project. Use when building any Stellar app — tokens, DeFi, NFTs, payment APIs, or full…

rylsherdamz-rgb/stellar-forge · 82 tokens

agentic-payments

Agentic and machine-to-machine payments on Stellar. Covers x402 (HTTP 402 paid APIs) and MPP (Machine Payments Protocol) Charge/Channel modes.

rylsherdamz-rgb/stellar-forge · 38 tokens

starknet-mini-pay

Simple P2P payments on Starknet. Generate QR codes, payment links, invoices, and transfer ETH/STRK/USDC. Like Lightning, but native.

keep-starknet-strange/starknet-agentic · 40 tokens

starknet-tongo

Confidential ERC20 payments on Starknet using Tongo protocol. Fund, transfer, withdraw, and rollover encrypted token balances with zero-knowledge proofs. Use when the user needs privacy-preserving transactions, confidential payments, encrypted balances, or auditable private transfers on Starknet.

keep-starknet-strange/starknet-agentic · 61 tokens