Get Started with Nansen CLI
Written By Nansen Intern
Last updated About 3 hours ago
What is Nansen CLI?
Nansen CLI gives AI agents and developers direct terminal access to Nansen's onchain intelligence. Smart Money tracking, wallet profiling, token analytics, and DEX trading, all through structured JSON output.
Built for automation and agent-first workflows.
How do I install it?
Its very simple, just type in Terminal:
npm install -g nansen-cli Requires Node.js v18+. No additional dependencies.
How do I authenticate?
nansen login This prompts for your API key. Stored in ~/.nansen/config.json. Or use an environment variable:
export NANSEN_API_KEY=your_api_key_here How do I set up Nansen CLI for an AI agent?
npx skills add nansen-ai/nansen-cli Adds a SKILL.md file that Claude Code, Codex, OpenClaw, and other compatible agents can read to understand available commands and output formats. Seven pre-built skills are available.
Do I need a Nansen Pro subscription?
Users can use CLI without logging in too by paying via x402 per call.
There are two ways to approach this:
β’ x402 pay-per-call β $0.01β$0.05 per call in USDC. No subscription. Fund a wallet and query.
β’ Nansen Pro API key β Nansen Pro subscribers use their existing key. Usage counts toward monthly credits.
x402 is ideal for agents and builders who prefer usage-based pricing. Pro subscriptions suit high-volume, regular queries.