Configure AI provider credentials through the Settings UI. No file editing required.
Credential System: Open Notebook uses encrypted credentials stored in the database. Each credential connects to a provider and allows you to discover, register, and test models.
Open Notebook manages AI provider access through a credential-based system:
- You create a credential for each provider (API key + settings)
- Credentials are encrypted and stored in the database
- You test connections to verify credentials work
- You discover and register models from each credential
- Models are linked to credentials for direct configuration
Before storing credentials, you must configure an encryption key.
Add OPEN_NOTEBOOK_ENCRYPTION_KEY to your docker-compose.yml:
environment:
- OPEN_NOTEBOOK_ENCRYPTION_KEY=my-secret-passphraseAny string works as a key — it will be securely derived via SHA-256 internally.
Warning: If you change or lose the encryption key, all stored credentials become unreadable. Back up your encryption key securely and separately from your database backups.
Both password and encryption key support Docker secrets:
# docker-compose.yml
services:
open_notebook:
environment:
- OPEN_NOTEBOOK_PASSWORD_FILE=/run/secrets/app_password
- OPEN_NOTEBOOK_ENCRYPTION_KEY_FILE=/run/secrets/encryption_key
secrets:
- app_password
- encryption_key
secrets:
app_password:
file: ./secrets/password.txt
encryption_key:
file: ./secrets/encryption_key.txtAPI keys stored in the database are encrypted using Fernet (AES-128-CBC + HMAC-SHA256).
| Configuration | Behavior |
|---|---|
| Encryption key set | Keys encrypted with your key |
| No encryption key set | Storing credentials is disabled |
- Click Settings in the navigation bar
- Select API Keys tab
- You'll see existing credentials and an Add Credential button
Navigation: Settings → API Keys
| Provider | Required Fields | Optional Fields |
|---|---|---|
| OpenAI | API Key | — |
| Anthropic | API Key | — |
| Google Gemini | API Key | — |
| Groq | API Key | — |
| Mistral | API Key | — |
| DeepSeek | API Key | — |
| xAI | API Key | — |
| OpenRouter | API Key | — |
| Voyage AI | API Key | — |
| ElevenLabs | API Key | — |
| Provider | Required Fields | Notes |
|---|---|---|
| Ollama | Base URL | Typically http://localhost:11434 or http://ollama:11434 |
| Provider | Required Fields | Optional Fields |
|---|---|---|
| Azure OpenAI | API Key, URL Base (Azure endpoint) | Service-specific endpoints (LLM, Embedding, STT, TTS) |
| OpenAI-Compatible | Base URL | API Key, Service-specific configs |
| Vertex AI | Project ID, Location, Credentials Path | — |
- Go to Settings → API Keys
- Click Add Credential
- Select your provider
- Give it a descriptive name (e.g., "My OpenAI Key", "Work Anthropic")
- Fill in the required fields (API key, base URL, etc.)
- Click Save
- On your new credential card, click Test Connection
- Wait for the result:
| Result | Meaning |
|---|---|
| Success | Key is valid, provider accessible |
| Invalid API key | Check key format and value |
| Connection failed | Check URL, network, firewall |
- Click Discover Models on the credential card
- The system queries the provider for available models
- Review the discovered models
- Select the models you want to use
- Click Register Models
- The models are now available throughout Open Notebook
Each provider can have multiple credentials. This is useful when:
- You have different API keys for different projects
- You want to test with different endpoints
- Multiple team members need separate credentials
- Click Add Credential again
- Select the same provider
- Fill in different credentials
- Each credential can discover and register its own models
When you register models from a credential, those models are linked to that specific credential. This means:
- Each model knows which API key to use
- You can have models from different credentials for the same provider
- Deleting a credential removes its linked models
Click Test Connection to verify your credential:
| Result | Meaning |
|---|---|
| Success | Key is valid, provider accessible |
| Invalid API key | Check key format and value |
| Connection failed | Check URL, network, firewall |
| Model not available | Key valid but model access restricted |
Test uses inexpensive models (e.g., gpt-3.5-turbo, claude-3-haiku) to minimize cost.
For OpenAI, Anthropic, Google, Groq, Mistral, DeepSeek, xAI, OpenRouter:
- Add credential with your API key
- Test connection
- Discover and register models
- Add credential with provider Ollama
- Enter the base URL (e.g.,
http://ollama:11434) - Test connection
- Discover and register models
Ollama allows localhost and private IPs since it runs locally.
- Add credential with provider Azure OpenAI
- Enter your API key
- Enter your Azure endpoint in the URL Base field (e.g.,
https://myresource.openai.azure.com) - Test connection
- Discover and register models
The URL Base field is automatically mapped to the Azure endpoint. The API version defaults to 2024-10-21 if not set via environment variable.
For custom OpenAI-compatible servers (LM Studio, vLLM, etc.):
- Add credential with provider OpenAI-Compatible
- Enter the base URL
- Enter API key (if required)
- Optionally configure per-service URLs
Supports separate configurations for:
- LLM (language models)
- Embedding
- STT (speech-to-text)
- TTS (text-to-speech)
Google Cloud's enterprise AI platform:
| Field | Example |
|---|---|
| Project ID | my-gcp-project |
| Location | us-central1 |
| Credentials Path | /path/to/service-account.json |
If you have existing API keys in environment variables (from a previous version):
- Open Settings → API Keys
- A banner appears: "Environment variables detected"
- Click Migrate to Database
- Keys are copied to the database (encrypted)
- Original environment variables remain unchanged
| Scenario | Action |
|---|---|
| Key in env only | Migrated to database |
| Key in database only | No change |
| Key in both | Database version kept (skipped) |
- Database credentials are used for all operations
- You can remove the API key environment variables from your docker-compose.yml
- Keep
OPEN_NOTEBOOK_ENCRYPTION_KEY— it's still required
The migration banner only appears when:
- You have environment variables configured
- Those providers are not already in the database
- If all env providers are already migrated, the banner won't show
If you're upgrading from an older version that used the ProviderConfig system:
- The migration happens automatically on first startup
- Your existing configurations are converted to credentials
- Check Settings → API Keys to verify the migration succeeded
- If you see issues, check the API logs for migration messages
API keys stored in the database are encrypted using Fernet (AES-128-CBC + HMAC-SHA256).
| Configuration | Behavior |
|---|---|
| Encryption key set | Keys encrypted with your key |
| No encryption key set | Storing API keys in database is disabled |
| Setting | Default Value | Production Recommendation |
|---|---|---|
| Password | open-notebook-change-me |
Set OPEN_NOTEBOOK_PASSWORD |
| Encryption Key | None (must be set) | Set OPEN_NOTEBOOK_ENCRYPTION_KEY to any secret string |
For production deployments, always set custom credentials.
- Click the Delete button on the credential card
- Confirm deletion
- Credential and all its linked models are removed from the database
| Symptom | Cause | Solution |
|---|---|---|
| Save button disabled | Empty or invalid input | Enter a valid key |
| Error on save | Encryption key not set | Set OPEN_NOTEBOOK_ENCRYPTION_KEY in docker-compose.yml |
| Error on save | Database connection issue | Check database status |
| Error | Cause | Solution |
|---|---|---|
| Invalid API key | Wrong key or format | Verify key from provider dashboard |
| Connection refused | Wrong URL | Check base URL format |
| Timeout | Network issue | Check firewall, proxy settings |
| 403 Forbidden | IP restriction | Whitelist your server IP |
| Problem | Solution |
|---|---|
| No migration banner | No env vars detected, or already migrated |
| Partial migration | Check error list, fix and retry |
| Keys not working after migration | Clear browser cache, restart services |
- Check if a credential exists for this provider (Settings → API Keys)
- Test the credential connection
- Verify key format matches provider requirements
- Re-discover and register models if needed
- Keys start with
sk-proj-(project keys) orsk-(legacy) - Requires billing enabled on account
- Keys start with
sk-ant- - Check account has API access enabled
- Keys start with
AIzaSy - Free tier has rate limits
- No API key required
- Default URL:
http://localhost:11434(local) orhttp://ollama:11434(Docker) - Ensure Ollama server is running
- Enter your Azure endpoint in the URL Base field (format:
https://{resource-name}.openai.azure.com) - API version defaults to
2024-10-21; override viaAZURE_OPENAI_API_VERSIONenvironment variable if needed - Deployment names configured separately when registering models via the credential's Discover Models dialog
- AI Providers — Provider setup instructions and recommendations
- Security — Password and encryption configuration
- Environment Reference — All configuration options