yycode x Hermes Quick Start Guide

Applicable Scenario

This document solves one thing only: connect yycode's Anthropic-compatible API to Hermes and complete a minimal usability check.

If you are currently using Hermes, rather than OpenClaw, Cherry Studio, or another client, this document is the corresponding integration method.


1. Preparation

Before you begin, make sure:

  • You have already created an API Key in the yycode console
  • You know the actual model name Hermes will call
  • You can edit Hermes's configuration file config.yaml
  • This integration is for yycode's Anthropic-compatible endpoint, not the OpenAI-compatible endpoint

2. Supported Models

This document currently focuses on yycode Anthropic-compatible model access. Common model names are:

Model name
claude-opus-4-6
claude-sonnet-4-6
claude-haiku-4-5-20251001

If you are not sure which models are actually available for your account, use the console or your existing successful call records as the source of truth.


When connecting Hermes to yycode, the core idea is:

  1. Declare a yycode provider in custom_providers
  2. Point the default model in the model block to this provider
  3. Disable smart_model_routing so Hermes does not automatically switch to another model

Step 1: Define a custom provider

custom_providers:
  - name: custom-yycode-net-aws
    base_url: https://yycode.net
    api_key: <your-key>
    api_mode: anthropic_messages
    models:
      - claude-opus-4-6

The two most important points here are:

  • base_url should be https://yycode.net
  • api_mode must be anthropic_messages

Step 2: Point the default model to this provider

model:
  default: claude-opus-4-6
  provider: custom-yycode-net-aws
  base_url: https://yycode.net
  api_key: <your-key>
  api_mode: anthropic_messages

The provider must match the name in custom_providers above; otherwise Hermes will not route to the Dragon Code provider you defined.

Step 3: Disable Smart Model Routing

smart_model_routing:
  enabled: false

If this is not disabled, Hermes may automatically switch to a cheaper model when messages are short. As a result, even though you configured claude-opus-4-6, the actual model used may be different.


4. Minimal Working Configuration You Can Reference Directly

Below is a merged minimal working example. Replace <your-key> with your own Dragon Code API Key:

model:
  default: claude-opus-4-6
  provider: custom-yycode-net-aws
  base_url: https://yycode.net
  api_key: <your-key>
  api_mode: anthropic_messages

custom_providers:
  - name: custom-yycode-net-aws
    base_url: https://yycode.net
    api_key: <your-key>
    api_mode: anthropic_messages
    models:
      - claude-opus-4-6

smart_model_routing:
  enabled: false

fallback_providers:
  - provider: minimax-cn
    model: MiniMax-M2.7

If you want to switch to another Anthropic-compatible model, change the model names in both model.default and custom_providers[].models.


5. Success Criteria

If the following conditions are met, Hermes and Dragon Code are basically connected:

  • base_url is https://yycode.net
  • api_mode is anthropic_messages
  • model.provider points to the provider name you defined in custom_providers
  • smart_model_routing.enabled is disabled
  • After Hermes sends a message, it can receive a normal model reply

6. FAQ

Why not connect using the OpenAI-compatible method?

For this Hermes-to-yycode setup, you should use the native Anthropic message format, namely /v1/messages.

The known conclusion is:

  • /v1/messages works
  • /v1/chat/completions is not suitable as the main path for this Hermes configuration

So api_mode must be anthropic_messages; do not configure it as an OpenAI-compatible mode.

Why did I choose claude-opus-4-6, but another model actually ran?

First check whether smart_model_routing.enabled has been disabled.

If Hermes has smart routing enabled, short messages may be automatically routed to a cheaper model, causing the model shown in the UI and the actual request model to differ.

Can I use api_key_env?

Based on the current configuration record, api_key_env in Hermes v0.10.0 can be unstable in both the model and custom_providers blocks. This may prevent environment variables from expanding correctly and finally return 401.

If you have confirmed this is the issue, you can temporarily go back to directly filling in api_key, get the connection working first, and then decide whether to continue troubleshooting the environment variable approach.

Why does it return 401?

Usually check these first:

  • Whether the API Key is valid
  • Whether api_key has been filled in where both model and custom_providers require it
  • Whether Hermes has actually loaded the configuration file you modified

Why does it return 503 or service unavailable?

If your current configuration is using the OpenAI-compatible path, first go back and check whether Hermes was configured with the wrong api_mode.

The recommended path in this document is the Anthropic-compatible approach. Mixing it with OpenAI-compatible configuration is not recommended.


7. API Verification Example

If you want to bypass Hermes first and directly verify whether the Dragon Code endpoint itself is available, you can call the native Anthropic endpoint:

curl -X POST "https://yycode.net/v1/messages" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-key>" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-opus-4-6","max_tokens":50,"messages":[{"role":"user","content":"hi"}]}'

If this request returns normally, go back and check the Hermes configuration. Troubleshooting will be more direct.


8. Next Steps

  • Want to connect other clients: see OpenClaw Quick Start Guide and Cherry Studio Quick Start Guide
  • Have not created a Key yet: go back to the yycode console and create an API Key first
  • Want to organize development tool configurations in one place: continue reading other quick integration documents on this site
Full page copied