Skip to main content

Bulk API Key Import

Wunderland supports importing multiple API keys at once by pasting a .env block during setup. This is useful when migrating from another project or setting up a new machine quickly.

Using wunderland setup

During the interactive setup wizard, you will be prompted with the option to paste a .env block:

wunderland setup

When you reach the API key configuration step, select "Paste .env block" instead of entering keys one by one. The wizard accepts standard .env format:

OPENAI_API_KEY=sk-proj-abc123...
ANTHROPIC_API_KEY=sk-ant-abc123...
SERPER_API_KEY=abc123...
TELEGRAM_BOT_TOKEN=1234567890:ABCdef...

The CLI will:

  1. Parse all recognized key-value pairs
  2. Validate the format of each key (prefix checks where applicable)
  3. Display a summary showing which keys were detected
  4. Store them securely at ~/.wunderland/.env
tip

Lines starting with # are treated as comments and ignored. Blank lines are also skipped. Both KEY=value and KEY="value" formats are supported.

Supported Keys

Wunderland recognizes the following 22 environment variable keys from its extension secrets registry:

LLM Providers

Environment VariableDescriptionRequired
OPENAI_API_KEYOpenAI API key (GPT-4o family)Yes (if using OpenAI)
OPENROUTER_API_KEYOpenRouter API key (multi-provider fan-out)Yes (if using OpenRouter)
ANTHROPIC_API_KEYAnthropic API key (Claude models)Optional

Search & Media

Environment VariableDescriptionRequired
SERPER_API_KEYSerper.dev API key (Google-like search)Optional
SERPAPI_API_KEYSerpAPI key (web search)Optional
BRAVE_API_KEYBrave Search API keyOptional
NEWSAPI_API_KEYNewsAPI key (news search)Optional
GIPHY_API_KEYGiphy API key (GIF search)Optional
PEXELS_API_KEYPexels API key (stock photos)Optional
UNSPLASH_ACCESS_KEYUnsplash access key (stock photos)Optional
PIXABAY_API_KEYPixabay API key (stock images/video)Optional

Voice & TTS

Environment VariableDescriptionRequired
ELEVENLABS_API_KEYElevenLabs API key (voice synthesis)Optional

Messaging Channels

Environment VariableDescriptionRequired
TELEGRAM_BOT_TOKENTelegram bot token from @BotFatherOptional
DISCORD_BOT_TOKENDiscord bot tokenOptional
SLACK_BOT_TOKENSlack bot OAuth token (xoxb-*)Optional
SLACK_APP_TOKENSlack app-level token (xapp-*) for Socket ModeOptional
SLACK_SIGNING_SECRETSlack signing secret for webhook verificationOptional
WHATSAPP_SESSION_DATAWhatsApp Web/Baileys session credentialsOptional
SIGNAL_PHONE_NUMBERSignal phone number for signal-cli bridgeOptional

Google Workspace

Environment VariableDescriptionRequired
GOOGLE_CLIENT_IDGoogle OAuth 2.0 client IDOptional
GOOGLE_CLIENT_SECRETGoogle OAuth 2.0 client secretOptional
GOOGLE_REFRESH_TOKENGoogle OAuth 2.0 refresh tokenOptional
warning

The full list above covers the core extension secrets. Additional platform-specific keys (iMessage, Google Chat, Teams, Matrix, Twilio, Telnyx, Plivo, Zalo, Email/SMTP) are also supported. See the Messaging Channels guide for the complete list of per-platform secrets.

Example .env Block

Here is a complete example showing a typical multi-provider configuration:

~/.wunderland/.env
# ── LLM Providers ──
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# ── Search ──
SERPER_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BRAVE_API_KEY=BSAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# ── Media ──
GIPHY_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxx
ELEVENLABS_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# ── Messaging ──
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrSTUvwxYZ
DISCORD_BOT_TOKEN=your-discord-bot-token-here

# ── Google Workspace ──
GOOGLE_CLIENT_ID=123456789-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxx
GOOGLE_REFRESH_TOKEN=1//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

How Keys Are Stored

All imported keys are written to ~/.wunderland/.env with restricted file permissions:

  • Location: ~/.wunderland/.env
  • Permissions: 0o600 (owner read/write only)
  • Format: Standard .env (one KEY=value per line)
# Verify permissions
ls -la ~/.wunderland/.env
# -rw------- 1 user user 1234 Jan 15 10:30 ~/.wunderland/.env
warning

Never commit your ~/.wunderland/.env file to version control. The .wunderland directory is in your home folder specifically to keep it outside any project repository.

Updating Keys After Setup

You can re-run the import at any time:

# Re-run setup to update keys
wunderland setup

# Or edit the file directly
nano ~/.wunderland/.env

When re-running setup, existing keys are preserved. New keys are added, and updated keys overwrite the previous values. Keys that are not included in the new paste are left unchanged.

Smart Config Widget (Workspace)

The Smart Config widget in the Wunderland app provides an AI-powered alternative to manual key entry. Instead of configuring credentials one by one, paste your entire .env block and let GPT-4o automatically identify and map each key.

How It Works

  1. Paste or upload your .env file, JSON config, or any block of API keys
  2. AI identification — GPT-4o analyzes key names and value patterns (prefixes + length) to identify each credential type
  3. Preview — Review the proposed mappings with confidence scores before applying
  4. Apply — Saves credentials, enables matching extensions, and sets the suggested LLM provider

Supported Formats

The widget parser accepts multiple formats:

# Standard .env
OPENAI_API_KEY=sk-proj-abc123...
TELEGRAM_BOT_TOKEN=1234567890:ABCdef...

# With export prefix
export SERPER_API_KEY=abc123...

# JSON objects
{"openaiKey": "sk-proj-...", "telegramBot": "123:ABC..."}

# YAML-style
GIPHY_API_KEY: abcdef1234567890

Security

Your secret values never leave the browser. Only key names and value hints (first 4 characters + length) are sent to the mapping API. Actual secret values are sent directly from the client to the credential vault.

DataSent to AISent to Vault
Key name (e.g., OPENAI_API_KEY)YesNo
Value hint (e.g., sk-p... (len: 51))YesNo
Actual secret valueNoYes

Opening the Widget

  • Workspace: Click the + button → select "Smart Config" from the Tools category
  • Quick Actions: Click "Import Keys" in the Quick Actions widget
tip

Keys that are already saved as credentials for the selected agent are automatically detected and marked as "EXISTS" in the preview. They're unchecked by default to prevent duplicates.

Programmatic Import

If you need to import keys from a script or CI pipeline:

# Copy an existing .env file
cp /path/to/my-keys.env ~/.wunderland/.env
chmod 600 ~/.wunderland/.env

Then verify with:

wunderland doctor

The doctor command checks that all configured providers have valid credentials and reports any missing or malformed keys.