Configuration¶
ScoutML requires an API key to access the research paper database. This guide shows you how to configure your API key.
Getting Your API Key¶
- Visit https://scoutml.com/signup
- Create an account or log in
- Navigate to your dashboard
- Copy your API key
Keep Your API Key Secure
Never commit your API key to version control or share it publicly.
Configuration Methods¶
You can configure your API key using any of these methods:
Method 1: Environment Variable¶
Set the environment variable in your shell:
To make it permanent, add the line to your ~/.bashrc
or ~/.zshrc
:
Method 2: .env File¶
Create a .env
file in your working directory:
Git Ignore
Add .env
to your .gitignore
file to prevent accidentally committing your API key:
Method 3: CLI Configuration Command¶
Use the built-in configuration command:
This stores the API key in your user configuration directory:
- Linux/macOS: ~/.config/scoutml/config.json
- Windows: %APPDATA%\scoutml\config.json
Configuration Priority¶
ScoutML checks for API keys in this order:
- Command-line parameter (if supported by the command)
- Environment variable (
SCOUTML_API_KEY
) .env
file in current directory- Configuration file from
scoutml configure
Verifying Configuration¶
To verify your API key is configured correctly:
If configured properly, this should return one search result.
Troubleshooting¶
"API key not found" Error¶
If you see this error, ScoutML couldn't find your API key. Check:
- Spelling: Ensure the environment variable is
SCOUTML_API_KEY
(notSCOUT_ML_API_KEY
) - Shell Session: If you set an environment variable, restart your shell or run
source ~/.bashrc
- File Location: Ensure
.env
is in your current working directory - Quotes: Remove quotes if copying from environment variable
"Invalid API key" Error¶
This means ScoutML found your key but it's not valid:
- Check for extra spaces or characters
- Verify the key on your dashboard
- Ensure you're using the full key
Security Best Practices¶
- Never hardcode API keys in your Python scripts
- Use environment variables for production deployments
- Rotate keys regularly through your dashboard
- Use different keys for development and production
- Monitor usage to detect any unauthorized access
Next Steps¶
Now that you've configured your API key, check out the Quick Start guide to start using ScoutML!