This is the full path from “I just heard about Relayer” to “my agent is running, spending USDC, and tracked by 3-layer budget enforcement”. Roughly 30 minutes if you have your wallet funded.Documentation Index
Fetch the complete documentation index at: https://docs.relayer.fi/llms.txt
Use this file to discover all available pages before exploring further.
1. Create a workspace
Sign up at the Relayer dashboard with your email. You’ll receive a verification link; once confirmed, you land in your workspace — the multi-tenant container that holds your wallets, API keys, team, and agents.A workspace is free to create. Billing kicks in only when you activate a Kit module that has paid usage (Payouts) or when your agents start spending.
2. Register a passkey
The dashboard walks you through registering a passkey on your device (Face ID, Touch ID, Windows Hello, or a hardware security key). The passkey is the only thing that can authorize signing operations on your wallets — neither Relayer nor your password can.You can register more than one passkey per workspace (recommended: one per device + one hardware key for recovery).
3. Activate the Agent Kit module
In Dashboard → Modules, toggle Agent Kit on. This:
- Enables the
/v1/agents/*endpoints for your workspace - Provisions an internal queue for budget enforcement
- Activates the
agentpermission scope on your API keys
4. Generate an API key
In Dashboard → API Keys, click Create key. Pick scope
integrator (read+write) or integrator:write (write only) and give it a name (e.g. “agent-provisioning-prod”).The key is shown once — rk_client_key_v1_.... Save it in your password manager or secret store; you can’t retrieve it later, only revoke and re-issue.5. Create your operator wallet (if you don't have one)
The agent’s USDC funds come from your operator wallet — a self-custodial wallet your workspace owns. Create it from the dashboard’s Wallets tab (wallet creation is passkey-stamped, so it runs in the dashboard today).Fund it with USDC on Solana via:
- Direct transfer from your existing wallet (Phantom, Solflare, etc.)
- On-ramp from fiat via
POST /v1/payout/onramp/deposit-accounts(Payout Kit) - A test airdrop (sandbox only)
6. Provision your first agent
Go to the dashboard → Agents → New agent. Provisioning is a 3-round passkey flow (the dashboard runs it end-to-end):
- The dashboard prepares an unsigned user-create activity, you stamp it with your passkey
- The dashboard submits the stamped activity, prepares a second activity for the agent’s policies, you stamp again
- The dashboard submits the policies and shows you the
agentSecret
- A unique
agentId(UUID) - Its own Solana USDC wallet (separate from your operator wallet)
- An HMAC secret for SDK runtime auth
7. Configure the agent's budget
From the dashboard’s agent settings, define the spend limits (the dashboard runs a passkey-stamped Three layers enforced independently and atomically server-side:
Transactions above
POST /v1/agents/{id}/budget under the hood):| Layer | What it caps | Failure mode |
|---|---|---|
| infra | API calls (cheap, frequent) | Fail-open on payments-only check |
| tokens | LLM token spend (Anthropic / OpenAI / Google) | Fail-open on payments-only check |
| payments | On-chain USDC transfers and x402 payments | Always blocks; never bypassable |
approvalThresholdUSDC require a CFO/operator to stamp approval with their passkey (delivered via the dashboard’s Approvals queue).8. Fund the agent wallet
From the dashboard’s agent detail view, move USDC from your operator wallet to the agent wallet. The dashboard runs a 2-round passkey flow under the hood: it prepares the transfer activity, you stamp with your passkey, it broadcasts to Solana.Once funded, the agent can spend up to its
payments budget.9. Install the SDK
In the project where your agent runs:Requirements:
- Node.js ≥ 22.13.0 —
fetch,AbortSignal.timeout,node:cryptoHMAC - ESM only — no CJS shim
- TypeScript ≥ 5.0 if you want type definitions
10. Configure environment variables
Three env vars are required:Drop them in
.env
.env, your platform’s secret store, or your runtime config. Never log RELAYER_AGENT_SECRET — it’s the only thing that can sign API calls as this agent.11. Initialize the SDK
Minimal init in your agent runtime:That’s it. The constructor:
src/sdk.ts
- Validates the 3 required fields
- Starts the kill-switch poller (every 30s)
- Starts the event batcher (flushes every 10s or on 50 events)
- Registers
SIGTERM/beforeExithandlers for graceful shutdown
12. Make your agent spend money
The simplest paid action is calling any x402-protected HTTP endpoint:
x402fetch is the one-liner that ties everything together: payment-budget check, HMAC auth, x402 detection, payment, and retry — all behind a normal fetch API.If you’re building with Mastra:src/agent.ts
What you’ve built
By the end of step 12, you have:- A workspace in the Relayer dashboard with at least one passkey
- An API key to call
/v1/*from your backend - An operator wallet with USDC, owned by your workspace passkey
- An agent with its own wallet, HMAC secret, and 3-layer budget caps
- A deployed agent runtime that uses the SDK to pay for resources, with budget enforcement that cannot be bypassed — not even by a misbehaving LLM in your agent code
Where to go next
SDK Reference
Exhaustive reference for every class, method, event type, and error in
@relayerfi/agent-sdk.Agent Kit Flow Guide
The same flow as above but focused on the API endpoints — useful when you’re not using the dashboard.
Examples
Reference implementations: BI Agent (daily reports), OTC Agent (operator workflow), Outbound Agent (B2B sales).