agenti docs
nirholas / agenti

agenti

Give AI agents the ability to use cryptocurrency

SEE LICENSE IN LICENSE
npm install @agenti/sdk @pump-fun/pump-sdk @pump-fun/pump-swap-sdk @pump-fun/agent-payments-sdk

What it does

Capabilities documented in this repository.

Vision

See the full documentation for details.

Packages

See the full documentation for details.

Give an agent a wallet

See the full documentation for details.

Pay for anything

See the full documentation for details.

Check balances

See the full documentation for details.

Receive payments

See the full documentation for details.

Get started

Install it, then run your first command.

npm install @agenti/sdk @pump-fun/pump-sdk @pump-fun/pump-swap-sdk @pump-fun/agent-payments-sdk
CommandRuns
npm run buildpnpm -r build
npm run devpnpm -r --parallel dev
npm run testpnpm -r test
npm run typecheckpnpm -r typecheck

Read the full getting started guide

Examples

Taken directly from this repository's documentation.

1. Agent sends request
   GET https://api.example.com/data

2. Server responds with payment requirements
   HTTP/1.1 402 Payment Required
   Content-Type: application/json

   {
     "x402Version": 1,
     "accepts": [{
       "scheme": "exact",
       "network": "base-mainnet",
       "maxAmountRequired": "1000000",   // 1 USDC (6 decimals)
       "payTo": "0x...",
       "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",  // USDC on Base
       "maxTimeoutSeconds": 300
     }]
   }

3. Agenti signs an EIP-3009 transferWithAuthorization
   (gasless — no ETH required, no transaction to wait for)

4. Agent retries with payment
   GET https://api.example.com/data
   X-Payment: <base64-encoded signed authorization>

5. Facilitator verifies signature and settles on-chain
   HTTP/1.1 200 OK

   { "data": "..." }
SOLANA_PRIVATE_KEY=<your-key> npx tsx examples/01-buy-a-coin.ts
ANTHROPIC_API_KEY=sk-... SOLANA_PRIVATE_KEY=<key> npx tsx examples/03-agent-buys.ts

More examples

Reference