Hermes Agent can use Grok by way of an provide SuperGrok subscription, or by way of an X Most sensible magnificence+ subscription associated with the X account you take a look at in with. That means you don’t wish to create an XAI_API_KEY merely to try xAI models inside of Hermes.
You log in once by way of a browser-based OAuth flow, Hermes saves the tokens in the community, and longer term classes refresh robotically throughout the background.

That’s the simple type. The nicer segment is that the identical login moreover covers Hermes’ direct xAI media tools, along side text-to-speech, image era, video era, and transcription. The identical xAI credentials can also allow X search if you wish to have that device available.
Must you already pay for SuperGrok or X Most sensible magnificence+, this is a cleaner way to connect Hermes to Grok without juggling API keys. For those who’re however working out where Hermes fits, this OpenClaw vs Hermes Agent comparison is a useful vital different.
What Hermes Is Actually The use of
The provider is referred to as xAI Grok OAuth (SuperGrok / X Most sensible magnificence+) inside of Hermes. Its provider ID is:
xai-oauth
Underneath the hood, Hermes connects to xAI’s Responses-style API endpoint at:
https://api.x.ai/v1
Hermes reuses its codex_responses supply for this provider, so choices akin to reasoning, device calling, streaming, and prompt caching artwork with no need a separate Grok-specific adapter.
The default genre is just lately:
grok-4.3
Hermes pins that genre just about the perfect of the picker after you log in.
What You Need First
Previous to setting this up, you wish to have:
- Python 3.9 or more moderen
- Hermes Agent installed
- An full of life SuperGrok subscription, or an X Most sensible magnificence+ subscription on the X account you utilize for login
- A browser on the identical system, or SSH port forwarding if you’re setting it up on server
The very important part: this provider does not use XAI_API_KEY. If you want to use your Grok subscription instead of API billing, use the OAuth provider.
There’s one caveat value working out early. Hermes’ clinical medical doctors apply that xAI would in all probability restrict OAuth API get admission to via tier. If the browser login works alternatively inference returns HTTP 403, it’s possible you’ll want to switch to the API-key provider instead.
Sign In At some stage in the Sort Picker
The easiest setup path is through Hermes’ genre picker:
hermes genre
Make a selection xAI Grok OAuth (SuperGrok / X Most sensible magnificence+) from the provider tick list. Hermes opens accounts.x.ai for your browser, where you take a look at in and approve get admission to. It is a common OAuth-style login waft: you approve get admission to throughout the browser instead of copying a longer secret key into your terminal.
After that, pick a Grok genre. For most of the people, grok-4.3 is the obvious position to start out.
Then get began Hermes normally:
hermes
Hermes stores the login credentials in:
~/.hermes/auth.json
As quickly because the tokens are saved, Hermes refreshes them robotically forward of they expire. You’ll have to not have to replicate the browser login for every session.
Sign In Manually
If you already know you wish to have the xAI OAuth provider, you’ll skip the way picker and get began the auth flow immediately:
hermes auth add xai-oauth
This launches the identical browser login flow. After approval, Hermes saves the OAuth tokens and the provider is in a position to use.
Set Grok as Your Default Sort
You’ll have the ability to switch providers all through the interactive genre picker:
hermes genre
Or set the provider and magnificence immediately:
hermes config set genre.default grok-4.3
hermes config set genre.provider xai-oauth
Your ~/.hermes/config.yaml should then include something like this:
genre:
default: grok-4.3
provider: xai-oauth
base_url: https://api.x.ai/v1
Hermes moreover accepts a few provider aliases whilst you desire something further descriptive:
hermes --provider xai-oauth
hermes --provider grok-oauth
hermes --provider x-ai-oauth
hermes --provider xai-grok-oauth
I’d however use xai-oauth in scripts and documentation. It’s shorter and canonical.
The use of It on a Far off Server
OAuth is quite further disturbing when Hermes is operating on a server, container, or SSH session.
Hermes can print the authorization URL instead of opening a browser:
hermes auth add xai-oauth --no-browser
Then again the callback listener however runs on the far away system at:
127.0.0.1:56121
Must you open the published URL for your computer without forwarding that port, the browser cannot prevail within the callback listener. You’ll generally see a connection error.
Open a 2d terminal for your local system and forward the port first:
ssh -N -L 56121:127.0.0.1:56121 client@remote-host
Then, throughout the SSH session where Hermes is operating:
hermes auth add xai-oauth --no-browser
Open the published URL for your local browser. The login should now redirect once more all through the forwarded port to Hermes on the far away system.
Must you connect by way of a bounce host, add -J jump-user@jump-host to the SSH command.
Browser-Most straightforward Far off Consoles
For those who’re the usage of a browser-based far away console, akin to Cloud Shell, Codespaces, EC2 Instance Connect, Gitpod, or a an equivalent setting, the SSH forwarding recipe may not be available.
If that is so, use information paste mode:
hermes auth add xai-oauth --manual-paste
Or liberate it from the way picker:
hermes genre --manual-paste
Hermes skips the local callback listener and lets you paste the failed callback URL from the browser instead.
Check Whether or not or now not the Login Worked
Run:
hermes doctor
Seek for the Auth Providers phase and check out the status for xai-oauth.
If Hermes has a valid OAuth get entry to, Grok should be available all through the way picker and direct provider selection.
Use the An identical Login for xAI Tools
The OAuth token isn’t limited to speak models. Hermes can reuse the identical xAI login for numerous direct-to-xAI tools:
- Text-to-speech
- Image era
- Video era
- Transcription
- X search
Open the tools picker:
hermes tools
Then choose the xAI backend where sought after:
- Text-to-Speech: xAI TTS
- Image Technology: xAI Grok Imagine (image)
- Video Technology: xAI Grok Imagine
- X Search: xAI Grok OAuth (SuperGrok / X Most sensible magnificence+)
If your OAuth token is already stored, Hermes should uncover it and skip the credential prompt.
A small gotcha: video era is disabled via default, so allow it in hermes tools forward of expecting the agent to call the video device. X search behaves otherwise: Hermes’ clinical medical doctors say it auto-enables when xAI credentials are supply, alternatively you’ll however disable it explicitly throughout the tools picker in case you don’t need it available.
Available Grok Models
The prevailing xAI OAuth setup exposes Grok chat models akin to:
grok-4.3grok-4.20-0309-reasoninggrok-4.20-0309-non-reasoninggrok-4.20-multi-agent-0309
For media tools, Hermes lists xAI alternatives akin to:
grok-imagine-imagegrok-imagine-image-qualitygrok-imagine-video- xAI TTS all through the
/v1/ttsendpoint
The chat genre catalog is pulled from Hermes’ local models.dev cache, so new xAI genre releases can appear after that cache refreshes.
Restore Now not odd OAuth Problems
Most setup problems fall into a few predictable buckets.
Token Expired or Refresh Failed
Hermes refreshes tokens forward of a session and can also retry after a 401 response. If the refresh token was revoked or became round, Hermes will ask you to authenticate yet again.
Run:
hermes auth add xai-oauth
Login Timed Out
The local callback listener best stays open for a limited window. For those who don’t approve the login in brief enough, the flow circumstances out.
Run the login command yet again and approve the browser request all through the window:
hermes auth add xai-oauth
State Mismatch
A state mismatch generally approach the OAuth response didn’t are compatible the request Hermes created. Re-run the login. If it keeps taking place, check out whether or not or now not a proxy, browser extension, or redirect layer is interfering with the callback.
Far off Login Cannot Be successful within the App
That’s the standard SSH setup failure. The browser is for your computer, alternatively the callback listener is on the far away system.
Forward the callback port:
ssh -N -L 56121:127.0.0.1:56121 client@remote-host
Then rerun:
hermes auth add xai-oauth --no-browser
HTTP 403 After a Successful Login
If OAuth login succeeds alternatively inference returns HTTP 403, the problem could also be subscription entitlement reasonably than a stale token. Hermes’ clinical medical doctors say xAI’s backend has been seen to restrict OAuth API get admission to for some tiers.
If that happens, re-running hermes genre isn’t going to fix it. Use the API-key provider instead:
export XAI_API_KEY=xai-...
hermes config set genre.provider xai
Or enhance your Grok subscription if the OAuth path is wanted.
No xAI Credentials Found out
Hermes has no saved xai-oauth get entry to and no XAI_API_KEY set.
If you want to use SuperGrok or X Most sensible magnificence+ OAuth, run:
hermes genre
Make a choice the xAI Grok OAuth provider, or run:
hermes auth add xai-oauth
Log Out When Sought after
To remove saved xAI OAuth credentials:
hermes auth logout xai-oauth
That clears the OAuth get entry to from Hermes’ auth store.
Must you best want to remove one credential get entry to from a pool, tick list the entries first:
hermes auth tick list xai-oauth
Then remove the precise get entry to:
hermes auth remove xai-oauth
Final Thought
The appeal that is convenience. If you already have SuperGrok or X Most sensible magnificence+, Hermes can use that subscription by way of a regular browser login. No API key. No separate setup for every xAI device. No awkward token copying.
For local use, the setup is mainly hermes genre, pick xAI OAuth, approve throughout the browser, and get began chatting. Must you like a GUI spherical Hermes, Hermes Desktop could also be value putting in place too.
For far away machines, bear in mind the callback port: 56121. That one small part saves a large number of head-scratching.
The put up Learn how to Use SuperGrok With Hermes Agent With out an xAI API Key appeared first on Hongkiat.
Supply: https://www.hongkiat.com/blog/hermes-agent-xai-grok-oauth/


0 Comments