Skip to content
English

Hermes Agent Integration with Claude API

Tutorial on configuring the 1折AI Claude API relay address, key, and model in Hermes Agent, including protocol selection, configuration examples, verification steps, and common errors.

Use the custom provider feature of Hermes Agent to connect to 1折AI. First create an API key , and confirm the currently available models ; the model IDs below are examples — adjust them according to your key’s permissions.

Official configuration verification date: 2026-10-15. The following configuration is compiled from official documentation; end-to-end verification on this site has not yet been completed; please first complete a short Q&A and tool-call verification before using it for long tasks. OpenAI / GPT models are now live; see the model description for the model list and pricing.

Based on official Providers : run hermes model in the terminal → Custom endpoint, explicitly select chat_completions for API mode, fill in https://1zheai.com/v1 for Base URL, and enter the key and model. Do not select ChatGPT/Codex login — it is a different access method.

Reusable named provider configuration, merge into ~/.hermes/config.yaml:

yaml
providers:
onezhe:
api: https://1zheai.com/v1
key_env: ONEZHE_API_KEY
transport: chat_completions
default_model: claude-sonnet-4-6
model:
provider: custom:onezhe
default: claude-sonnet-4-6

Served locally at ~/.hermes/.env:

dotenv
ONEZHE_API_KEY=sk-替换为本站密钥

Once configured, you can switch /model custom:onezhe:claude-sonnet-4-6 in the conversation. /model cannot replace terminal hermes model for creating a new provider. Officially anthropic_messages transport is supported, but this tutorial uses Chat Completions to avoid automatically guessing the protocol from the URL. OPENAI_BASE_URL is not a universal configuration for all custom providers; use the explicit configuration above.

  1. Save and reload the configuration, and confirm that the currently selected provider is onezhe or the custom model you added.
  2. Send a short question and confirm it returns; then try a small, reversible task to separately verify tool calls and multi-turn conversation.
  3. Open the call log and check the request time, model, status, and usage. A single successful text response does not mean all Agent capabilities are compatible.
  4. If you encounter 404, check whether the address and protocol in this article match; if you encounter 401, check the key source and whether the process read the environment variables; if you encounter 429, review the rate-limit information before retrying. For more cases, see error codes and troubleshooting .

Keys should only be stored in the local environment or the tool’s credential store — do not commit them to code repositories, screenshots, or public logs. Background services may not inherit terminal environment variables; auxiliary models, search, and other tools may also have independent provider settings that need to be checked separately.

Check Claude API real-time pricing and billing rules . For other clients, return to the tool access directory ; to write your own program, use the SDK and developer guide .