跳到主要内容
本文尚未翻译

本文暂时显示英文原文,中文翻译正在进行中。翻译完成后将自动更新。

原文链接:English Version

Environment Variables Reference

All variables go in ~/.hermes/.env. You can also set them with hermes config set VAR value.

LLM Providers

VariableDescription
OPENROUTER_API_KEYOpenRouter API key (recommended for flexibility)
OPENROUTER_BASE_URLOverride the OpenRouter-compatible base URL
AI_GATEWAY_API_KEYVercel AI Gateway API key (ai-gateway.vercel.sh)
AI_GATEWAY_BASE_URLOverride AI Gateway base URL (default: https://ai-gateway.vercel.sh/v1)
OPENAI_API_KEYAPI key for custom OpenAI-compatible endpoints (used with OPENAI_BASE_URL)
OPENAI_BASE_URLBase URL for custom endpoint (VLLM, SGLang, etc.)
COPILOT_GITHUB_TOKENGitHub token for Copilot API — first priority (OAuth gho_* or fine-grained PAT github_pat_*; classic PATs ghp_* are not supported)
GH_TOKENGitHub token — second priority for Copilot (also used by gh CLI)
GITHUB_TOKENGitHub token — third priority for Copilot
HERMES_COPILOT_ACP_COMMANDOverride Copilot ACP CLI binary path (default: copilot)
COPILOT_CLI_PATHAlias for HERMES_COPILOT_ACP_COMMAND
HERMES_COPILOT_ACP_ARGSOverride Copilot ACP arguments (default: --acp --stdio)
COPILOT_ACP_BASE_URLOverride Copilot ACP base URL
GLM_API_KEYz.ai / ZhipuAI GLM API key (z.ai)
ZAI_API_KEYAlias for GLM_API_KEY
Z_AI_API_KEYAlias for GLM_API_KEY
GLM_BASE_URLOverride z.ai base URL (default: https://api.z.ai/api/paas/v4)
KIMI_API_KEYKimi / Moonshot AI API key (moonshot.ai)
KIMI_BASE_URLOverride Kimi base URL (default: https://api.moonshot.ai/v1)
MINIMAX_API_KEYMiniMax API key — global endpoint (minimax.io)
MINIMAX_BASE_URLOverride MiniMax base URL (default: https://api.minimax.io/v1)
MINIMAX_CN_API_KEYMiniMax API key — China endpoint (minimaxi.com)
MINIMAX_CN_BASE_URLOverride MiniMax China base URL (default: https://api.minimaxi.com/v1)
KILOCODE_API_KEYKilo Code API key (kilo.ai)
KILOCODE_BASE_URLOverride Kilo Code base URL (default: https://api.kilo.ai/api/gateway)
HF_TOKENHugging Face token for Inference Providers (huggingface.co/settings/tokens)
HF_BASE_URLOverride Hugging Face base URL (default: https://router.huggingface.co/v1)
GOOGLE_API_KEYGoogle AI Studio API key (aistudio.google.com/app/apikey)
GEMINI_API_KEYAlias for GOOGLE_API_KEY
GEMINI_BASE_URLOverride Google AI Studio base URL
ANTHROPIC_API_KEYAnthropic Console API key (console.anthropic.com)
ANTHROPIC_TOKENManual or legacy Anthropic OAuth/setup-token override
DASHSCOPE_API_KEYAlibaba Cloud DashScope API key for Qwen models (modelstudio.console.alibabacloud.com)
DASHSCOPE_BASE_URLCustom DashScope base URL (default: https://coding-intl.dashscope.aliyuncs.com/v1)
DEEPSEEK_API_KEYDeepSeek API key for direct DeepSeek access (platform.deepseek.com)
DEEPSEEK_BASE_URLCustom DeepSeek API base URL
OPENCODE_ZEN_API_KEYOpenCode Zen API key — pay-as-you-go access to curated models (opencode.ai)
OPENCODE_ZEN_BASE_URLOverride OpenCode Zen base URL
OPENCODE_GO_API_KEYOpenCode Go API key — $10/month subscription for open models (opencode.ai)
OPENCODE_GO_BASE_URLOverride OpenCode Go base URL
CLAUDE_CODE_OAUTH_TOKENExplicit Claude Code token override if you export one manually
HERMES_MODELPreferred model name (checked before LLM_MODEL, used by gateway)
LLM_MODELDefault model name (fallback when not set in config.yaml)
VOICE_TOOLS_OPENAI_KEYPreferred OpenAI key for OpenAI speech-to-text and text-to-speech providers
HERMES_LOCAL_STT_COMMANDOptional local speech-to-text command template. Supports {input_path}, {output_dir}, {language}, and {model} placeholders
HERMES_LOCAL_STT_LANGUAGEDefault language passed to HERMES_LOCAL_STT_COMMAND or auto-detected local whisper CLI fallback (default: en)
HERMES_HOMEOverride Hermes config directory (default: ~/.hermes). Also scopes the gateway PID file and systemd service name, so multiple installations can run concurrently

Provider Auth (OAuth)

For native Anthropic auth, Hermes prefers Claude Code's own credential files when they exist because those credentials can refresh automatically. Environment variables such as ANTHROPIC_TOKEN remain useful as manual overrides, but they are no longer the preferred path for Claude Pro/Max login.

VariableDescription
HERMES_INFERENCE_PROVIDEROverride provider selection: auto, openrouter, nous, openai-codex, copilot, copilot-acp, anthropic, huggingface, zai, kimi-coding, minimax, minimax-cn, kilocode, alibaba, deepseek, opencode-zen, opencode-go, ai-gateway (default: auto)
HERMES_PORTAL_BASE_URLOverride Nous Portal URL (for development/testing)
NOUS_INFERENCE_BASE_URLOverride Nous inference API URL
HERMES_NOUS_MIN_KEY_TTL_SECONDSMin agent key TTL before re-mint (default: 1800 = 30min)
HERMES_NOUS_TIMEOUT_SECONDSHTTP timeout for Nous credential / token flows
HERMES_DUMP_REQUESTSDump API request payloads to log files (true/false)
HERMES_PREFILL_MESSAGES_FILEPath to a JSON file of ephemeral prefill messages injected at API-call time
HERMES_TIMEZONEIANA timezone override (for example America/New_York)

Tool APIs

VariableDescription
PARALLEL_API_KEYAI-native web search (parallel.ai)
FIRECRAWL_API_KEYWeb scraping and cloud browser (firecrawl.dev)
FIRECRAWL_API_URLCustom Firecrawl API endpoint for self-hosted instances (optional)
TAVILY_API_KEYTavily API key for AI-native web search, extract, and crawl (app.tavily.com)
EXA_API_KEYExa API key for AI-native web search and contents (exa.ai)
BROWSERBASE_API_KEYBrowser automation (browserbase.com)
BROWSERBASE_PROJECT_IDBrowserbase project ID
BROWSER_USE_API_KEYBrowser Use cloud browser API key (browser-use.com)
FIRECRAWL_BROWSER_TTLFirecrawl browser session TTL in seconds (default: 300)
BROWSER_CDP_URLChrome DevTools Protocol URL for local browser (set via /browser connect, e.g. ws://localhost:9222)
CAMOFOX_URLCamofox local anti-detection browser URL (default: http://localhost:9377)
BROWSER_INACTIVITY_TIMEOUTBrowser session inactivity timeout in seconds
FAL_KEYImage generation (fal.ai)
GROQ_API_KEYGroq Whisper STT API key (groq.com)
ELEVENLABS_API_KEYElevenLabs premium TTS voices (elevenlabs.io)
STT_GROQ_MODELOverride the Groq STT model (default: whisper-large-v3-turbo)
GROQ_BASE_URLOverride the Groq OpenAI-compatible STT endpoint
STT_OPENAI_MODELOverride the OpenAI STT model (default: whisper-1)
STT_OPENAI_BASE_URLOverride the OpenAI-compatible STT endpoint
GITHUB_TOKENGitHub token for Skills Hub (higher API rate limits, skill publish)
HONCHO_API_KEYCross-session user modeling (honcho.dev)
HONCHO_BASE_URLBase URL for self-hosted Honcho instances (default: Honcho cloud). No API key required for local instances
SUPERMEMORY_API_KEYSemantic long-term memory with profile recall and session ingest (supermemory.ai)
TINKER_API_KEYRL training (tinker-console.thinkingmachines.ai)
WANDB_API_KEYRL training metrics (wandb.ai)
DAYTONA_API_KEYDaytona cloud sandboxes (daytona.io)

Terminal Backend

VariableDescription
TERMINAL_ENVBackend: local, docker, ssh, singularity, modal, daytona
TERMINAL_DOCKER_IMAGEDocker image (default: nikolaik/python-nodejs:python3.11-nodejs20)
TERMINAL_DOCKER_FORWARD_ENVJSON array of env var names to explicitly forward into Docker terminal sessions. Note: skill-declared required_environment_variables are forwarded automatically — you only need this for vars not declared by any skill.
TERMINAL_DOCKER_VOLUMESAdditional Docker volume mounts (comma-separated host:container pairs)
TERMINAL_DOCKER_MOUNT_CWD_TO_WORKSPACEAdvanced opt-in: mount the launch cwd into Docker /workspace (true/false, default: false)
TERMINAL_SINGULARITY_IMAGESingularity image or .sif path
TERMINAL_MODAL_IMAGEModal container image
TERMINAL_DAYTONA_IMAGEDaytona sandbox image
TERMINAL_TIMEOUTCommand timeout in seconds
TERMINAL_LIFETIME_SECONDSMax lifetime for terminal sessions in seconds
TERMINAL_CWDWorking directory for all terminal sessions
SUDO_PASSWORDEnable sudo without interactive prompt

For cloud sandbox backends, persistence is filesystem-oriented. TERMINAL_LIFETIME_SECONDS controls when Hermes cleans up an idle terminal session, and later resumes may recreate the sandbox rather than keep the same live processes running.

SSH Backend

VariableDescription
TERMINAL_SSH_HOSTRemote server hostname
TERMINAL_SSH_USERSSH username
TERMINAL_SSH_PORTSSH port (default: 22)
TERMINAL_SSH_KEYPath to private key
TERMINAL_SSH_PERSISTENTOverride persistent shell for SSH (default: follows TERMINAL_PERSISTENT_SHELL)

Container Resources (Docker, Singularity, Modal, Daytona)

VariableDescription
TERMINAL_CONTAINER_CPUCPU cores (default: 1)
TERMINAL_CONTAINER_MEMORYMemory in MB (default: 5120)
TERMINAL_CONTAINER_DISKDisk in MB (default: 51200)
TERMINAL_CONTAINER_PERSISTENTPersist container filesystem across sessions (default: true)
TERMINAL_SANDBOX_DIRHost directory for workspaces and overlays (default: ~/.hermes/sandboxes/)

Persistent Shell

VariableDescription
TERMINAL_PERSISTENT_SHELLEnable persistent shell for non-local backends (default: true). Also settable via terminal.persistent_shell in config.yaml
TERMINAL_LOCAL_PERSISTENTEnable persistent shell for local backend (default: false)
TERMINAL_SSH_PERSISTENTOverride persistent shell for SSH backend (default: follows TERMINAL_PERSISTENT_SHELL)

Messaging

VariableDescription
TELEGRAM_BOT_TOKENTelegram bot token (from @BotFather)
TELEGRAM_ALLOWED_USERSComma-separated user IDs allowed to use the bot
TELEGRAM_HOME_CHANNELDefault Telegram chat/channel for cron delivery
TELEGRAM_HOME_CHANNEL_NAMEDisplay name for the Telegram home channel
TELEGRAM_WEBHOOK_URLPublic HTTPS URL for webhook mode (enables webhook instead of polling)
TELEGRAM_WEBHOOK_PORTLocal listen port for webhook server (default: 8443)
TELEGRAM_WEBHOOK_SECRETSecret token for verifying updates come from Telegram
TELEGRAM_REACTIONSEnable emoji reactions on messages during processing (default: false)
DISCORD_BOT_TOKENDiscord bot token
DISCORD_ALLOWED_USERSComma-separated Discord user IDs allowed to use the bot
DISCORD_HOME_CHANNELDefault Discord channel for cron delivery
DISCORD_HOME_CHANNEL_NAMEDisplay name for the Discord home channel
DISCORD_REQUIRE_MENTIONRequire an @mention before responding in server channels
DISCORD_FREE_RESPONSE_CHANNELSComma-separated channel IDs where mention is not required
DISCORD_AUTO_THREADAuto-thread long replies when supported
DISCORD_REACTIONSEnable emoji reactions on messages during processing (default: true)
DISCORD_IGNORED_CHANNELSComma-separated channel IDs where the bot never responds
DISCORD_NO_THREAD_CHANNELSComma-separated channel IDs where bot responds without auto-threading
SLACK_BOT_TOKENSlack bot token (xoxb-...)
SLACK_APP_TOKENSlack app-level token (xapp-..., required for Socket Mode)
SLACK_ALLOWED_USERSComma-separated Slack user IDs
SLACK_HOME_CHANNELDefault Slack channel for cron delivery
SLACK_HOME_CHANNEL_NAMEDisplay name for the Slack home channel
WHATSAPP_ENABLEDEnable the WhatsApp bridge (true/false)
WHATSAPP_MODEbot (separate number) or self-chat (message yourself)
WHATSAPP_ALLOWED_USERSComma-separated phone numbers (with country code, no +), or * to allow all senders
WHATSAPP_ALLOW_ALL_USERSAllow all WhatsApp senders without an allowlist (true/false)
WHATSAPP_DEBUGLog raw message events in the bridge for troubleshooting (true/false)
SIGNAL_HTTP_URLsignal-cli daemon HTTP endpoint (for example http://127.0.0.1:8080)
SIGNAL_ACCOUNTBot phone number in E.164 format
SIGNAL_ALLOWED_USERSComma-separated E.164 phone numbers or UUIDs
SIGNAL_GROUP_ALLOWED_USERSComma-separated group IDs, or * for all groups
SIGNAL_HOME_CHANNEL_NAMEDisplay name for the Signal home channel
SIGNAL_IGNORE_STORIESIgnore Signal stories/status updates
SIGNAL_ALLOW_ALL_USERSAllow all Signal users without an allowlist
TWILIO_ACCOUNT_SIDTwilio Account SID (shared with telephony skill)
TWILIO_AUTH_TOKENTwilio Auth Token (shared with telephony skill)
TWILIO_PHONE_NUMBERTwilio phone number in E.164 format (shared with telephony skill)
SMS_WEBHOOK_PORTWebhook listener port for inbound SMS (default: 8080)
SMS_ALLOWED_USERSComma-separated E.164 phone numbers allowed to chat
SMS_ALLOW_ALL_USERSAllow all SMS senders without an allowlist
SMS_HOME_CHANNELPhone number for cron job / notification delivery
SMS_HOME_CHANNEL_NAMEDisplay name for the SMS home channel
EMAIL_ADDRESSEmail address for the Email gateway adapter
EMAIL_PASSWORDPassword or app password for the email account
EMAIL_IMAP_HOSTIMAP hostname for the email adapter
EMAIL_IMAP_PORTIMAP port
EMAIL_SMTP_HOSTSMTP hostname for the email adapter
EMAIL_SMTP_PORTSMTP port
EMAIL_ALLOWED_USERSComma-separated email addresses allowed to message the bot
EMAIL_HOME_ADDRESSDefault recipient for proactive email delivery
EMAIL_HOME_ADDRESS_NAMEDisplay name for the email home target
EMAIL_POLL_INTERVALEmail polling interval in seconds
EMAIL_ALLOW_ALL_USERSAllow all inbound email senders
DINGTALK_CLIENT_IDDingTalk bot AppKey from developer portal (open.dingtalk.com)
DINGTALK_CLIENT_SECRETDingTalk bot AppSecret from developer portal
DINGTALK_ALLOWED_USERSComma-separated DingTalk user IDs allowed to message the bot
FEISHU_APP_IDFeishu/Lark bot App ID from open.feishu.cn
FEISHU_APP_SECRETFeishu/Lark bot App Secret
FEISHU_DOMAINfeishu (China) or lark (international). Default: feishu
FEISHU_CONNECTION_MODEwebsocket (recommended) or webhook. Default: websocket
FEISHU_ENCRYPT_KEYOptional encryption key for webhook mode
FEISHU_VERIFICATION_TOKENOptional verification token for webhook mode
FEISHU_ALLOWED_USERSComma-separated Feishu user IDs allowed to message the bot
FEISHU_HOME_CHANNELFeishu chat ID for cron delivery and notifications
WECOM_BOT_IDWeCom AI Bot ID from admin console
WECOM_SECRETWeCom AI Bot secret
WECOM_WEBSOCKET_URLCustom WebSocket URL (default: wss://openws.work.weixin.qq.com)
WECOM_ALLOWED_USERSComma-separated WeCom user IDs allowed to message the bot
WECOM_HOME_CHANNELWeCom chat ID for cron delivery and notifications
MATTERMOST_URLMattermost server URL (e.g. https://mm.example.com)
MATTERMOST_TOKENBot token or personal access token for Mattermost
MATTERMOST_ALLOWED_USERSComma-separated Mattermost user IDs allowed to message the bot
MATTERMOST_HOME_CHANNELChannel ID for proactive message delivery (cron, notifications)
MATTERMOST_REQUIRE_MENTIONRequire @mention in channels (default: true). Set to false to respond to all messages.
MATTERMOST_FREE_RESPONSE_CHANNELSComma-separated channel IDs where bot responds without @mention
MATTERMOST_REPLY_MODEReply style: thread (threaded replies) or off (flat messages, default)
MATRIX_HOMESERVERMatrix homeserver URL (e.g. https://matrix.org)
MATRIX_ACCESS_TOKENMatrix access token for bot authentication
MATRIX_USER_IDMatrix user ID (e.g. @hermes:matrix.org) — required for password login, optional with access token
MATRIX_PASSWORDMatrix password (alternative to access token)
MATRIX_ALLOWED_USERSComma-separated Matrix user IDs allowed to message the bot (e.g. @alice:matrix.org)
MATRIX_HOME_ROOMRoom ID for proactive message delivery (e.g. !abc123:matrix.org)
MATRIX_ENCRYPTIONEnable end-to-end encryption (true/false, default: false)
MATRIX_REQUIRE_MENTIONRequire @mention in rooms (default: true). Set to false to respond to all messages.
MATRIX_FREE_RESPONSE_ROOMSComma-separated room IDs where bot responds without @mention
MATRIX_AUTO_THREADAuto-create threads for room messages (default: true)
HASS_TOKENHome Assistant Long-Lived Access Token (enables HA platform + tools)
HASS_URLHome Assistant URL (default: http://homeassistant.local:8123)
WEBHOOK_ENABLEDEnable the webhook platform adapter (true/false)
WEBHOOK_PORTHTTP server port for receiving webhooks (default: 8644)
WEBHOOK_SECRETGlobal HMAC secret for webhook signature validation (used as fallback when routes don't specify their own)
API_SERVER_ENABLEDEnable the OpenAI-compatible API server (true/false). Runs alongside other platforms.
API_SERVER_KEYBearer token for API server authentication. Strongly recommended; required for any network-accessible deployment.
API_SERVER_CORS_ORIGINSComma-separated browser origins allowed to call the API server directly (for example http://localhost:3000,http://127.0.0.1:3000). Default: disabled.
API_SERVER_PORTPort for the API server (default: 8642)
API_SERVER_HOSTHost/bind address for the API server (default: 127.0.0.1). Use 0.0.0.0 for network access only with API_SERVER_KEY and a narrow API_SERVER_CORS_ORIGINS allowlist.
MESSAGING_CWDWorking directory for terminal commands in messaging mode (default: ~)
GATEWAY_ALLOWED_USERSComma-separated user IDs allowed across all platforms
GATEWAY_ALLOW_ALL_USERSAllow all users without allowlists (true/false, default: false)

Agent Behavior

VariableDescription
HERMES_MAX_ITERATIONSMax tool-calling iterations per conversation (default: 90)
HERMES_TOOL_PROGRESSDeprecated compatibility variable for tool progress display. Prefer display.tool_progress in config.yaml.
HERMES_TOOL_PROGRESS_MODEDeprecated compatibility variable for tool progress mode. Prefer display.tool_progress in config.yaml.
HERMES_HUMAN_DELAY_MODEResponse pacing: off/natural/custom
HERMES_HUMAN_DELAY_MIN_MSCustom delay range minimum (ms)
HERMES_HUMAN_DELAY_MAX_MSCustom delay range maximum (ms)
HERMES_QUIETSuppress non-essential output (true/false)
HERMES_API_TIMEOUTLLM API call timeout in seconds (default: 1800)
HERMES_EXEC_ASKEnable execution approval prompts in gateway mode (true/false)
HERMES_ENABLE_PROJECT_PLUGINSEnable auto-discovery of repo-local plugins from ./.hermes/plugins/ (true/false, default: false)
HERMES_BACKGROUND_NOTIFICATIONSBackground process notification mode in gateway: all (default), result, error, off
HERMES_EPHEMERAL_SYSTEM_PROMPTEphemeral system prompt injected at API-call time (never persisted to sessions)

Session Settings

VariableDescription
SESSION_IDLE_MINUTESReset sessions after N minutes of inactivity (default: 1440)
SESSION_RESET_HOURDaily reset hour in 24h format (default: 4 = 4am)

Context Compression (config.yaml only)

Context compression is configured exclusively through the compression section in config.yaml — there are no environment variables for it.

compression:
enabled: true
threshold: 0.50
summary_model: "" # empty = use main configured model
summary_provider: auto
summary_base_url: null # Custom OpenAI-compatible endpoint for summaries

Auxiliary Task Overrides

VariableDescription
AUXILIARY_VISION_PROVIDEROverride provider for vision tasks
AUXILIARY_VISION_MODELOverride model for vision tasks
AUXILIARY_VISION_BASE_URLDirect OpenAI-compatible endpoint for vision tasks
AUXILIARY_VISION_API_KEYAPI key paired with AUXILIARY_VISION_BASE_URL
AUXILIARY_WEB_EXTRACT_PROVIDEROverride provider for web extraction/summarization
AUXILIARY_WEB_EXTRACT_MODELOverride model for web extraction/summarization
AUXILIARY_WEB_EXTRACT_BASE_URLDirect OpenAI-compatible endpoint for web extraction/summarization
AUXILIARY_WEB_EXTRACT_API_KEYAPI key paired with AUXILIARY_WEB_EXTRACT_BASE_URL

For task-specific direct endpoints, Hermes uses the task's configured API key or OPENAI_API_KEY. It does not reuse OPENROUTER_API_KEY for those custom endpoints.

Fallback Model (config.yaml only)

The primary model fallback is configured exclusively through config.yaml — there are no environment variables for it. Add a fallback_model section with provider and model keys to enable automatic failover when your main model encounters errors.

fallback_model:
provider: openrouter
model: anthropic/claude-sonnet-4

See Fallback Providers for full details.

Provider Routing (config.yaml only)

These go in ~/.hermes/config.yaml under the provider_routing section:

KeyDescription
sortSort providers: "price" (default), "throughput", or "latency"
onlyList of provider slugs to allow (e.g., ["anthropic", "google"])
ignoreList of provider slugs to skip
orderList of provider slugs to try in order
require_parametersOnly use providers supporting all request params (true/false)
data_collection"allow" (default) or "deny" to exclude data-storing providers
提示

Use hermes config set to set environment variables — it automatically saves them to the right file (.env for secrets, config.yaml for everything else).