Overview
ScryCLI requires an API key to communicate with AI model providers. The API key is stored securely in your local configuration file and is used to authenticate requests to the selected provider.ScryCLI currently uses OpenRouter as its model provider, which supports multiple AI providers through a unified API.
Setting Your API Key
Using the CLI Command
The easiest way to configure your API key is through the interactive CLI:The
/apikey command currently routes to model selection. The API key must be set manually in the configuration file.Manual Configuration
You can manually add your API key to the configuration file:Obtaining API Keys
OpenRouter API Key
ScryCLI uses OpenRouter to access multiple AI providers:Visit OpenRouter
Go to OpenRouter
OpenRouter provides access to many free models with rate limits. Some premium models require credits.
Configuration Structure
The API key is stored in themodel object of your configuration:
Required Fields
| Field | Description | Example |
|---|---|---|
modelProvider | The AI provider name | "openai", "qwen", "mistral" |
modelName | Full model identifier | "openai/gpt-oss-120b:free" |
modelKey | Your API key | "sk-or-v1-..." |
Validation
ScryCLI validates your API key configuration before allowing model interactions:modelName and modelKey must be present and non-empty.
Security Best Practices
Recommended Permissions
Set restrictive permissions on your config file:What NOT to Do
- Don’t commit
config.jsonto version control - Don’t share your API key in public forums
- Don’t use production API keys for testing
- Don’t store API keys in environment variables that might be logged
Troubleshooting
”Model not selected” Error
If you see this error, check:-
API key is set
-
Model name is configured
- Both fields are non-empty strings
Invalid API Key
If your requests fail with authentication errors:Usage in Code
The API key is used when making model calls:The current implementation has the API key hardcoded. You may need to update the code to use
getConfig().model.modelKey for proper functionality.Next Steps
Model Configuration
Learn about available models and selection
Configuration Setup
Understand the full configuration system
