Get from zero to your first API call in under 5 minutes using the twak CLI.
Run directly without installing (recommended):
npx @trustwallet/cli --versionOr install globally:
npm install -g @trustwallet/cli
twak --versionPermission denied? If you get
EACCESon macOS/Linux, either usenpx @trustwallet/cli(no install needed), install Node via nvm (avoids/usr/localpermissions), or runsudo npm install -g @trustwallet/cli.
Get your API key and HMAC secret from the developer portal, then run:
twak init --api-key your_access_id \
--api-secret your_hmac_secretCredentials are stored in ~/.twak/credentials.json (file permissions 0600). This is the recommended approach for local development.
For CI/CD pipelines, use environment variables instead:
export TWAK_ACCESS_ID=your_access_id
export TWAK_HMAC_SECRET=your_hmac_secretDo not add these exports to
~/.zshrcor~/.bashrc. Usetwak initfor persistent local credentials — it stores them in a dedicated file with restricted permissions. Env vars are intended for ephemeral CI/CD environments.
Confirm the setup:
twak auth statusNever commit your HMAC secret to version control. If using a
.envfile, add it to.gitignore.
Fetch the current ETH price — no wallet required:
twak price ETHAdd --json for machine-readable output:
twak price ETH --jsonList all supported chains:
twak chains# ETH balance for any address (coin 60 = Ethereum)
twak balance --address <addr> --coin 60
# All token holdings for an address
twak holdings --address <addr> --coin 60
# Trending tokens (with optional category and sort)
twak trending --limit 5
twak trending --category ai
twak trending --category memes --sort volume
# Browse DApps and protocols
twak dapps
twak dapps --category defi
# Search for tokens by name or symbol
twak search uniswap
# Transaction history for an address
twak history --address <addr> --chain ethereum
# Security / rug-risk check for a token
twak risk c60_t0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
# Create an embedded agent wallet
twak wallet create --password <pw>
# Portfolio with USD values across all chains
twak wallet portfolio
# Get a swap quote first, then execute
twak swap 0.1 ETH USDC --chain ethereum --quote-only
twak swap 0.1 ETH USDC --chain ethereum
# Start an MCP server for AI agent integrations
twak serveRun any command with --help to see all options.
- CLI Reference — full command reference
- Authentication — how HMAC signing works