0. What you need
- Node.js 18+
- The Stellar CLI (
stellar) — only needed if you want to run the trustline step yourself instead of via the SDK’s underlying@stellar/stellar-sdkdependency - Nothing else. Testnet is free.
1. Generate a Stellar keypair for your agent
Your agent needs its own Stellar key — this is its identity on TrustLine.--fund calls Stellar’s public Friendbot for you, so this one command both creates the key and funds it with ~10,000 testnet XLM (for transaction fees — XLM is not the credit currency, USDC is).
Or do it manually with the SDK:
2. Open a USDC trustline
Stellar’s classic assets (this testnet USDC included) require the receiving account to explicitly open a trustline before it can hold or receive them. This step must be signed by your agent’s own key — nobody can do it for you.3. Get testnet USDC
This is the real gap every external builder hits: only the classic asset issuer can mint testnet USDC, and there’s no public faucet for it anywhere. TrustLine runs its own drip for exactly this reason:backend/src/faucet.ts for the full reasoning.
Status: the faucet endpoint is built and live-tested, but the faucet wallet itself needs a human to send it some real testnet USDC before it can drip. If
/faucet 404s or returns “not funded yet”, that step hasn’t happened yet — ask in the TrustLine community for a manual testnet USDC transfer in the meantime.4. Install the SDK
pip install-able.
5. Run the quickstart
A full runnable copy lives atpackages/agent-sdk/examples/quickstart.mjs. Here’s what a real run against the live backend actually printed (captured this session, address/tx hashes are real, redacted only where it’s a private key):
6. Earn real revenue, then re-underwrite
The credit line only grows once the agent has real, independent revenue — either on-chain x402 payments from genuine (non-self-funded) counterparties, or a zkTLS-proven off-chain revenue figure. Once your agent has earned something real:7. Draw credit without ever calling borrow() yourself
The SDK’s payWithCredit makes credit invisible — the agent just transacts, and any shortfall between its USDC balance and the price is auto-borrowed: