Getting Started with Azeth
Azeth is trust infrastructure for the machine economy. It gives AI agents and services non-custodial smart accounts with on-chain guardrails, a trust registry for identity and discovery, x402 payments for machine-to-machine commerce, and payment-weighted reputation that cannot be faked.
This guide walks you through creating your first Azeth agent on Base Sepolia testnet in about 15 minutes.
Prerequisites
- Node.js >= 20 (check with
node --version) - A private key for testnet (generate one below)
On testnet, gas is sponsored — you don't need your own Pimlico API key.
Step 1: Install the SDK
npm install @azeth/sdk viem
Step 2: Configure Environment
export AZETH_PRIVATE_KEY=0x$(openssl rand -hex 32)
export AZETH_CHAIN=baseSepolia
| Variable | Required | Description |
|---|---|---|
AZETH_PRIVATE_KEY | Yes | Owner private key. Controls the smart account and signs operations. |
AZETH_CHAIN | No | baseSepolia (default) or base for mainnet. |
PIMLICO_API_KEY | Mainnet only | Bundler API key. Free tier at dashboard.pimlico.io. |
Step 3: Create Your First Agent
import { AzethKit } from '@azeth/sdk';
import { parseEther } from 'viem';
const kit = await AzethKit.create({
privateKey: process.env.AZETH_PRIVATE_KEY as `0x${string}`,
chain: 'baseSepolia',
});
console.log(`EOA address: ${kit.address}`);
Fund the EOA with testnet ETH, then deploy:
const result = await kit.createAccount({
owner: kit.address,
guardrails: {
maxTxAmountUSD: parseEther('100'),
dailySpendLimitUSD: parseEther('500'),
guardianMaxTxAmountUSD: parseEther('1000'),
guardianDailySpendLimitUSD: parseEther('5000'),
guardian: kit.address,
emergencyWithdrawTo: kit.address,
},
registry: {
name: 'My First Agent',
entityType: 'agent',
description: 'A demo agent learning to use Azeth',
capabilities: ['demo', 'learning'],
},
});
console.log(`Smart account: ${result.account}`);
console.log(`Registry token ID: ${result.tokenId}`);
This single transaction deploys a smart account, installs all on-chain modules, registers on the trust registry, and revokes factory access.
Step 4: Check Balances
const balances = await kit.getAllBalances();
console.log(`Total portfolio: $${balances.grandTotalUSD}`);
for (const account of balances.accounts) {
console.log(` ${account.label}: $${account.totalUSD}`);
}
Step 5: Discover Services
const services = await kit.discoverServices({
capability: 'price-feed',
limit: 5,
});
for (const svc of services) {
console.log(`${svc.name} — ${svc.capabilities.join(', ')}`);
}
Step 6: Pay for a Service (x402)
const result = await kit.fetch402('https://api.example.com/eth-price', {
maxAmount: 100_000n,
});
const data = await result.response.json();
console.log(data);
Or use smartFetch402 to auto-discover, pay, and rate — all in one call:
const smart = await kit.smartFetch402('price-feed', {
autoFeedback: true,
maxAmount: 100_000n,
});
console.log(`Service: ${smart.service.name}`);
Step 7: Check Reputation
const rep = await kit.getWeightedReputation(1n);
console.log(`Weighted average: ${rep.weightedAverage}`);
Step 8: Clean Up
Always call destroy() when done:
const kit = await AzethKit.create({ /* config */ });
try {
// ... your agent logic
} finally {
await kit.destroy();
}
Alternative Interfaces
Prefer the CLI or MCP over the SDK? See the dedicated docs:
- CLI Reference — all the same capabilities from the command line
- MCP Tools — expose Azeth as tools for AI agents (Claude Desktop, Claude Code, etc.)
For a deeper understanding of the architecture, see Architecture.
Next Steps
- x402 Service Provider Guide — build your own x402-gated service
- SDK Reference — full TypeScript API reference
- CLI Reference — command-line interface reference
- MCP Tools — AI agent tool reference
- Smart Contracts — on-chain contract details and addresses
- Configuration — environment variables and settings