Bug Description
When Hermes is configured to use a custom OpenAI-compatible endpoint through OPENAI_BASE_URL, chat completions can be sent to /chat/completions instead of /v1/chat/completions.
This breaks OpenAI-compatible providers like xAI when the base URL is configured as https://api.x.ai and the client is expected to hit https://api.x.ai/v1/chat/completions.
In our integration, Hermes produced requests equivalent to:
But the working endpoint was:
- POST /v1/chat/completions
Steps to Reproduce
- Set OPENAI_BASE_URL to a custom OpenAI-compatible endpoint that expects /v1 paths.
Example: https://api.x.ai
- Set OPENAI_API_KEY to a valid key for that endpoint.
- Run Hermes in non-interactive mode:
hermes chat -q "Reply with exactly TEST_OK" -Q
- Observe the upstream request path or provider response.
Expected Behavior
Hermes should send chat completions to the provider's OpenAI-compatible /v1 path, e.g.:
https://api.x.ai/v1/chat/completions
Actual Behavior
Hermes sent requests equivalent to:
https://api.x.ai/chat/completions
That returned a 404 from the upstream provider.
A direct request to https://api.x.ai/v1/chat/completions with the same key and model succeeded.
Affected Component
Configuration (config.yaml, .env, hermes setup)
Messaging Platform (if gateway-related)
No response
Operating System
macOS 15.4.1
Python Version
3.11.8
Hermes Version
v0.6.0 (v2026.3.30)
Relevant Logs / Traceback
Observed request path from adapter logs:
- incoming_path=/primary/chat/completions
- upstream_url=https://api.x.ai/chat/completions
Direct successful comparison:
- https://api.x.ai/v1/chat/completions
Root Cause Analysis (optional)
It appears Hermes's OpenAI-compatible client path construction assumes the base URL already includes /v1 for chat completions. In our environment, other successful calls worked when /v1 was included explicitly in the forwarded upstream path.
Proposed Fix (optional)
When using a custom OpenAI-compatible base URL, Hermes should normalize chat completion requests consistently so that providers expecting /v1/chat/completions work correctly.
Are you willing to submit a PR for this?
Bug Description
When Hermes is configured to use a custom OpenAI-compatible endpoint through OPENAI_BASE_URL, chat completions can be sent to /chat/completions instead of /v1/chat/completions.
This breaks OpenAI-compatible providers like xAI when the base URL is configured as https://api.x.ai and the client is expected to hit https://api.x.ai/v1/chat/completions.
In our integration, Hermes produced requests equivalent to:
But the working endpoint was:
Steps to Reproduce
Example: https://api.x.ai
hermes chat -q "Reply with exactly TEST_OK" -Q
Expected Behavior
Hermes should send chat completions to the provider's OpenAI-compatible /v1 path, e.g.:
https://api.x.ai/v1/chat/completions
Actual Behavior
Hermes sent requests equivalent to:
https://api.x.ai/chat/completions
That returned a 404 from the upstream provider.
A direct request to https://api.x.ai/v1/chat/completions with the same key and model succeeded.
Affected Component
Configuration (config.yaml, .env, hermes setup)
Messaging Platform (if gateway-related)
No response
Operating System
macOS 15.4.1
Python Version
3.11.8
Hermes Version
v0.6.0 (v2026.3.30)
Relevant Logs / Traceback
Root Cause Analysis (optional)
It appears Hermes's OpenAI-compatible client path construction assumes the base URL already includes /v1 for chat completions. In our environment, other successful calls worked when /v1 was included explicitly in the forwarded upstream path.
Proposed Fix (optional)
When using a custom OpenAI-compatible base URL, Hermes should normalize chat completion requests consistently so that providers expecting /v1/chat/completions work correctly.
Are you willing to submit a PR for this?