Time to set up Yuki like a pro. This guide covers wallet configuration, spending limits, RPC endpoints, and advanced settings to get the most out of your autonomous payment agent.
π― Configuration Overview
What you'll configure:
Environment variables and API keys
Wallet connections and RPC endpoints
Spending limits for safety
AI model settings
Advanced payment options
Time required: 10-15 minutes
π Environment Variables
All configuration happens in .env.local. This file is gitignored for securityβnever commit API keys!
Create Your Config File
cp.env.example.env.local
Required Variables
Open .env.local and configure these required settings:
Pro tip: NO quotes around values. NO spaces before/after =.
Optional Variables
π RPC Endpoint Configuration
Your RPC endpoint determines which blockchain network Yuki uses and how fast transactions process.
# OpenRouter API Key (REQUIRED)
# Get yours at: https://openrouter.ai/
OPENROUTER_API_KEY=sk-or-v1-your_actual_key_here
# Solana RPC Endpoint (REQUIRED)
# Use devnet for testing, mainnet for production
NEXT_PUBLIC_SOLANA_RPC_ENDPOINT=https://api.mainnet-beta.solana.com
# Custom Yuki System Prompt (OPTIONAL)
# Override the default AI behavior
YUKI_SYSTEM_PROMPT="Custom instructions for Yuki..."
# Additional chain RPC endpoints (OPTIONAL)
NEXT_PUBLIC_ETHEREUM_RPC=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
NEXT_PUBLIC_POLYGON_RPC=https://polygon-mainnet.g.alchemy.com/v2/YOUR_KEY
# Conservative (Testing)
Daily: 0.01 SOL (~$2.50)
Weekly: 0.05 SOL (~$12.50)
Monthly: 0.2 SOL (~$50)
# Moderate (Regular Use)
Daily: 0.1 SOL (~$25)
Weekly: 0.5 SOL (~$125)
Monthly: 2 SOL (~$500)
# Aggressive (Power Users)
Daily: 1 SOL (~$250)
Weekly: 5 SOL (~$1,250)
Monthly: 20 SOL (~$5,000)
Your Request β Yuki Checks Limits β Within Limits? β Process Payment
β Exceeded? β Reject & Notify You
# Example spending limit configuration
DAILY_SPENDING_LIMIT=0.01
WEEKLY_SPENDING_LIMIT=0.05
MONTHLY_SPENDING_LIMIT=0.2
// Configured in app/api/chat/route.js
model: google('gemini-2.0-flash-exp')
YUKI_SYSTEM_PROMPT="You are Yuki402, focused on enterprise use cases.
Prioritize security and detailed transaction reporting.
Always request explicit confirmation before payments over 0.1 SOL."
// In app/api/chat/route.js
temperature: 0.7, // 0.0 = deterministic, 1.0 = creative
maxTokens: 4000, // Maximum response length
β DO:
- Use hardware wallets for large amounts
- Enable wallet password/biometric lock
- Keep seed phrase offline (paper, steel)
- Use dedicated wallet for AI payments
- Regular security audits
β DON'T:
- Store seed phrase digitally
- Share screen with seed phrase visible
- Use same wallet for everything
- Keep large amounts in hot wallets
- Reuse passwords across wallets
// In app/app/page.js
const COOLDOWN_SECONDS = 50; // Default
// Adjust to 30-60 seconds based on your needs
// In app/api/chat/route.js
export const maxDuration = 50; // seconds
// Prioritize chains by cost
chainPriority: ['solana', 'polygon', 'ethereum']
// Or by speed
chainPriority: ['solana', 'ethereum', 'polygon']
// Or by reliability
chainPriority: ['ethereum', 'solana', 'polygon']
# Verify all env vars are loaded
npm run dev
# Check console output for:
# β OpenRouter API key loaded
# β Solana RPC connected
# β Configuration validated
# Test Solana RPC
curl https://api.mainnet-beta.solana.com -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc":"2.0",
"id":1,
"method":"getHealth"
}
'
# Should return: {"jsonrpc":"2.0","result":"ok","id":1}