Guide
Hermes Agent BYOK: Bring Your Own API Key
BYOK means “bring your own key” — you supply the API key for your chosen AI provider, and Hermes Agent routes every inference call through your account. You pay your provider directly, with no markup, no rate-limit on top of theirs, and full visibility in your provider's dashboard.
Why BYOK?
- No markup. Pay raw provider pricing — usually 10–30% cheaper than bundled inference at scale.
- Direct billing. Receipts come from your provider, not from Hermes hosting.
- Higher rate limits. If you already have a Tier 4 OpenAI account or a custom Anthropic agreement, you keep those limits.
- Existing relationships. Use enterprise agreements, committed-use discounts, or free-tier credits you already have.
- Data residency. Your provider, your data-handling agreement.
- One key, many models. A single OpenRouter or LiteLLM key unlocks 200+ models across all providers.
Supported BYOK Providers
| Provider | Env Var | Where to Get Key |
|---|---|---|
| OpenAI (GPT-5.5, etc.) | OPENAI_API_KEY | platform.openai.com/api-keys |
| Anthropic (Claude) | ANTHROPIC_API_KEY | console.anthropic.com/settings/keys |
| Google AI Studio (Gemini) | GOOGLE_API_KEY | aistudio.google.com/apikey |
| OpenRouter (200+ models) | OPENROUTER_API_KEY | openrouter.ai/keys |
| Mistral AI | MISTRAL_API_KEY | console.mistral.ai/api-keys |
| DeepSeek | DEEPSEEK_API_KEY | platform.deepseek.com |
| xAI (Grok) | XAI_API_KEY | console.x.ai |
| Groq | GROQ_API_KEY | console.groq.com/keys |
| Together AI | TOGETHER_API_KEY | api.together.ai/settings/api-keys |
| Cerebras | CEREBRAS_API_KEY | cloud.cerebras.ai |
| Z.ai (GLM) | ZAI_API_KEY | open.bigmodel.cn |
| Alibaba DashScope (Qwen) | DASHSCOPE_API_KEY | dashscope.aliyun.com |
Hermes also accepts OAuth credentials for some providers — including Claude (CLAUDE_CODE_OAUTH_TOKEN) and Codex (device-flow). These let you use a paid Claude Code or ChatGPT Plus subscription as the inference source instead of an API key.
BYOK on OpenClaw Launch (Managed)
- Go to openclawlaunch.com/hermes-hosting.
- In the configurator, toggle BYOK.
- Pick a provider (OpenAI, Anthropic, Google, OpenRouter, Mistral, DeepSeek, xAI, Groq, Together, Cerebras, Z.ai, or DashScope).
- Paste your API key. It's encrypted at rest with your account's master key.
- Pick a model and deploy. 100% of inference flows through your provider account.
BYOK on Self-Hosted Hermes
On your own server, BYOK is just environment variables. Pick the provider you want and export its key:
# Pick one or more — Hermes routes by inference.provider
export OPENAI_API_KEY=sk-proj-...
export ANTHROPIC_API_KEY=sk-ant-...
export GOOGLE_API_KEY=AIza...
export OPENROUTER_API_KEY=sk-or-...
# Tell Hermes which one to use as default
hermes inference set anthropic
hermes model set claude-sonnet-4.6
# Or via /opt/data/config.yaml:
# inference:
# provider: anthropic
# model:
# default: claude-sonnet-4.6You can keep multiple keys exported and switch providers at runtime with hermes inference set <provider> — useful when one provider has an outage or rate-limit issue.
One Key, Many Models: OpenRouter or LiteLLM
If you don't want to manage a dozen keys, OpenRouter gives you one key for 200+ models. Switch between Claude, GPT, Gemini, DeepSeek, Llama, and dozens more via Hermes's /model command without touching env vars.
export OPENROUTER_API_KEY=sk-or-...
hermes inference set openrouter
/model anthropic/claude-sonnet-4.6
/model openai/gpt-5.5
/model google/gemini-2.5-pro
/model meta-llama/llama-4-maverickFor enterprise BYOK with custom routing rules, point Hermes at a self-hosted LiteLLM proxy. Hermes treats it as an OpenAI-compatible endpoint, and LiteLLM handles the routing, caching, and fallback logic.
Cost Math: When Does BYOK Save Money?
For low-volume use, the bundled AI credits on OpenClaw Launch are usually cheaper than BYOK once you account for provider minimum spend, pre-paid credit fees, and the operational overhead of managing keys. BYOK starts winning around 500–1,000 messages per day, where the unmarked-up inference cost more than offsets the credits the plan includes.
Heavy users (10K+ messages/day) typically save 20–40% on inference with BYOK vs bundled. For coding agents on Claude Sonnet, the savings can be much larger if you use a Claude Code subscription via CLAUDE_CODE_OAUTH_TOKEN.
Security
On OpenClaw Launch, BYOK keys are encrypted with your account's wrapped master key — the same envelope that protects all your saved configs. Keys are decrypted only inside your container, never in the orchestrator. On self-hosted Hermes, keys live in your /opt/data/config.yaml or environment; secure that file as you would any other credential.
What's Next?
- Hermes + Claude — BYOK setup for Anthropic
- Hermes + OpenAI — BYOK setup for OpenAI
- Hermes + OpenRouter — One key for 200+ models
- Hermes + MCP — Add tools your BYOK agent can use