ELSA LogoELSA | X402
BUILT ON X402

DeFi APIs.
Pay per call.

Production DeFi endpoints that charge per request in USDC. Plug into Claude via MCP, or call directly. Real transactions, real simple.

portfolio-api.sh
# Get comprehensive portfolio analysis across 15+ chains
$ curl -X POST https://x402-api.heyelsa.ai/get_portfolio \
-H "Content-Type: application/json" \
-H "X-PAYMENT: eyJ0eXAiOiJKV1Q..." \
-d '{"evm_address": "0x742d35Cc6Af832e6F5E284A2c70b6a89fB7e3338"}'
# Returns: Balances, DeFi positions, staking, P&L, risk analysis
PRACTICAL USE CASES

How to Use Elsa X402

From simple portfolio checks to complex trading strategies, see how easy it is to integrate with our pay-as-you-go X402 APIs

[UC:01]
01

Portfolio Dashboard

Build a comprehensive crypto portfolio tracker that aggregates balances across 15+ chains, calculates P&L, and provides risk analysis.

# Total cost: ~$0.03 per refresh
1. get_balances - $0.005
2. get_portfolio - $0.01
3. get_stake_balances - $0.005
4. get_pnl_report - $0.015
[UC:02]
02

AI Trading Assistant

Enable Claude or other AI assistants to execute trades using natural language commands like "Swap 0.1 ETH to USDC on Base"

# Cost per trade: ~$0.032
1. search_token - $0.001 × 2
2. get_swap_quote - $0.01
3. execute_swap - $0.02
[UC:03]
03

Yield Optimizer

Automatically discover and compare yield farming opportunities across protocols, optimizing for APY and risk.

# Cost per analysis: ~$0.035
1. analyze_wallet - $0.01
2. get_yield_suggestions - $0.02
3. get_balances - $0.005

Start Using X402 APIs in 3 Steps

1

Set Up X402 Payments

# 1. Set up wallet with USDC on Base
Your wallet: 0x742d35Cc6Af832e6F5...
# 2. Get X402 payment tokens
Generate via CDP facilitator
# 3. Ready to call APIs!
2

Choose Integration

REST API calls
MCP for Claude Desktop
JavaScript/Python/cURL
3

Start Calling APIs

# First API call to hosted endpoint
curl -X POST https://x402-api.heyelsa.ai/get_balances \
-H "X-PAYMENT: eyJhbGc..." \
-d '{"evm_address": "0x..."}'
# Returns your portfolio!

API Integration Examples

JavaScript
const response = await fetch(
'https://x402-api.heyelsa.ai/get_portfolio',
{ headers: { 'X-PAYMENT': token } }
)
Python
import requests
response = requests.post(
'https://x402-api.heyelsa.ai/get_balances',
headers={'X-PAYMENT': token})
[A1]
15+
BLOCKCHAINS
[A2]
20+
DEX PROTOCOLS
[A3]
~1s
AVG RESPONSE
[A4]
0
API KEYS NEEDED

Core Capabilities

Production-ready tools for comprehensive crypto trading operations

[SEC:01]
[01]

Portfolio Management

Multi-chain balance aggregation with USD valuations, DeFi position tracking including staking and yield farming, risk metrics and diversification analysis across 15+ mainnets.

get_portfolio - $0.01
get_balances - $0.005
get_stake_balances - $0.005
analyze_wallet - $0.01
[SEC:02]
[02]

Advanced Trading

Best price discovery across 20+ DEX protocols with optimal routing and slippage protection. Cross-chain swaps with automatic bridging, MEV protection, and real-time gas estimation.

get_swap_quote - $0.01
execute_swap - $0.02
get_token_price - $0.002
get_gas_prices - $0.001
[SEC:03]
[03]

Smart Order Management

Create limit orders with customizable parameters and price targets. Partial fill support, multi-timeframe validity, and real-time order status tracking with automatic execution.

create_limit_order - $0.02
get_limit_orders - $0.002
cancel_limit_order - $0.01
[SEC:04]
[04]

Market Intelligence

Real-time token search and price feeds with comprehensive metadata. Yield farming opportunity analysis, P&L reports, and transaction history across all supported chains.

search_token - $0.001
get_pnl_report - $0.015
get_yield_suggestions - $0.02
get_transaction_history - $0.003
X402 HTTP API

RESTful API with Micropayments

Call our hosted APIs with X402 micropayment protocol. Pay with USDC on Base network for each request. Perfect for web applications, mobile apps, and backend integrations.

swap-example.sh
# Get best swap quote across DEXs
curl -X POST https://x402-api.heyelsa.ai/get_swap_quote \
-H "X-PAYMENT: eyJhbGciOiJIUzI1..." \
-d '{"from_chain": "base", "from_token": "ETH",}'
"to_token": "USDC", "from_amount": "0.1",
"wallet_address": "0x742d35Cc..."}'
# Execute with dry-run safety
curl -X POST https://x402-api.heyelsa.ai/execute_swap \
-H "X-PAYMENT: eyJhbGciOiJIUzI1..." \
-d '{"dry_run": true, "confirmed": false}'
  • Pay-per-use with X402 protocol
  • Client-side signing for security
  • Dry-run mode enabled by default
MCP PROTOCOL

AI Assistant Integration

Connect Claude Desktop to our hosted MCP server. Enable AI assistants to execute crypto trades and analyze portfolios using natural language commands.

claude_desktop_config.json
{
"mcpServers": {
"elsa-x402": {
"command": "npx",
"args": ["@elsa/x402-mcp-client"],
"env": {
"ELSA_API_URL": "https://x402-api.heyelsa.ai",
"X402_ENABLED": "true"
}
}
}
}
  • Natural language trading commands
  • Autonomous portfolio management
  • Built-in confirmation prompts

Transparent X402 Pricing

Pure pay-per-use with USDC on Base network. No API keys, no subscriptions, no upfront costs.

SPEC-P
PORTFOLIO & ANALYTICS
[P1]search_token
$0.001
[P2]get_token_price
$0.002
[P3]get_balances
$0.005
[P4]get_portfolio
$0.01
[P5]analyze_wallet
$0.01
[P6]get_pnl_report
$0.015
TRADING OPERATIONS
[T1]get_swap_quote
$0.01
[T2]execute_swap
$0.02
[T3]create_limit_order
$0.02
[T4]get_limit_orders
$0.002
[T5]cancel_limit_order
$0.01
STAKING & YIELD
[S1]get_stake_balances
$0.005
[S2]get_yield_suggestions
$0.02
TRANSACTION MANAGEMENT
[M1]get_transaction_history
$0.003
[M2]get_transaction_status
$0.001
NETWORK UTILITIES
[N1]get_gas_prices
$0.001

Safety First

DRY-RUN MODE

All transactions default to dry-run. Test everything before executing real trades.

CLIENT-SIDE SIGNING

Your private keys never leave your device. Complete control and security.

SLIPPAGE PROTECTION

Configurable slippage limits. Transactions fail-safe if price moves too much.

REAL-TIME MONITORING

Track transaction status with detailed logs and notifications.

Ready to build the future of crypto trading?

Join developers building next-generation applications with X402 API and MCP integration