# Get chain by ID Source: https://developers.zerion.io/api-reference/chains/get-chain-by-id /openapi-v1.yaml get /v1/chains/{chain_id} Look up one supported chain by its chain ID, with name, icon, native asset and per-chain feature flags. # Get list of all chains Source: https://developers.zerion.io/api-reference/chains/get-list-of-all-chains /openapi-v1.yaml get /v1/chains/ Every chain Zerion API supports, with the chain IDs, icons, native assets and feature flags used by all other endpoints. # Get DApp by ID Source: https://developers.zerion.io/api-reference/dapps/get-dapp-by-id /openapi-v1.yaml get /v1/dapps/{dapp_id} Look up one dapp by its ID, with the name and icon used to label DeFi positions and transactions. # Get list of DApps Source: https://developers.zerion.io/api-reference/dapps/get-list-of-dapps /openapi-v1.yaml get /v1/dapps Browse dapp metadata (names, icons, categories) used to label DeFi positions and transactions. # Get a chart for a fungible asset Source: https://developers.zerion.io/api-reference/fungibles/get-a-chart-for-a-fungible-asset /openapi-v1.yaml get /v1/fungibles/{fungible_id}/charts/{chart_period} Historical price chart for a token over a selected period, by Zerion fungible ID. # Get a chart for a fungible asset by implementation Source: https://developers.zerion.io/api-reference/fungibles/get-a-chart-for-a-fungible-asset-by-implementation /openapi-v1.yaml get /v1/fungibles/by-implementation/charts/{chart_period} Historical price chart for a token, addressed by chain and contract address instead of Zerion fungible ID. # Get fungible asset by ID Source: https://developers.zerion.io/api-reference/fungibles/get-fungible-asset-by-id /openapi-v1.yaml get /v1/fungibles/{fungible_id} Metadata, current price and market data for a single token, by its Zerion fungible ID. # Get fungible asset by implementation Source: https://developers.zerion.io/api-reference/fungibles/get-fungible-asset-by-implementation /openapi-v1.yaml get /v1/fungibles/by-implementation Look up a token by chain and contract address, without knowing its Zerion fungible ID. # Get list of fungible assets Source: https://developers.zerion.io/api-reference/fungibles/get-list-of-fungible-assets /openapi-v1.yaml get /v1/fungibles/ Search and filter the token catalog Zerion supports, with prices, market data and per-chain implementations. # Get list of all available gas prices Source: https://developers.zerion.io/api-reference/gas/get-list-of-all-available-gas-prices /openapi-v1.yaml get /v1/gas-prices/ Real-time gas price estimates for every supported chain, at each speed tier. # Get list of NFTs Source: https://developers.zerion.io/api-reference/nfts/get-list-of-nfts /openapi-v1.yaml get /v1/nfts/ Batch-look up NFTs by reference, covering both ERC-721 and ERC-1155, with media and traits. # Get single NFT by ID Source: https://developers.zerion.io/api-reference/nfts/get-single-nft-by-id /openapi-v1.yaml get /v1/nfts/{nft_id} Look up one NFT by its unique ID, with media, traits and collection context. # Count wallets within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/count-wallets-within-subscription /openapi-v1.yaml get /v1/tx-subscriptions/{subscription_id}/wallets/count Count how many wallets a webhook subscription currently monitors. # Create subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/create-subscription /openapi-v1.yaml post /v1/tx-subscriptions/ Create a webhook subscription that pushes transaction notifications for a set of wallets to your callback URL. # Delete subscription by ID Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/delete-subscription-by-id /openapi-v1.yaml delete /v1/tx-subscriptions/{subscription_id} Permanently delete a webhook subscription and stop notifications for all of its wallets. # Disable a specific subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/disable-a-specific-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/disable Pause a webhook subscription without deleting it or losing its wallet list. # Enable a specific subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/enable-a-specific-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/enable Resume a paused webhook subscription and start receiving notifications again. # Find subscription by ID Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/find-subscription-by-id /openapi-v1.yaml get /v1/tx-subscriptions/{subscription_id} Fetch one webhook subscription by ID, with the wallets and chains it monitors and its callback URL. # Find subscriptions Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/find-subscriptions /openapi-v1.yaml get /v1/tx-subscriptions/ List your webhook subscriptions, filtered by wallet or chain. # Find wallets within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/find-wallets-within-subscription /openapi-v1.yaml get /v1/tx-subscriptions/{subscription_id}/wallets List the wallet addresses a webhook subscription currently monitors. # Patch wallets within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/patch-wallets-within-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/wallets Add or remove wallets in a webhook subscription without resending the whole list. # Replace wallets within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/replace-wallets-within-subscription /openapi-v1.yaml put /v1/tx-subscriptions/{subscription_id}/wallets Replace the entire wallet list of a webhook subscription in one call. # Update callback URL within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/update-callback-url-within-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/callback_url Point an existing webhook subscription at a new callback URL. # Update chain IDs within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/update-chain-ids-within-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/chain_ids Change which chains a webhook subscription monitors, replacing the current chain list. # Update filters within subscription Source: https://developers.zerion.io/api-reference/subscriptions-to-transactions/update-filters-within-subscription /openapi-v1.yaml patch /v1/tx-subscriptions/{subscription_id}/filters Replace or clear the event filters on an existing webhook subscription. # Get swap and bridge quotes Source: https://developers.zerion.io/api-reference/swap/get-swap-and-bridge-quotes /openapi-v1.yaml get /v1/swap/quotes/ Compare same-chain swap and cross-chain bridge quotes from multiple DEXs, aggregators and bridges, best first. # List fungibles available for bridging Source: https://developers.zerion.io/api-reference/swap/list-fungibles-available-for-bridging /openapi-v1.yaml get /v1/swap/fungibles/ List the tokens available for bridging between two chains, for populating a token picker. # Get wallet set balance chart Source: https://developers.zerion.io/api-reference/wallet-sets/get-wallet-set-balance-chart /openapi-v1.yaml get /v1/wallet-sets/charts/{chart_period} Combined portfolio value over time for an EVM and Solana address, filterable by chain and asset type. # Get wallet set fungible positions Source: https://developers.zerion.io/api-reference/wallet-sets/get-wallet-set-fungible-positions /openapi-v1.yaml get /v1/wallet-sets/positions/ Token balances and DeFi positions across an EVM and Solana address, returned as one combined set. # Get wallet set PnL Source: https://developers.zerion.io/api-reference/wallet-sets/get-wallet-set-pnl /openapi-v1.yaml get /v1/wallet-sets/pnl Realized and unrealized PnL across an EVM and Solana address combined, FIFO-based. # Get wallet set portfolio Source: https://developers.zerion.io/api-reference/wallet-sets/get-wallet-set-portfolio /openapi-v1.yaml get /v1/wallet-sets/portfolio Combined portfolio value for an EVM and Solana address, broken down by chain and position type. # Get wallet set transactions Source: https://developers.zerion.io/api-reference/wallet-sets/get-wallet-set-transactions /openapi-v1.yaml get /v1/wallet-sets/transactions/ Decoded transaction history across an EVM and Solana address, merged into one timeline. # Get wallet balance chart Source: https://developers.zerion.io/api-reference/wallets/get-wallet-balance-chart /openapi-v1.yaml get /v1/wallets/{address}/charts/{chart_period} Portfolio value over time for a wallet, filterable by chain and asset type, over any start and end timestamp. # Get wallet fungible positions Source: https://developers.zerion.io/api-reference/wallets/get-wallet-fungible-positions /openapi-v1.yaml get /v1/wallets/{address}/positions/ A wallet's token balances and DeFi positions across every supported chain, priced and ready to render. # Get wallet NFT collections Source: https://developers.zerion.io/api-reference/wallets/get-wallet-nft-collections /openapi-v1.yaml get /v1/wallets/{address}/nft-collections/ The NFT collections a wallet holds, with per-collection holdings count and floor price. # Get wallet NFT portfolio Source: https://developers.zerion.io/api-reference/wallets/get-wallet-nft-portfolio /openapi-v1.yaml get /v1/wallets/{address}/nft-portfolio Aggregate NFT portfolio value for a wallet, totalled from floor prices across chains. # Get wallet NFT positions Source: https://developers.zerion.io/api-reference/wallets/get-wallet-nft-positions /openapi-v1.yaml get /v1/wallets/{address}/nft-positions/ Every NFT a wallet holds, with media, traits, collection and floor price. # Get wallet PnL Source: https://developers.zerion.io/api-reference/wallets/get-wallet-pnl /openapi-v1.yaml get /v1/wallets/{address}/pnl Realized and unrealized PnL for a wallet, FIFO-based, with net invested and per-asset-category filters. # Get wallet portfolio Source: https://developers.zerion.io/api-reference/wallets/get-wallet-portfolio /openapi-v1.yaml get /v1/wallets/{address}/portfolio A wallet's total portfolio value, broken down by chain and position type. # Get wallet transactions Source: https://developers.zerion.io/api-reference/wallets/get-wallet-transactions /openapi-v1.yaml get /v1/wallets/{address}/transactions/ Decoded transaction history for a wallet, with transfers, approvals, fees and dapp context. # Authentication Source: https://developers.zerion.io/authentication Authenticate Zerion API requests with an API key using HTTP Basic Auth, including header format, environments, and code samples in curl, JavaScript, and Python. Every request to Zerion API carries one credential. Pick the one that fits how you call it: [API keyMost common Free key, plan-based rate limits. For apps with steady traffic. `Authorization: Basic`](#api-key) [x402 Pay per call in USDC on Base or Solana. Agent-friendly, no key needed. `PAYMENT-SIGNATURE`](/build-with-ai/x402) [MPP Pay per call in USDC on Tempo. Agent-friendly, no key needed. `Authorization: Payment`](/build-with-ai/mpp) All three unlock the same endpoints with the same parameters. Only the header changes. ## API key Zerion API uses [HTTP Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#basic_authentication_scheme), with your API key as the username and an empty password. Get a key from the [Dashboard](https://dashboard.zerion.io); its Get Started section also has ready-to-use snippets with your key pre-filled. 1 · Key + colon `YOUR_API_KEY:` → 2 · Base64-encode `WU9VUl9BUElfS0VZOg==` 3 · Send as header `Authorization: Basic WU9VUl9BUElfS0VZOg==` Username = your API key, password = empty. Keep the trailing colon: it separates the two. ### Make your first call **From the docs:** every API reference page has a playground. Click **Try it**, paste your API key in **Username**, leave **Password** empty, and click **Send**. **From your code:** most HTTP clients build the header when you pass the key as the Basic Auth username. Otherwise, encode it as shown above. ```bash cURL theme={null} # -u builds the Basic Auth header for you (note the trailing colon) curl "https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/portfolio" \ -u "YOUR_API_KEY:" \ -H "accept: application/json" ``` ```javascript JavaScript theme={null} // Transform your API key for Basic Auth const apiKey = 'YOUR_API_KEY'; const apiKeyTransformed = btoa(apiKey + ':'); // Make the request const response = await fetch( 'https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/portfolio', { headers: { 'Authorization': `Basic ${apiKeyTransformed}`, 'accept': 'application/json' } } ); const data = await response.json(); console.log(data); ``` ```python Python theme={null} import requests import base64 # Transform your API key for Basic Auth api_key = 'YOUR_API_KEY' api_key_transformed = base64.b64encode(f'{api_key}:'.encode()).decode() # Make the request response = requests.get( 'https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/portfolio', headers={ 'Authorization': f'Basic {api_key_transformed}', 'accept': 'application/json' } ) data = response.json() print(data) ``` ```go Go theme={null} import ( "encoding/base64" "net/http" ) // Transform your API key for Basic Auth apiKey := "YOUR_API_KEY" apiKeyTransformed := base64.StdEncoding.EncodeToString([]byte(apiKey + ":")) // Make the request client := &http.Client{} req, _ := http.NewRequest("GET", "https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/portfolio", nil) req.Header.Set("Authorization", "Basic " + apiKeyTransformed) req.Header.Set("accept", "application/json") resp, _ := client.Do(req) defer resp.Body.Close() ``` ### Security best practices > [!WARNING] > > Never expose your API key in client-side code or public repositories. * Store your API key in environment variables * Make API requests from server-side code * Rotate your key immediately if it's ever compromised * Use separate keys for development and production ## Pay-per-request: x402 and MPP Both x402 and MPP let you call Zerion API by paying a small USDC fee per request instead of presenting an API key. They're a better fit than API keys when: * You're building an AI agent or automated pipeline that shouldn't manage long-lived credentials * Traffic is bursty or unpredictable and you don't want to size a rate-limited plan * You want usage-based cost accounting at the request level Pick whichever chain your wallet already holds USDC on, then follow the [x402 guide](/build-with-ai/x402) or the [MPP guide](/build-with-ai/mpp). The [Zerion CLI](/build-with-ai/zerion-cli) supports both via `--x402` / `--mpp` flags. # Model Context Protocol (MCP) server Source: https://developers.zerion.io/build-with-ai/mcp Connect Claude, Cursor, and other AI coding tools to Zerion API docs through the Model Context Protocol server for in-editor answers and code generation. Zerion API docs are available as a Model Context Protocol (MCP) server. Once connected, your AI tool can search the full documentation and OpenAPI spec while generating code. No copy-pasting needed. ## Connect via MCP > [tab] Claude Code > > Run this in your terminal: > > ```bash theme={null} > claude mcp add --transport http zerion-api https://developers.zerion.io/mcp > ``` > > The Zerion docs will be available as a tool in all Claude Code sessions. > [tab] Cursor > > Open the command palette (`Cmd+Shift+P`) → "MCP: Edit Config", then add: > > ```json theme={null} > { > "mcpServers": { > "zerion-api": { > "url": "https://developers.zerion.io/mcp" > } > } > } > ``` > [tab] VS Code > > Create `.vscode/mcp.json` in your project: > > ```json theme={null} > { > "servers": { > "zerion-api": { > "type": "http", > "url": "https://developers.zerion.io/mcp" > } > } > } > ``` > [tab] Claude Web > > 1. Go to Claude settings → **Connectors** > 2. Click **Add custom connector** > 3. Name: `Zerion API`, URL: `https://developers.zerion.io/mcp` > 4. Use the attachments button (+) in any chat to access it ## What you can ask Once connected, you can ask your AI assistant things like: * *"How do I get a wallet's token positions on Ethereum?"* * *"Write a Python script that fetches transaction history and filters for trades"* * *"What filters are available on the positions endpoint?"* The AI will search the Zerion docs in real time to give you accurate, up-to-date answers. ## Open in AI assistants You can also open any documentation page directly in an AI chat for quick questions: [Claude Paste any docs page URL into Claude for API questions and code generation.](https://claude.ai) [ChatGPT Use ChatGPT to explore endpoints and generate integration code.](https://chat.openai.com) > [!TIP] > > For the best experience, use the MCP integration instead of copy-pasting. It gives the AI access to the full docs and API spec, not just one page at a time. # MPP payments: pay-per-request Zerion API access Source: https://developers.zerion.io/build-with-ai/mpp Call Zerion API without an API key by paying per request in USDC on Tempo with the Machine Payments Protocol. No signup, rate limits, or monthly plan. MPP ([Machine Payments Protocol](https://mpp.dev)) is an open protocol for pay-per-request HTTP access. Instead of an API key, you pay a small amount of USDC on Tempo for each request. This model is ideal for AI agents that need onchain data without managing subscriptions or key rotation. This is an alternative authorization method for the same Zerion API. Endpoints, JSON:API responses, query parameters, and filters all behave exactly as in the rest of the docs. Only the way you prove access changes. Zerion also supports [x402](./x402), a sibling protocol that settles on Base or Solana. See [Authentication](/authentication) for an overview of all access methods. ## Quickstart with the Zerion CLI The easiest way to use MPP is with the [Zerion CLI](./zerion-cli), which handles the payment handshake, wallet signing, and retries automatically. Set an EVM private key for a wallet that holds USDC on Tempo, then make a request with `--mpp`: ```bash theme={null} export WALLET_PRIVATE_KEY="0x..." zerion-cli wallet portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --mpp ``` > [!TIP] > > Set `ZERION_MPP=true` to enable MPP globally for analytics commands instead of passing `--mpp` on every call. If you already use `WALLET_PRIVATE_KEY` for x402, the same key works for MPP - or set `TEMPO_PRIVATE_KEY` to use a different wallet for Tempo. ## Direct integration If you're not using the CLI, use one of the [official MPP SDKs](https://mpp.dev/sdk) (TypeScript, Python, Go, Rust) to handle payment construction and retries. You'll need a wallet with USDC on Tempo and its EVM private key. ## Example ```ts theme={null} import { privateKeyToAccount } from 'viem/accounts' import { Mppx, tempo } from 'mppx/client' Mppx.create({ methods: [tempo({ account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY) })], }) // Global fetch now handles 402 automatically const res = await fetch( 'https://api.zerion.io/v1/wallets/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/portfolio' ) const data = await res.json() ``` ## How it works The card at the top of this page plays this exchange: 1. Client sends a request to an API endpoint 2. Server returns `402` with a `WWW-Authenticate: Payment` challenge describing where and how much to pay 3. Client signs a USDC transfer on Tempo and retries with an `Authorization: Payment` header 4. Zerion verifies the credential with the MPP facilitator and returns the response ## Rate limits None. You pay per request, with no per-second or monthly quota. ## Error handling * `402 Payment required` - no or invalid payment credential. Inspect the `WWW-Authenticate: Payment` response header for a fresh challenge and retry. * `402 MPP payment rejected` - the facilitator rejected the credential. The `detail` field contains the reason (e.g. insufficient funds, expired authorization). # Build AI agents with onchain data Source: https://developers.zerion.io/build-with-ai/overview Connect AI agents and assistants to wallet portfolios, DeFi positions, transactions, and token prices with Zerion API, the MCP server, x402, and MPP payments. Give your AI agents access to wallet portfolios, token data, transactions, and DeFi positions across all supported chains. Zerion provides multiple ways to integrate depending on your setup. [Zerion CLI Give AI agents access to onchain data via shell commands - no API integration needed.](/build-with-ai/zerion-cli) [x402 Let AI agents pay for API access per-request using stablecoins - no API keys needed.](/build-with-ai/x402) [MCP server Connect AI tools like Claude Code, Cursor, and VS Code to the Zerion docs and OpenAPI spec via Model Context Protocol.](/build-with-ai/mcp) # x402 payments: pay-per-request Zerion API access Source: https://developers.zerion.io/build-with-ai/x402 Call Zerion API without an API key by paying per request in USDC on Base or Solana with the x402 protocol. No signup, rate limits, or monthly plan needed. x402 is [Coinbase's open protocol](https://github.com/coinbase/x402) for pay-per-request HTTP access. Instead of an API key, you pay a small amount of USDC on Base or Solana for each request. This model is ideal for AI agents that need onchain data without managing subscriptions or key rotation. This is an alternative authorization method for the same Zerion API. Endpoints, JSON:API responses, query parameters, and filters all behave exactly as in the rest of the docs. Only the way you prove access changes. Zerion also supports [MPP](./mpp), a sibling protocol that settles on Tempo. See [Authentication](/authentication) for an overview of all access methods. ## Quickstart with the Zerion CLI The easiest way to use x402 is with the [Zerion CLI](./zerion-cli), which handles the payment handshake, wallet signing, and retries automatically. Set the private key of the wallet that holds USDC, then make a request with `--x402`: > [tab] Base (EVM) > > ```bash theme={null} > export WALLET_PRIVATE_KEY="0x..." > zerion-cli wallet portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --x402 > ``` > [tab] Solana > > ```bash theme={null} > export SOLANA_PRIVATE_KEY="" > export ZERION_X402_PREFER_SOLANA=true > zerion-cli wallet portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --x402 > ``` > [!TIP] > > Set `ZERION_X402=true` to enable x402 globally for analytics commands instead of passing `--x402` on every call. ## Direct integration If you're not using the CLI, use the [Coinbase x402 SDK](https://github.com/coinbase/x402) (Go, TypeScript, Python) to handle payment construction and retries. You'll need a wallet with USDC on Base or Solana and its private key. ## Example ```ts theme={null} import { wrapFetchWithPayment, x402Client } from '@x402/fetch' import { registerExactEvmScheme } from '@x402/evm/exact/client' import { privateKeyToAccount } from 'viem/accounts' const client = new x402Client() registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY), }) const fetchWithPayment = wrapFetchWithPayment(fetch, client) const res = await fetchWithPayment( 'https://api.zerion.io/v1/wallets/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045/portfolio' ) const data = await res.json() ``` ## How it works The card at the top of this page plays this exchange: 1. Client sends a request to an API endpoint 2. Server returns `402` with a `PAYMENT-REQUIRED` header describing where and how much to pay 3. Client signs a USDC transfer and retries with a `PAYMENT-SIGNATURE` header 4. Zerion settles the payment via the Coinbase Developer Platform and returns the response ## Rate limits None. You pay per request, with no per-second or monthly quota. ## Error handling * `402 Payment required` - no or invalid payment signature. Inspect the `PAYMENT-REQUIRED` response header for a fresh challenge and retry. * `402 x402 payment rejected` - the facilitator rejected the signature. The `detail` field contains the reason. * `402 x402 payment settlement failed` - the signature was valid but onchain settlement failed. See the [Coinbase x402 troubleshooting docs](https://docs.cdp.coinbase.com/x402/support/troubleshooting#common-errors) for more. # Zerion CLI and agent skills for AI coding tools Source: https://developers.zerion.io/build-with-ai/zerion-cli Analyze wallets, sign, swap, and bridge across EVM chains and Solana from the command line, plus agent skills that ship across every major AI coding agent. Onboard your agent to Zerion in one command. \$ `npx zerion-cli@latest init` [Get your API key](https://dashboard.zerion.io) [GitHub](https://github.com/zeriontech/zerion-ai) The Zerion CLI is an open-source tool that wraps Zerion API and a local encrypted wallet vault. The same binary powers both humans and AI agents. Any agent that can run shell commands can analyze wallets, sign messages, and execute swaps without writing API integration code. Wallet management is built on the [Open Wallet Standard](https://github.com/open-wallet-standard/core). The `zerion` agent skill ships alongside the CLI for AI coding agents (Claude Code, Cursor, Windsurf, Codex, Gemini, OpenCode, and any [agentskills.io](https://agentskills.io) host). **Repository:** [github.com/zeriontech/zerion-ai](https://github.com/zeriontech/zerion-ai). The CLI and skills ship from the same repo. > [!NOTE] > > **Alpha preview** - The CLI is under active development. Commands, flags, and output formats may change between releases. Don't depend on current behavior in production workflows. ## Installation One-shot setup: installs or upgrades the CLI globally, configures your API key, and adds skills across all detected coding agents (Claude Code, Codex, Cursor, and Gemini CLI): ```bash theme={null} npx zerion-cli@latest init ``` * `-y` runs setup non-interactively * `--browser` opens [dashboard.zerion.io](https://dashboard.zerion.io) so you can grab an API key and paste it back * Skills install globally to every detected AI coding agent Or install the CLI binary on its own: ```bash theme={null} npm install -g zerion-cli ``` Requires Node.js 22.12+ or 20.19+. ## Authentication Three options. The CLI auto-detects which is active. ### API key (recommended) Get a free key at [dashboard.zerion.io](https://dashboard.zerion.io). Keys begin with `zk_`. ```bash theme={null} export ZERION_API_KEY="zk_..." ``` Or persist it via config: ```bash theme={null} zerion config set apiKey zk_... ``` Required for analysis and trading. Analysis can also use x402 / MPP pay-per-call. ### x402 pay-per-call No API key needed. Pays \$0.01 USDC per request via the [x402 protocol](https://www.x402.org/). Supports EVM (Base) and Solana. ```bash theme={null} export WALLET_PRIVATE_KEY="0x..." # EVM (Base) - 0x-prefixed hex export WALLET_PRIVATE_KEY="5C1y..." # Solana - base58 keypair zerion analyze 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --x402 ``` Enable globally: ```bash theme={null} export ZERION_X402=true ``` Both chains simultaneously: ```bash theme={null} export EVM_PRIVATE_KEY="0x..." export SOLANA_PRIVATE_KEY="5C1y..." export ZERION_X402_PREFER_SOLANA=true ``` > [!NOTE] > > Pay-per-call applies to analytics commands only (`portfolio`, `positions`, `history`, `pnl`, `analyze`). Trading commands always use an API key. ### MPP pay-per-call No API key needed. Pays \$0.01 USDC per request via the [MPP protocol](https://mpp.dev) on [Tempo](https://tempo.xyz). EVM only. ```bash theme={null} export WALLET_PRIVATE_KEY="0x..." # or a dedicated key: export TEMPO_PRIVATE_KEY="0x..." zerion portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --mpp ``` Enable globally: ```bash theme={null} export ZERION_MPP=true ``` ## Skills The CLI ships one agent skill, `zerion`, which loads capability guides as needed. | Capability | What it does | | - | - | | `wallet` | Wallet management: create, import, list, fund, backup, delete, sync | | `analyze` | Read-only wallet insights: portfolio, positions, history, PnL, watchlist (supports x402 / MPP) | | `trading` | Swap, bridge, send tokens (onchain actions; needs API key + agent token) | | `sign` | Off-chain signing: sign-message (EIP-191 / raw), sign-typed-data (EIP-712) | | `agent-management` | Agent tokens + policies (the autonomous-trading primitives) | | `defi-exit` | Exit DeFi positions: withdraw, unstake, redeem, claim rewards, repay. Use `--quote` (CLI 1.11+) to price an exit. | | `bundle` | Run several actions in one signing session. | | `swap-0x` | Direct 0x Swap API integration. | Install or reinstall skills: ```bash theme={null} zerion setup skills # all detected agents (default: global) zerion setup skills --agent claude-code # scope to one agent zerion setup skills -g # force global install ``` Per-host plugin installs (alternative to `setup skills`): ```bash theme={null} # Claude Code /plugin marketplace add zeriontech/zerion-ai /plugin install zerion-agent@zerion # OpenAI Codex CLI codex plugin marketplace add zeriontech/zerion-ai # then run /plugins, choose the zerion marketplace, install zerion-agent # Cursor (or install the Zerion plugin from the Cursor Marketplace) npx skills add zeriontech/zerion-ai --agent cursor # OpenCode npx skills add zeriontech/zerion-ai --agent opencode # Gemini CLI gemini extensions install https://github.com/zeriontech/zerion-ai # Any agentskills.io host npx skills add zeriontech/zerion-ai ``` ## Manual setup, agent execution The CLI splits cleanly into two surfaces, by design. * **Wallet management and agent token setup are manual.** `wallet create`, `import`, `backup`, and `delete` prompt for a passphrase. `wallet sync` emits a QR code you scan with the Zerion app. `agent create-token` mints a scoped trading credential bound to a specific wallet, and `agent create-policy` attaches the rules it must obey: allowed chains, expiry, transfer/approval gates, contract allowlists. No key material moves and no spending credential widens without you in the loop. * **Analysis, signing, trading, and discovery are for agents.** `analyze`, `portfolio`, `positions`, `history`, `pnl`, `sign-message`, `sign-typed-data`, `swap`, `bridge`, `send`, `search`, `chains`, and read-only listings emit JSON to stdout, structured errors to stderr, and skip confirmation dialogs. Once an agent token is configured, signing and trading fire immediately. You stage by hand once: create or import a wallet, set a passphrase, mint an agent token, attach a policy. Then you hand the agent token to an automation that can only do what the policy allows. Treat agent tokens like API keys with spending power. ## Commands Every command supports `--help` for full flag documentation. Run `zerion --help` for the top-level command list. ### Analyze Read-only wallet insights. Supports `--x402` and `--mpp` for pay-per-call. ```bash theme={null} # Full analysis - portfolio, positions, transactions, PnL in parallel zerion analyze vitalik.eth # Targeted reads zerion portfolio 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 zerion positions vitalik.eth --defi # grouped by protocol, loans netted zerion positions vitalik.eth --positions defi # flat list of DeFi positions zerion history vitalik.eth --limit 10 --chain ethereum zerion pnl vitalik.eth ``` #### Analyze options | Command | Description | | - | - | | `zerion analyze ` | Full analysis: portfolio, positions, transactions, PnL in parallel | | `zerion portfolio ` | Portfolio value and top positions | | `zerion positions ` | Token + DeFi positions (`--positions all\|simple\|defi`, or `--defi` for grouped-by-protocol view) | | `zerion history ` | Transaction history (`--limit`, `--chain`) | | `zerion pnl ` | Profit & loss (realized, unrealized, fees) | | `zerion search ` | Search tokens by name or symbol | | `zerion chains` | List supported chains (`--json` includes chain IDs and RPC URLs) | ### Trade Requires an API key plus an agent token for unattended use. Chain is the first positional argument. ```bash theme={null} # Same-chain swap - zerion swap zerion swap base 1 USDC ETH zerion swap ethereum 0.1 ETH USDC zerion swap solana 0.1 SOL USDC zerion swap monad 1 USDC MON # Get a quote without executing zerion swap base 1 USDC ETH --quote # List tokens available for swap on a chain zerion swap tokens base zerion swap tokens solana # Bridge - zerion bridge # Default: list all provider offers (no transaction signed) zerion bridge base USDC 5 arbitrum USDC # Execute the highest-output offer zerion bridge base USDC 5 arbitrum USDC --cheapest # Execute the fastest offer zerion bridge base USDC 5 arbitrum USDC --fast # Bridge + swap on destination zerion bridge base USDC 5 arbitrum ETH --cheapest # Cross-format bridge (EVM ↔ Solana) - destination wallet required if source is EVM-only or Solana-only zerion bridge ethereum USDC 50 solana USDC --to-wallet sol-bot --cheapest zerion bridge ethereum USDC 50 solana USDC --to-address 8xLdox... --cheapest # Send - chain auto-detected from recipient format zerion send USDC 50 --to 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain base zerion send SOL 0.1 --to 2Nsnn... ``` #### Trade options | Command | Description | | - | - | | `zerion swap ` | Same-chain swap | | `zerion swap ... --quote` | Return a quote without executing the swap | | `zerion swap tokens [chain]` | List tokens available for swap | | `zerion bridge ` | List all bridge providers (multi-offer mode; no execute) | | `zerion bridge ... --cheapest` | Execute the highest-output offer | | `zerion bridge ... --fast` | Execute the lowest-time offer (falls back to `--cheapest` if no time data) | | `zerion bridge ... --quote` | Return a quote without executing the bridge | | `zerion bridge ... --to-wallet ` | Destination wallet for cross-format bridges (Solana ↔ EVM) | | `zerion bridge ... --to-address ` | Raw destination address (must match destination-chain format) | | `zerion send --to
` | Send tokens (chain auto-inferred from address format) | | `zerion send SOL --to ` | Send native SOL on Solana | > [!NOTE] > > `--fast` and `--cheapest` are mutually exclusive. When used, the strategy flag must come last on the command line so flag parsing doesn't consume the next positional as its value. Single-offer routes auto-execute even without a strategy flag. ### Sign Off-chain signatures (EIP-191, EIP-712, Solana raw). No broadcast. Requires an agent token. ```bash theme={null} # EIP-191 (EVM) or raw (Solana) zerion sign-message "Login to dApp" --chain ethereum # Hex bytes zerion sign-message 0xdeadbeef --encoding hex --chain ethereum # EIP-712 typed data zerion sign-typed-data --data "$(cat permit.json)" zerion sign-typed-data --file permit.json cat permit.json | zerion sign-typed-data ``` #### Sign options | Command | Description | | - | - | | `zerion sign-message --chain ` | Sign EIP-191 (EVM) or raw (Solana) message | | `zerion sign-message --encoding hex` | Treat message as hex bytes | | `zerion sign-typed-data --data ''` | Sign EIP-712 typed data (EVM only) | | `zerion sign-typed-data --file ` | Read EIP-712 typed data from file | ### Wallet Encrypted local wallets. EVM + Solana supported. Destructive operations require a passphrase. ```bash theme={null} zerion wallet create --name trading-bot zerion wallet import --name old-wallet --evm-key zerion wallet list zerion wallet fund --wallet trading-bot zerion wallet backup --wallet trading-bot zerion wallet sync --wallet trading-bot ``` #### Wallet options | Command | Description | | - | - | | `zerion wallet create --name ` | Create encrypted wallet (EVM + Solana) | | `zerion wallet import --name --evm-key` | Import from EVM private key (interactive) | | `zerion wallet import --name --sol-key` | Import from Solana private key (interactive) | | `zerion wallet import --name --mnemonic` | Import from seed phrase (all chains) | | `zerion wallet list` | List all wallets | | `zerion wallet fund` | Show deposit addresses for funding | | `zerion wallet backup --wallet ` | Export recovery phrase | | `zerion wallet delete ` | Permanently delete a wallet | | `zerion wallet sync --wallet ` | Sync wallet to Zerion app via QR code | | `zerion wallet sync --all` | Sync all wallets | ### Agent Scoped API tokens for unattended trading. Tokens auto-save to config and are required for `swap`, `bridge`, `send`. ```bash theme={null} # Create a tight policy first zerion agent create-policy --name safe-base \ --chains base \ --expires 24h \ --deny-transfers # Mint a token bound to that policy zerion agent create-token --name dca-bot \ --wallet trading-bot \ --policy safe-base ``` #### Agent token options | Command | Description | | - | - | | `zerion agent create-token --name --wallet ` | Create scoped token | | `zerion agent list-tokens` | List active agent tokens | | `zerion agent use-token --wallet ` | Switch active token by wallet | | `zerion agent revoke-token --name ` | Revoke a token | #### Agent policy options | Command | Description | | - | - | | `zerion agent create-policy --name ` | Create security policy (flags below) | | `zerion agent list-policies` | List all policies | | `zerion agent show-policy ` | Show policy details | | `zerion agent delete-policy ` | Delete a policy | #### Policy flags | Flag | Description | | - | - | | `--chains ` | Restrict to specific chains (comma-separated) | | `--expires ` | Token expiry (e.g. `24h`, `7d`) | | `--deny-transfers` | Block raw ETH/native transfers | | `--deny-approvals` | Block ERC-20 approval calls | | `--allowlist ` | Only allow listed contract/wallet addresses | ### Watch Track wallets by name without exposing addresses in commands. ```bash theme={null} zerion watch 0xFe89Cc7Abb2C4183683Ab71653c4cCd1b9cC194e --name ens-dao zerion analyze ens-dao ``` #### Watch options | Command | Description | | - | - | | `zerion watch
--name