# Hermes Agent

Hermes Agent uses the OpenAI-compatible `chat/completions` protocol. Point its custom endpoint to 4AICode to use models such as `gpt-6-astra`, `gpt-5.6-sol`, `gpt-5.5`, `gpt-5.4`, and `gpt-5.4-mini` in Hermes.

## Prerequisites

- 4AICode token: Create one in [Dashboard → Manage Tokens](https://4aicode.com/tokens). The format is `sk-4ai-...`
- Base URL: `https://relay.4aicode.com/v1`
- Recommended models: `gpt-5.4` is more reliable for everyday use, while `gpt-5.4-mini` is suitable for lightweight tasks and cost-sensitive scenarios

## Configuration

Run Hermes' built-in model configuration wizard:

```bash
hermes model
```

Follow the prompts and select:

```text
More providers...
Custom endpoint (enter URL manually)
```

Then enter:

```text
API base URL: https://relay.4aicode.com/v1
API key: sk-4ai-xxxxxxxxxxxxxxxx
```

Next, select from the model list:

```text
gpt-5.4
```

After configuration is complete, run:

```bash
hermes chat
```

## Available Models

| Model | Best for |
|---|---|
| `gpt-6-astra` | New-generation flagship; billed at 15% of the official price |
| `gpt-5.6-sol` | Flagship model for complex coding, long-running tasks, and multi-file refactoring |
| `gpt-5.6-terra` / `gpt-5.6-luna` | Balanced / cheaper and faster |
| `gpt-5.5` | Previous-generation flagship |
| `gpt-5.4` | Recommended default choice; more reliable for general tasks |
| `gpt-5.4-mini` | General Q&A, simple copy edits, and short code snippets; fast and low-cost |
| `gpt-5.3-codex` | Code optimization model |

## Testing

After entering Hermes, send a message such as:

```text
Hello, introduce yourself in one sentence
```

If it responds normally, the configuration was successful.

## FAQ

### Empty response from model

Hermes uses `/v1/chat/completions`. In `hermes model`, enter the Base URL as `https://relay.4aicode.com/v1`, so Hermes automatically appends `/chat/completions`.

Run `hermes model` again and verify the Base URL, API key, and Model name.

### Seeing response.created / response.completed

This means the client received an SSE event stream from the Responses API. Hermes requires the Chat Completions format, and 4AICode's `/v1/chat/completions` automatically converts it. If this occurs, first check:

- Whether `base_url` is `https://relay.4aicode.com/v1`
- Whether the request path is `/v1/chat/completions`
- Whether the 4AICode backend has been deployed with the latest version

### Model not supported

Older model names such as `gpt-5` and `gpt-5-codex` have been deprecated. Run `hermes model` again and select `gpt-5.4`.

## References

- [Hermes Agent AI Providers](https://hermes-agent.nousresearch.com/docs/integrations/providers)
- [Hermes Agent Configuration](https://hermes-agent.nousresearch.com/docs/user-guide/configuration/)
- [Juejin: Configuring models in Hermes](https://juejin.cn/post/7629598396504834100)
