From install to first payment in three steps.
Railo is a TypeScript SDK over an on-chain protocol. Give an agent a wallet, express its budget as policy, and meter its spend per call - no custody code, no payment plumbing.
A wallet, a policy, a payment.
This is the complete shape of a Railo integration - create an agent with hard rules, then let it pay per call. The gate does the enforcement; you just express intent.
- Daily limit
- $50.00
- Per-call ceiling
- $0.05
- This payment
- $0.02
import { Railo } from "@railo/sdk";
const railo = new Railo({ network: "solana", apiKey: "rl_test_xxxxxxxx" });
// Give an agent a wallet with hard, on-chain spending rules
const agent = await railo.createAgent({
policy: {
dailyLimit: "50.00", // USDC
perCall: "0.05",
allow: ["service://api.search", "service://api.embed"],
},
});
// The agent pays per call - the policy gate enforces the limits on-chain
const receipt = await agent.pay({
to: "service://api.search",
amount: "0.02",
});
console.log(receipt.id, receipt.settled); // instant, auditableOne package. Zero custody code.
The SDK ships with everything to create agents, set policy, and settle payments.
npm install @railo/sdkWire an agent's wallet end to end.
Initialize the client
Point the SDK at a network and authenticate with a key. Test keys are illustrative placeholders, never real account data.
import { Railo } from "@railo/sdk";
// Test network keys are safe to commit only as illustrative placeholders.
const railo = new Railo({
network: "solana", // "solana" | "devnet"
apiKey: "rl_test_xxxxxxxx",
});Create an agent with a policy
Define the spending rules once - daily limit, per-call cap, allowlist. They're written on-chain and enforced on every payment.
const agent = await railo.createAgent({
// The owner sets the policy; the contract enforces it.
policy: {
dailyLimit: "50.00", // USDC, rolling 24h
perCall: "0.05", // hard ceiling per payment
allow: [
"service://api.search",
"service://api.embed",
],
},
});
console.log(agent.address); // 0xAgent… (the agent's on-chain wallet)Make a metered payment
The agent pays per call. The policy gate validates the rules on-chain; you get a signed, settled receipt back.
const receipt = await agent.pay({
to: "service://api.search",
amount: "0.02", // a fraction of a cent, in USDC
});
// Settled instantly, signed, and traceable to the policy that allowed it.
console.log(receipt.id); // rcpt_8fK2c…
console.log(receipt.settled); // trueRead the full reference
Method signatures, params, receipts, webhooks, and a mainnet checklist.