PhoneClaw uses OpenRouter to access various AI models for natural language processing, code generation, and automation tasks. This guide explains how to configure and switch between models.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rohanarun/phoneclaw/llms.txt
Use this file to discover all available pages before exploring further.
Available Models
PhoneClaw comes with two pre-configured models that you can select from within the app:Gemini 2.0 Flash
- Model ID:
google/gemini-2.0-flash-001 - Provider: Google
- Best For: Fast response times, general-purpose tasks
- Cost: Paid (via OpenRouter)
Llama 4 Maverick (Free)
- Model ID:
meta-llama/llama-4-maverick:free - Provider: Meta
- Best For: Cost-effective automation, experimentation
- Cost: Free tier available
Selecting a Model in the App
You can change the AI model directly from the PhoneClaw interface:- Launch PhoneClaw on your Android device
- Look for the “Model:” button in the main interface
- Tap the button to open the model selection dialog
- Select your preferred model from the list
- The app will confirm your selection with voice feedback
Your model selection is saved automatically and persists across app restarts.
Model Configuration Details
The model selection is implemented inMainActivity.kt:1229-1284:
Storage Location
The selected model is stored in SharedPreferences:- Key:
openrouter_model - Storage:
AgentsBasePrefspreference file - Default:
google/gemini-2.0-flash-001
Adding Custom Models
To add additional OpenRouter models, you can modify the source code:- Open
app/src/main/java/com/example/universal/MainActivity.kt - Locate the
getOpenRouterModelOptions()function (around line 1229) - Add new models to the list:
- Rebuild and reinstall the app
OpenRouter API Integration
PhoneClaw communicates with OpenRouter’s API to generate code and responses. The integration includes:- HTTP Client: OkHttp (configured in dependencies)
- Request Timeout: 30 seconds for connection and read operations
- Content Type: JSON (
application/json)
API Request Flow
- User provides voice command or text input
- PhoneClaw captures current screen context
- Request is sent to OpenRouter with selected model
- Generated code/response is executed or displayed
- Results are tracked in generation history
Model Performance Considerations
Response Time
- Gemini 2.0 Flash: Optimized for speed (~1-3 seconds)
- Llama 4 Maverick: May be slower but cost-effective
Token Limits
Be aware of token limits when sending large screen captures or complex prompts. OpenRouter enforces per-model token limits.Rate Limiting
OpenRouter may rate-limit requests based on your account tier. Implement appropriate delays between automation tasks.Troubleshooting
Model Not Responding
- Check your OpenRouter API key is valid
- Verify you have sufficient API credits
- Ensure your device has internet connectivity
- Check the logs for API error messages
Model Selection Not Saving
- Ensure the app has storage permissions
- Check that SharedPreferences is initialized correctly
- Try clearing app data and reconfiguring
Using Free Models
The Llama 4 Maverick free model is great for testing but may have usage limits. Monitor your OpenRouter dashboard for quota information.
Generation History
PhoneClaw tracks all model-generated code in the Generation History tab:- View past commands and generated code
- Timestamp for each generation
- Unique ID for tracking
- Stored locally in SharedPreferences
Best Practices
- Start with Free Models: Test your automation workflows with free models before committing to paid options
- Monitor Usage: Keep track of your OpenRouter usage and costs
- Match Model to Task: Use faster models for simple tasks, more powerful models for complex automation
- Test Generation Quality: Compare different models to find the best balance of speed, cost, and accuracy