Moondream Authentication
PhoneClaw uses the Moondream API for visual AI capabilities, including screen element detection and image analysis.Getting Your Moondream Auth Token
- Sign up for a Moondream API account at Moondream
- Navigate to your API dashboard
- Copy your authentication token
Setting Up MOONDREAM_AUTH
You need to add your Moondream authentication token to your project’s Gradle properties.The
MOONDREAM_AUTH token is required for PhoneClaw’s visual AI features to work. Without it, screen element detection will fail.Option 1: Using local.properties (Recommended)
Create or editlocal.properties in your project root:
Option 2: Using gradle.properties
Alternatively, add it togradle.properties:
How It Works
TheMOONDREAM_AUTH token is loaded during the build process in app/build.gradle.kts:20-23:
BuildConfig.MOONDREAM_AUTH.
OpenRouter API Key
PhoneClaw uses OpenRouter for AI model access. While the model selection is configurable in the app, you may need an OpenRouter API key for premium models.Setting Up OpenRouter
- Create an account at OpenRouter
- Generate an API key from your dashboard
- Configure it in your environment or directly in the app
Some models like “Llama 4 Maverick (Free)” don’t require payment, but you still need an OpenRouter account.
Firebase Configuration (Optional)
Firebase is optional but provides cloud features like remote debugging and device management. Firebase can be configured following the Android Studio Firebase setup wizard.Verifying Your Configuration
After setting up your API keys:-
Clean and rebuild your project:
- Check the build output for any configuration warnings
- Launch the app - it should initialize without authentication errors
Troubleshooting
Build Errors Related to MOONDREAM_AUTH
If you see build errors about missingMOONDREAM_AUTH:
- Verify the property is set in
local.propertiesorgradle.properties - Ensure there are no extra spaces or quotes around the token
- Try a clean rebuild:
./gradlew clean build
Token Not Working
- Verify your Moondream token is still valid
- Check that the token was copied correctly without any trailing whitespace
- Ensure your Moondream account has sufficient API credits
Security Best Practices
- Use
local.propertiesfor sensitive credentials - Rotate your API keys periodically
- Never share your authentication tokens
- Consider using environment variables in CI/CD pipelines