Skip to content

SDK reference

@agensai/sdk is the canonical TypeScript library for AGENSAI. Use it from any Node 20+ runtime.

Install

npm install @agensai/sdk

Surface

ExportPurpose
createAgentProvision a new agent (smart account + ENS subname + policies)
getAgentRestore an existing agent by ENS name
listAgentsEnumerate agents under your API key
AgentThe runtime handle: execute, batch, revoke, policies

Conventions

  • All methods are async.
  • All addresses can be passed as ENS names or 0x hex.
  • All amounts can be passed as "10 USDC" strings or bigint raw units.
  • Errors are thrown, never returned. try / catch aggressively 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.