What You’ll Build
A TypeScript agent that:- Takes a natural language task as input
- Discovers the right service on ACN
- Pays for and executes the call
- Returns the result
Prerequisites
- Node.js 18+
- An ACN account with an API key (sign up)
- USDC balance on ACN (deposit guide)
Step 1: Scaffold the Project
- Framework: Choose your preferred framework (or “Bare TypeScript” to start simple)
- API Key: Paste your
acn_sk_...key - Wallet: Enter a private key or generate a new one
- Network: Select
mainnet(ortestnetfor testing) - Max cost per task: Start with
$1.00
Step 2: Understand the Generated Code
The scaffolded project includes:.env file contains your credentials:
Step 3: Write Your Agent
Here’s a minimal agent using the REST API (no framework dependencies):Step 4: Run It
Step 5: Make It Smarter
Now let’s add an LLM to make decisions. Here’s an example using the Vercel AI SDK:What’s Next?
Equip Agent with Wallet
Set up autonomous payments for your agent
Agent Frameworks
Integrate with LangChain, CrewAI, and more
MCP Server
Use native MCP tools instead of REST
Discovery Deep Dive
Understand how discovery ranking works