Skip to content

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

  1. Visit https://scoutml.com/signup
  2. Create an account or log in
  3. Navigate to your dashboard
  4. 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:

export SCOUTML_API_KEY="your-api-key-here"

To make it permanent, add the line to your ~/.bashrc or ~/.zshrc:

echo 'export SCOUTML_API_KEY="your-api-key-here"' >> ~/.bashrc
$env:SCOUTML_API_KEY="your-api-key-here"

To make it permanent, use the System Properties dialog or:

[System.Environment]::SetEnvironmentVariable('SCOUTML_API_KEY','your-api-key-here','User')

Method 2: .env File

Create a .env file in your working directory:

# .env
SCOUTML_API_KEY=your-api-key-here

Git Ignore

Add .env to your .gitignore file to prevent accidentally committing your API key:

echo ".env" >> .gitignore

Method 3: CLI Configuration Command

Use the built-in configuration command:

scoutml configure --api-key your-api-key-here

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:

  1. Command-line parameter (if supported by the command)
  2. Environment variable (SCOUTML_API_KEY)
  3. .env file in current directory
  4. Configuration file from scoutml configure

Verifying Configuration

To verify your API key is configured correctly:

scoutml search "test" --limit 1

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:

  1. Spelling: Ensure the environment variable is SCOUTML_API_KEY (not SCOUT_ML_API_KEY)
  2. Shell Session: If you set an environment variable, restart your shell or run source ~/.bashrc
  3. File Location: Ensure .env is in your current working directory
  4. Quotes: Remove quotes if copying from environment variable

"Invalid API key" Error

This means ScoutML found your key but it's not valid:

  1. Check for extra spaces or characters
  2. Verify the key on your dashboard
  3. Ensure you're using the full key

Security Best Practices

  1. Never hardcode API keys in your Python scripts
  2. Use environment variables for production deployments
  3. Rotate keys regularly through your dashboard
  4. Use different keys for development and production
  5. 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!