Getting Started

Requirements

  • Python 3.10+ or Node.js 20+
  • Access to Algod and Indexer HTTP APIs (defaults use AlgoNode public endpoints)

Install

Python

pip install "algopay-sdk==0.1.0a3"

TypeScript

npm i @algodev-studio/algopay

Configure

Set your network and optional overrides via environment variables:

ALGOPAY_NETWORK=algorand-testnet
ALGOD_URL=                    # defaults to AlgoNode
INDEXER_URL=                  # defaults to AlgoNode
ALGOPAY_USDC_ASA_ID=          # auto-detected per network

First Payment (Python)

from algopay import AlgoPay

ap = AlgoPay()
wallet = ap.wallet.create("my-agent")
result = ap.pay(
    wallet_id=wallet.id,
    to="RECIPIENT_ADDRESS",
    amount=1.50,
    purpose="API call fee",
)
print(result.tx_id)

First Payment (TypeScript)

import { AlgoPay } from "@algodev-studio/algopay";

const ap = new AlgoPay();
const wallet = await ap.wallet.create("my-agent");
const result = await ap.pay({
  walletId: wallet.id,
  to: "RECIPIENT_ADDRESS",
  amount: 1.50,
  purpose: "API call fee",
});
console.log(result.txId);

Next Steps