본문으로 건너뛰기

OpenAI SDK

OpenAI SDK의 base URL을 Hermes로 바꾸고 Hermes API 키로 LLM을 호출하세요.

Set the base URL and key

The chat endpoint is OpenAI-compatible, so the official OpenAI SDK works without changes. Create an API key, export it as HERMES_API_KEY, and create the client with the base URL https://api.hermes-ai.net/api/v1.

shell
npm install openai
# or
pip install openai

export HERMES_API_KEY=your_api_key

API 키 생성

Send a chat completion

Streaming, function tools, JSON mode and reasoning settings pass through unchanged.

curl https://api.hermes-ai.net/api/v1/chat/completions \
  -H "Authorization: Bearer $HERMES_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4.5",
    "messages": [{"role": "user", "content": "Say hello in one sentence."}],
    "max_tokens": 200
  }'

Choose a model ID

GET /api/v1/chat/models lists the LLMs you can call, with prices in USD per 1M tokens. Use an id from that list as model. GET /api/v1/models is the image, video and music catalog, not the chat model list.

shell
curl https://api.hermes-ai.net/api/v1/chat/models

Browse LLMs

Billing and errors

Each request reserves credits for the estimated prompt plus max_tokens, then charges the usage the model reports and releases the rest. Set max_tokens to keep reservations small. Errors use the OpenAI error object with a documented Hermes code.

Chat completions (LLM)오류 코드

Image, video and music models

These models run as asynchronous tasks through POST /api/v1/jobs, not through the OpenAI SDK. 작업 및 결과