---
title: "Hermes Agent Integration with Claude API"
description: "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."
headingIds: {"Verify the Connection and Troubleshoot":"section-1","Costs and Other Access Methods":"section-2"}
---

<aside className="docs-publication" data-pagefind-ignore>

Documentation maintained by [1ZheAI](https://1zheai.com/en/editorial/#publisher). [Sources and corrections](https://1zheai.com/en/editorial/).

Found an error? [Contact support](mailto:support@1zheai.com) with the page address and a description. Do not send API keys or account credentials.

</aside>
Use the custom provider feature of Hermes Agent to connect to 1折AI. First [create an API key ](/en/docs/api-keys/), and confirm the [currently available models ](/en/docs/models/); the model IDs below are examples — adjust them according to your key's permissions.

<Note>
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 ](/en/docs/models/) for the model list and pricing.
</Note>

Based on [official Providers ](https://hermes-agent.nousresearch.com/docs/integrations/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.

## Verify the Connection and Troubleshoot

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 ](/en/docs/usage-logs/) 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 ](/en/docs/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

Check [Claude API real-time pricing ](https://1zheai.com/en/pricing/) and [billing rules ](/en/docs/pricing-explained/). For other clients, return to the [tool access directory ](/en/docs/integrations/); to write your own program, use the [SDK and developer guide ](/en/docs/guides/).
