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:
providers: onezhe: api: https://1zheai.com/v1 key_env: ONEZHE_API_KEY transport: chat_completions default_model: claude-sonnet-4-6model: provider: custom:onezhe default: claude-sonnet-4-6Served locally at ~/.hermes/.env:
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.
Verify the Connection and Troubleshoot
Section titled “Verify the Connection and Troubleshoot”- Save and reload the configuration, and confirm that the currently selected provider is
onezheor the custom model you added. - Send a short question and confirm it returns; then try a small, reversible task to separately verify tool calls and multi-turn conversation.
- 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.
- 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.
Costs and Other Access Methods
Section titled “Costs and Other Access Methods”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 .
