SDK reference
@agensai/sdk is the canonical TypeScript library for AGENSAI. Use it from any Node 20+ runtime.
Install
npm install @agensai/sdkSurface
| Export | Purpose |
|---|---|
createAgent | Provision a new agent (smart account + ENS subname + policies) |
getAgent | Restore an existing agent by ENS name |
listAgents | Enumerate agents under your API key |
Agent | The runtime handle: execute, batch, revoke, policies |
Conventions
- All methods are async.
- All addresses can be passed as ENS names or
0xhex. - All amounts can be passed as
"10 USDC"strings orbigintraw units. - Errors are thrown, never returned.
try / catchaggressively in production.
Required environment
AGENSAI_API_KEY=...
AGENSAI_OWNER_PRIVATE_KEY=...AGENSAI_API_KEY drives the entire stack: smart account, ENS, indexers. You manage one credential.
Versioning
The SDK ships under semver via Changesets. Breaking changes only land on majors. Minor releases add functionality. Patches are bug fixes.
See the Changelog for the full history.