Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.anyapi.ai/llms.txt

Use this file to discover all available pages before exploring further.

Hermes Agent

Hermes Agent is an open-source, terminal-native autonomous coding and task agent by Nous Research. It features persistent memory, agent-created skills, and a messaging gateway with 21 platform adapters (Telegram, Discord, Slack, Google Chat, WhatsApp, Signal, SMS, Email, and more).
AnyAPI is not a built-in provider in Hermes Agent. You configure it as a named custom OpenAI-compatible provider via the custom_providers: list.

Quick Start

1

Get your API key

Sign up at anyapi.ai and create an API key in the dashboard.
2

Store the key as a secret

Add the key to ~/.hermes/.env (Hermes keeps secrets separate from settings):
echo 'ANYAPI_API_KEY=your-key-here' >> ~/.hermes/.env
3

Run the provider wizard

hermes model
When prompted:
  1. Select Custom endpoint (self-hosted / VLLM / etc.)
  2. Provider name: anyapi
  3. Base URL: https://api.anyapi.ai/v1
  4. API key env var: ANYAPI_API_KEY
  5. Default model: openai/gpt-4o (or any model from the AnyAPI catalog)
4

Start Hermes

hermes chat
Your agent now routes requests through AnyAPI.

Manual Configuration

For full control, edit the config files directly instead of using hermes model.

Set the API key

~/.hermes/.env:
ANYAPI_API_KEY=your-key-here

Configure provider and model

~/.hermes/config.yaml:
model:
  default: openai/gpt-4o
  provider: custom:anyapi
  base_url: https://api.anyapi.ai/v1

custom_providers:
  - name: anyapi
    base_url: https://api.anyapi.ai/v1
    key_env: ANYAPI_API_KEY
    api_mode: chat_completions

Verify

hermes config show

Model Format

AnyAPI uses the vendor/model format. Always include the vendor prefix:
model:
  provider: custom:anyapi
  default: openai/gpt-4o          # correct
  # default: gpt-4               # wrong — missing vendor prefix
Browse all available models at anyapi.ai/ai-models or query the API:
curl -sS -H "Authorization: Bearer $ANYAPI_API_KEY" \
  https://api.anyapi.ai/v1/models | jq -r '.data[].id'

Advanced Configuration

Set the context length for the default model:
model:
  default: openai/gpt-4o
  context_length: 128000
For per-model overrides:
custom_providers:
  - name: anyapi
    base_url: https://api.anyapi.ai/v1
    key_env: ANYAPI_API_KEY
    models:
      openai/gpt-4o:
        context_length: 128000
      google/gemini-2.5-pro:
        context_length: 1000000
Hermes runs side LLM tasks (vision, compression, title generation, etc.) and lets you override the model per task:
auxiliary:
  vision:
    provider: custom:anyapi
    model: openai/gpt-4o
  compression:
    provider: custom:anyapi
    model: openai/gpt-4o-mini
  title_generation:
    provider: custom:anyapi
    model: openai/gpt-4o-mini
Tasks not overridden inherit from the main model: block.
A list of backups Hermes tries when the primary model fails:
fallback_providers:
  - provider: custom:anyapi
    model: openai/gpt-4o
  - provider: custom:anyapi
    model: openai/gpt-4o-mini
AnyAPI also exposes Anthropic’s /v1/messages format for Claude models:
model:
  default: anthropic/claude-sonnet-4.6
  provider: custom:anyapi-anthropic

custom_providers:
  - name: anyapi-anthropic
    base_url: https://api.anyapi.ai/v1
    key_env: ANYAPI_API_KEY
    api_mode: anthropic_messages

Configuration Examples

model:
  default: openai/gpt-4o
  provider: custom:anyapi
  base_url: https://api.anyapi.ai/v1

custom_providers:
  - name: anyapi
    base_url: https://api.anyapi.ai/v1
    key_env: ANYAPI_API_KEY

Gateway Mode

When running Hermes as a messaging gateway (Telegram, Discord, Slack, etc.), the configuration is identical. Restart the service after changes:
hermes gateway restart

Troubleshooting

Hermes can’t find your AnyAPI key.
  1. Verify the env file: grep ANYAPI ~/.hermes/.env
  2. Re-run the wizard: hermes model → Custom endpoint
  3. Confirm YAML uses key_env: ANYAPI_API_KEY (or the alias api_key_env:)
Your key is invalid, revoked, or has no credits.
  1. Validate the key at dash.anyapi.ai
  2. Check your balance/quota
  3. Reissue the key if needed
The model ID is unknown or missing the vendor prefix.
  1. List the live catalog: curl -H "Authorization: Bearer $ANYAPI_API_KEY" https://api.anyapi.ai/v1/models
  2. Use vendor/model form (e.g. openai/gpt-4o, not bare gpt-4o)
The endpoint must be exactly https://api.anyapi.ai/v1 — no trailing slash, no /chat/completions suffix (Hermes appends that automatically).
If Hermes warns about unknown YAML keys, check that you are using:
  • custom_providers: (plural list), not custom_provider:
  • auxiliary.<task>.provider, not auxiliary_providers:
  • model.context_length, not context_limits:
Check usage at dash.anyapi.ai, upgrade your plan, or route side tasks to cheaper models via auxiliary.*.

Best Practices

  1. Keep credentials in .env, never in config.yaml
  2. Configure fallbacks — AnyAPI gives you many providers behind one key, use them for resilience
  3. Route side tasks to small models — use auxiliary.* with cheaper models like openai/gpt-4o-mini
  4. Always use vendor/model format — bare model names will not resolve
  5. Monitor usage at dash.anyapi.ai

Support