Guide
Hermes Agent + OpenAI: Use GPT Models with Hermes
Hermes Agent can run on OpenAI's GPT family — GPT-5.5, GPT-5.4-mini, and others. On managed OpenClaw Launch, GPT models route through OpenRouter automatically. For self-hosted setups, OpenRouter is also the recommended path because Hermes's native OpenAI integration uses an OAuth device flow designed for Codex subscribers rather than a plain API key.
What Is OpenAI?
OpenAI builds the GPT family of large language models, including GPT-4o, GPT-5.4-mini, and GPT-5.5. GPT models are known for strong coding, broad general knowledge, and reliable tool-calling — qualities that make them effective for agentic workloads. GPT-5.5 is the current flagship model as of 2026.
Available GPT Models in Hermes
| Model ID | Best For | Via OpenRouter |
|---|---|---|
openai/gpt-5.5 | Latest flagship — strongest reasoning and tool use | Yes |
openai/gpt-5.4-mini | Fast, cost-efficient — best GPT mini model | Yes |
How OpenAI Authentication Works in Hermes Upstream
The upstream Hermes Agent source code (github.com/NousResearch/hermes-agent) uses an OpenAI Codex OAuth device flow for OpenAI authentication, not a plain OPENAI_API_KEY environment variable. The device flow is designed for users who have a Codex subscription and want to authenticate via the OpenAI website rather than managing a raw API key.
This matters for self-hosted deployments: if you don't have a Codex subscription or don't want to go through the OAuth flow, the simplest path to using GPT with Hermes is through OpenRouter (see below).
Option 1: Hermes Agent on OpenClaw Launch (Easiest)
On OpenClaw Launch, GPT models are available in the model picker and route through OpenRouter automatically. No OAuth flow, no API key setup.
- Go to openclawlaunch.com/hermes-hosting and start a Hermes deploy.
- Select GPT-5.5 or GPT-5.4-mini from the model dropdown.
- Connect your channel and click Deploy. Your GPT-powered Hermes Agent is live in roughly 10 seconds.
Option 2: GPT via OpenRouter (Self-Hosted, Recommended)
For self-hosted Hermes, the recommended path to GPT models is through OpenRouter. OpenRouter exposes GPT models under openai/gpt-* model IDs via its standard API, meaning you just need a single OPENROUTER_API_KEY:
export OPENROUTER_API_KEY=sk-or-...
hermes inference set openrouter
hermes model set openai/gpt-5.5
# config.yaml equivalent:
# inference:
# provider: openrouter
# model:
# default: openai/gpt-5.5Get your OpenRouter key from openrouter.ai/keys. OpenRouter bills you in one place for all upstream provider costs.
Option 3: OpenAI Codex OAuth (Self-Hosted, Upstream Flow)
If you have an OpenAI Codex subscription and want to authenticate through the upstream OAuth device flow, Hermes Agent supports it natively. Run the Hermes CLI authentication command and follow the device-code prompts that open the OpenAI website. The token is stored in the Hermes data directory and reused for subsequent requests.
Consult the upstream Hermes README for the exact CLI command, as the auth flow details depend on the version you've installed.
GPT Models vs Claude for Hermes Agent Tasks
| Capability | GPT-5.5 | Claude Sonnet 4.6 |
|---|---|---|
| Coding and debugging | Excellent | Excellent |
| Tool calling reliability | Excellent | Excellent |
| Long-context tasks | 128K context | 200K context |
| Writing quality | Strong | Excellent |
| Cost per million tokens | Higher (~$5-10/M) | Moderate (~$3/M) |
GPT-5.5 is a strong choice for coding-heavy agent workflows and users already familiar with OpenAI's ecosystem. For most general agent use cases, Claude Sonnet 4.6 offers a similar capability level at lower cost.
Switching to GPT at Runtime
From any connected Hermes channel, use the /model command to switch to a GPT model without restarting:
/model openai/gpt-5.5
/model openai/gpt-5.4-miniWhat's Next?
- Hermes Agent + GPT-5.5 — Deep dive into GPT-5.5 capabilities with Hermes
- Hermes Agent + OpenRouter — One key for GPT, Claude, Gemini, and 200+ models
- Hermes Agent + Claude — Compare GPT with Claude for Hermes agent workflows
- Hermes Agent + MCP — Extend your GPT-powered Hermes with MCP servers