Overview
Sovran integrates with Routstr to provide direct access to leading AI models through a pay-per-use model. Chat with GPT-4, Claude, Gemini, and other models by paying with satoshis from your wallet.Routstr charges per message in sats based on token usage. Typical costs range from less than 1 sat to several sats per message depending on the model and message length.
Available Models
Sovran supports multiple AI providers through Routstr:OpenAI
GPT-4, GPT-3.5 Turbo and other OpenAI models
Anthropic
Claude Sonnet, Opus and other Claude models
Gemini Pro, Flash and other Google models
xAI
Grok and other xAI models
DeepSeek
DeepSeek models for code and reasoning
Perplexity
Perplexity models with web search
Features
Multi-Session Support
Manage multiple conversations simultaneously:- Session Management: Create, switch between, and delete conversation sessions
- Persistent History: All messages are saved locally and synced across sessions
- Auto-Titling: Sessions are automatically titled based on your first message
Model Selection
Switch between AI models at any time:- Browse available models organized by provider
- See pricing information (sats per 1M tokens)
- View model capabilities and descriptions
- Filter to text-only models or include multimodal
Wallet Integration
1
Create Wallet
Fund your Routstr wallet by sending a Cashu token
2
Check Balance
View your balance in sats or msats
3
Send Messages
Messages are deducted automatically from your balance
4
Top Up
Add more funds anytime by sending another token
Implementation Details
API Integration
Sovran uses the Routstr API for all AI interactions:Streaming Responses
Messages stream token-by-token for a responsive experience:Model Pricing
Each model includes pricing information in sats:State Management
Conversation state is managed with Zustand and persisted locally:UI Components
Sessions Panel
Slide-out panel for managing conversations:- Animated slide-in from left (300ms duration)
- Gesture-based closing (swipe left to dismiss)
- User profile with avatar and balance
- Current model indicator
- Session list with timestamps
Model Cards
Visual cards showing available AI models:Error Handling
Routstr errors are caught and displayed with user-friendly messages:Best Practices
Model Selection
Model Selection
- Cost vs Quality: More expensive models like GPT-4 provide better responses but cost more sats
- Context Length: Choose models with longer context windows for complex conversations
- Modality: Select text-only models for chat, multimodal for image analysis
Wallet Management
Wallet Management
- Keep Balance: Maintain enough sats for several messages
- Top Up Regularly: Add funds before running out to avoid interruptions
- Monitor Costs: Check pricing before sending long messages
Session Organization
Session Organization
- Topic-Based: Create separate sessions for different topics
- Clean Up: Delete old sessions to keep your list organized
- Descriptive Titles: First message becomes the title, so make it descriptive
Code Reference
Source Files
app/(drawer)/(tabs)/explore/index.tsx:17-444- Model browsing and selection UIcomponents/blocks/routstr/SessionsPanel.tsx:1-512- Session management panelstores/routstrStore.ts:1-341- State management and persistencehelper/routstr/api.ts:1-422- API client and streaming
Key Functions
getModels()- Fetch available AI modelssendMessage()- Send chat message with streamingcreateWalletFromToken()- Create Routstr wallet from Cashu tokencheckBalance()- Check current wallet balancetopUpBalance()- Add funds to wallet