← Home

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 IDBest ForVia OpenRouter
openai/gpt-5.5Latest flagship — strongest reasoning and tool useYes
openai/gpt-5.4-miniFast, cost-efficient — best GPT mini modelYes

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.

  1. Go to openclawlaunch.com/hermes-hosting and start a Hermes deploy.
  2. Select GPT-5.5 or GPT-5.4-mini from the model dropdown.
  3. Connect your channel and click Deploy. Your GPT-powered Hermes Agent is live in roughly 10 seconds.
Tip: AI credits are included in every Hermes plan on OpenClaw Launch — GPT requests are covered without a separate OpenAI account.

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

Get 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

CapabilityGPT-5.5Claude Sonnet 4.6
Coding and debuggingExcellentExcellent
Tool calling reliabilityExcellentExcellent
Long-context tasks128K context200K context
Writing qualityStrongExcellent
Cost per million tokensHigher (~$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-mini

What's Next?

Deploy Hermes with GPT Models

Get a GPT-powered Hermes Agent running in 10 seconds on OpenClaw Launch.

Deploy Hermes