apps/opik-documentation/documentation/fern/docs/tracing/integrations/hermes.mdx
The Hermes agent can send trace data to Opik through the community plugin package opik-hermes, maintained at comet-ml/opik-hermes.
This integration captures:
Hermes turn), grouped into Opik threads by Hermes session_id.type=llm) per API call, with input messages, assistant output, model/provider, token usage, and USD cost.type=tool) per tool call, with arguments and results.```bash
pip install opik-hermes
```
**Opik Cloud:**
```bash
# ~/.hermes/.env
OPIK_URL_OVERRIDE=https://www.comet.com/opik/api
OPIK_API_KEY=your-api-key-here
OPIK_WORKSPACE=default
OPIK_PROJECT_NAME=hermes
```
**Self-hosted / local (open-source Opik) — no API key required:**
```bash
# ~/.hermes/.env
OPIK_URL_OVERRIDE=http://localhost:5173/api
OPIK_WORKSPACE=default
OPIK_PROJECT_NAME=hermes
```
<Tip>
With no config at all, the SDK defaults to Opik Cloud and, without an API key, logs a repeated `API key must be specified` warning and sends nothing. The plugin still fails open (its hooks never crash Hermes) — so for any non-Cloud target, set `OPIK_URL_OVERRIDE` so traces are routed correctly.
</Tip>
As an interactive alternative for local setup, run the Opik SDK's CLI, which writes `~/.opik.config`:
```bash
opik configure
```
`observability/opik` should show as `enabled`.
You can also open the Hermes web UI at `http://localhost:9119` and use the Chat tab.
Set these in ~/.hermes/.env to adjust plugin behavior:
HERMES_OPIK_TAGS=production,team-x # extra tags applied to every trace
HERMES_OPIK_MAX_CHARS=12000 # max chars per field (default: 12000)
HERMES_OPIK_DEBUG=true # verbose plugin logging
For the full configuration reference, see the opik-hermes repository.
For OTEL-native pipelines, see OpenTelemetry integration.