-
-
Notifications
You must be signed in to change notification settings - Fork 1
API Key Configuration
RenzMc edited this page Sep 6, 2025
·
1 revision
This guide explains how to configure API keys for different AI providers supported by the Acode AI CLI Assistant Plugin.
The plugin uses advanced encryption to protect your API keys:
- AES-GCM Encryption: Provides both confidentiality and integrity
- PBKDF2 Key Derivation: Processes your passphrase with 100,000 iterations
- Random IVs: Each encryption uses a unique initialization vector
- Local Storage: All keys are stored locally on your device
- Obtain an API key from OpenAI Platform
- In the plugin, select "OpenAI" as your provider
- Enter your API key when prompted
- Select from available models (GPT-4, GPT-3.5 Turbo, etc.)
- Get an API key from Google AI Studio
- Select "Google" as your provider in the plugin
- Enter your Gemini API key
- Choose from available Gemini models
- Install Ollama on your device:
curl https://ollama.ai/install.sh | sh - Pull a model (e.g., CodeLlama):
ollama pull codellama
- Select "Ollama" as your provider
- Use the default endpoint or configure a custom one
- Sign up at Groq Cloud
- Create an API key in your account settings
- Select "Groq" as your provider in the plugin
- Enter your API key and choose a model
- Sign up at Anthropic Console
- Generate an API key
- Select "Anthropic" as your provider
- Enter your API key and select a Claude model
- Sign up at OpenRouter
- Generate an API key
- Select "OpenRouter" as your provider
- Enter your API key and choose from available models
- Obtain an API key from Alibaba Cloud
- Select "Qwen" as your provider
- Enter your API key
- Choose from Qwen models (Turbo, Plus, Max)
- Prepare your API endpoint URL
- Obtain an API key from your service provider
- Select "OpenAI-Like" as your provider
- Enter:
- API Key
- API Base URL
- Model name
- Open the AI assistant
- Click the menu icon (three dots) in the header
- Select "Provider" to change provider
- Choose your new provider
- Enter the API key when prompted
- Open the AI assistant
- Click the menu icon in the header
- Select "Provider" to change provider
- Choose the same provider you're currently using
- Enter your new API key when prompted
- Open the AI assistant
- Click the menu icon in the header
- The current provider and model will be displayed
API keys are stored in Acode's local storage and can be removed by:
- Changing to a different provider
- Or clearing Acode's app data (which will remove all plugin data)
The plugin provides visual feedback on API connectivity:
- Green Indicator: API is connected and functioning
- Yellow Indicator: API is processing a request
- Red Indicator: API connection error or rate limit exceeded
The plugin tracks your token usage:
- Total Tokens: All tokens used since installation
- Today's Tokens: Tokens used in the current day
- Session Tokens: Tokens used in the current session
You can view this information in the plugin header.
- When you enter an API key, it's encrypted with AES-GCM
- Your passphrase is used with PBKDF2 to derive the encryption key
- A random initialization vector is generated for each encryption
- The encrypted key and IV are stored in local storage
- Your passphrase is never stored
- You must enter it each time you want to change API keys
- If you forget your passphrase, you'll need to reconfigure all API keys
You can easily switch between AI providers:
- Open the AI assistant
- Click the menu icon in the header
- Select "Provider"
- Choose from the available providers
- Enter API key if required for the new provider
- Select a model for the new provider
- Error message: "Invalid API key"
- Solution: Verify your API key is correct and active
- Check that you're using the right key for the selected provider
- Error message: "Rate limit exceeded"
- Solution: Wait before making more requests
- Consider upgrading your API plan if available
- Error message: "Connection failed"
- Solution:
- Check your internet connection
- Verify the API endpoint is accessible
- Check that your API key has the required permissions
- Error message: "Model not available"
- Solution:
- Check that the model name is correct
- Verify the model is available in your account
- Try selecting a different model
To verify your API key is working:
- Open the AI assistant
- Send a simple query
- Check for proper response
- If errors occur, verify your key on the provider's platform
If you encounter issues with API key configuration:
- Check the Common Issues documentation
- Visit our GitHub Issues page
- Join our Discussions community for support
- Home
- Getting Started
- Usage Guides
- Advanced Features
- Developer Docs
- Troubleshooting