← Home

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

ProviderEnv VarWhere to Get Key
OpenAI (GPT-5.5, etc.)OPENAI_API_KEYplatform.openai.com/api-keys
Anthropic (Claude)ANTHROPIC_API_KEYconsole.anthropic.com/settings/keys
Google AI Studio (Gemini)GOOGLE_API_KEYaistudio.google.com/apikey
OpenRouter (200+ models)OPENROUTER_API_KEYopenrouter.ai/keys
Mistral AIMISTRAL_API_KEYconsole.mistral.ai/api-keys
DeepSeekDEEPSEEK_API_KEYplatform.deepseek.com
xAI (Grok)XAI_API_KEYconsole.x.ai
GroqGROQ_API_KEYconsole.groq.com/keys
Together AITOGETHER_API_KEYapi.together.ai/settings/api-keys
CerebrasCEREBRAS_API_KEYcloud.cerebras.ai
Z.ai (GLM)ZAI_API_KEYopen.bigmodel.cn
Alibaba DashScope (Qwen)DASHSCOPE_API_KEYdashscope.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)

  1. Go to openclawlaunch.com/hermes-hosting.
  2. In the configurator, toggle BYOK.
  3. Pick a provider (OpenAI, Anthropic, Google, OpenRouter, Mistral, DeepSeek, xAI, Groq, Together, Cerebras, Z.ai, or DashScope).
  4. Paste your API key. It's encrypted at rest with your account's master key.
  5. Pick a model and deploy. 100% of inference flows through your provider account.
Tip: managed Hermes still includes things bundled inference doesn't affect — container hosting, browser sidecar, persistent memory, channel plugins, the gateway. BYOK only changes who pays for tokens.

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.6

You 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-maverick

For 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?

Deploy Hermes with Your Own Key

Set up a Hermes agent with BYOK in under 30 seconds — no markup, no rate-limit, your key, your bill.

Deploy Hermes