AI Spending Guidelines
This guide provides recommended budget configurations for different AI agent use cases when using the pay_invoice tool.
Quick Reference
| Use Case | Per Request | Per Session | Wallet Balance |
|---|---|---|---|
| Testing/Development | 100 sats | 1,000 sats | 5,000 sats |
| Light Browsing | 50 sats | 500 sats | 2,000 sats |
| Research Sessions | 200 sats | 2,000 sats | 10,000 sats |
| API Integration | 500 sats | 5,000 sats | 20,000 sats |
| Heavy Usage | 1,000 sats | 10,000 sats | 50,000 sats |
Configuration Examples
Minimal (Testing)
For initial testing and learning:
export L402_MAX_SATS_PER_REQUEST=100
export L402_MAX_SATS_PER_SESSION=1000
Wallet funding: 5,000 sats (~$5)
Use for:
- Learning how pay_invoice works
- Testing your MCP configuration
- Paying a few test invoices
Conservative (Light Usage)
For occasional, supervised use:
export L402_MAX_SATS_PER_REQUEST=50
export L402_MAX_SATS_PER_SESSION=500
Wallet funding: 2,000 sats (~$2)
Use for:
- Accessing a few L402-protected resources
- Light browsing of paid content
- One-off API calls
Moderate (Research)
For research sessions with multiple data sources:
export L402_MAX_SATS_PER_REQUEST=200
export L402_MAX_SATS_PER_SESSION=2000
Wallet funding: 10,000 sats (~$10)
Use for:
- Research involving multiple paid APIs
- Gathering data from various sources
- Extended work sessions
Professional (API Integration)
For development and integration work:
export L402_MAX_SATS_PER_REQUEST=500
export L402_MAX_SATS_PER_SESSION=5000
Wallet funding: 20,000 sats (~$20)
Use for:
- Testing API integrations
- Development workflows
- Automated data collection (supervised)
Cost Estimation
Common Operations
| Operation | Typical Cost |
|---|---|
| Single API call | 1-100 sats |
| Premium content access | 10-500 sats |
| AI model API (per request) | 50-200 sats |
| Data feed query | 10-100 sats |
| Image generation | 100-1000 sats |
Session Estimates
| Task Type | Estimated Cost |
|---|---|
| 10-minute research | 100-500 sats |
| 1-hour development session | 500-2,000 sats |
| Day of API testing | 2,000-5,000 sats |
Session Management
Starting a Session
- Check wallet balance before starting
- Review budget limits - are they appropriate?
- Define scope - what will the AI be doing?
- Monitor actively during first few uses
# Check balance before starting
check_wallet_balance
# Verify budget configuration
configure_budget # Shows current limits
During a Session
- Watch for unexpected payment patterns
- If limits are hit, evaluate if more budget is needed
- Consider resetting session if scope changes
# Reset session spending counter
configure_budget resetSession=true
Ending a Session
- Review all payments made
- Check remaining balance
- Note any unexpected charges
# Review what was spent
get_payment_history limit=50
Budget Strategy
Start Low
Begin with minimal limits and increase only as needed:
- Week 1: 100 sats/request, 1,000 sats/session
- Week 2: Evaluate - were limits hit? Why?
- Week 3: Adjust based on actual usage patterns
- Ongoing: Find your comfortable baseline
Per-Request vs Per-Session
Per-request limit protects against:
- Single large accidental payment
- Overpaying for one service
Per-session limit protects against:
- Many small payments adding up
- Extended sessions draining funds
- Runaway loops
When to Increase Limits
Increase limits when:
- You consistently hit limits for legitimate use
- You understand why limits are being reached
- You're comfortable with the higher exposure
Do NOT increase limits:
- Just because limits were hit
- Without understanding what payments were made
- To avoid supervision
Refill Strategy
Recommended Approach
- Keep wallet balance low - Only what you need for near-term use
- Refill frequently in small amounts
- Never exceed what you're willing to lose
- Track refills to understand true spending over time
Example Refill Schedule
| Usage Level | Refill Amount | Frequency |
|---|---|---|
| Light | 5,000 sats | Monthly |
| Moderate | 10,000 sats | Bi-weekly |
| Heavy | 25,000 sats | Weekly |
Troubleshooting Budget Issues
"Exceeds per-request limit"
Your payment request is larger than L402_MAX_SATS_PER_REQUEST.
Options:
- Increase per-request limit if payment is legitimate
- Find alternative service with lower cost
- Skip the payment if not essential
"Would exceed session budget"
You've spent most of your session budget.
Options:
- Reset session:
configure_budget resetSession=true - Increase session budget (with caution)
- End session and review payments
Wallet balance low
Your OpenNode account needs more funds.
Options:
- Add funds via OpenNode dashboard
- Transfer from another Lightning wallet
- Adjust budget limits to match available funds
Related Documentation
- AI Spending Security - Security best practices
- Legal Considerations - Liability and terms
- MCP Configuration - Setting up MCP