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.
Quickstart (1 minute)
You need nothing except Node.js 20+ to get a smart account ready to pay for services. Gas is sponsored and account creation is gasless on testnet.
CLI
npx @azeth/cli quickstart
That's it. This auto-generates a key, sponsors gas, deploys a smart account, and registers on the trust registry. Your key is saved to ~/.azeth/key for future use.
MCP (Claude Code)
npm install -g @azeth/mcp-server
claude mcp add azeth -- azeth-mcp
Or add to your MCP config manually:
{
"mcpServers": {
"azeth": {
"command": "azeth-mcp"
}
}
}
Then ask your AI agent: "Create an Azeth account." No environment variables needed — the MCP server auto-generates and persists a key on first use.
Using Your Own Key
For production or when you want control over your key:
export AZETH_PRIVATE_KEY=0x... # Your private key
export AZETH_CHAIN=baseSepolia # Optional (default: baseSepolia)
| Variable | Required | Description |
|---|---|---|
AZETH_PRIVATE_KEY | No | Owner private key. Auto-generated and saved to ~/.azeth/key if not set. |
AZETH_CHAIN | No | baseSepolia (default), ethereumSepolia, base, or ethereum. |
PIMLICO_API_KEY | Mainnet only | Bundler API key. Free tier at dashboard.pimlico.io. |
SDK Guide
For developers building with TypeScript:
Install
npm install @azeth/sdk
Create and Deploy
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',
});
const result = await kit.createAccount({
owner: kit.address,
guardrails: {
maxTxAmountUSD: parseEther('100'),
dailySpendLimitUSD: parseEther('500'),
guardianMaxTxAmountUSD: parseEther('500'),
guardianDailySpendLimitUSD: parseEther('2500'),
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: ${result.tokenId}`);
This single transaction deploys a smart account, installs all on-chain modules, registers on the trust registry, and revokes factory access. On testnet, gas is sponsored automatically.
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}`);
}
Discover Services
const services = await kit.discoverServices({
capability: 'price-feed',
limit: 5,
});
for (const svc of services) {
console.log(`${svc.name} — ${svc.capabilities.join(', ')}`);
}
Pay for a Service (x402)
const result = await kit.fetch402('https://api.example.com/eth-price', {
maxAmount: 100_000n, // max 0.10 USDC (6 decimals)
});
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, // max 0.10 USDC (6 decimals)
});
console.log(`Service: ${smart.service.name}`);
Check Reputation
const rep = await kit.getWeightedReputation(1n);
console.log(`Score: ${rep.weightedValue}, Raters: ${rep.opinionCount}`);
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