One API key, two protocols, every major coding agent. Grab your key, note the two endpoints below, then follow the guide for your tool, CLI or app.
Sign in, open Dashboard β API Keys, create a key and copy it. Keys are shown once, so store them safely.
Open API KeysAnthropic format for Claude Code, OpenAI format for everything else. The right one is in the cards above.
Three guides below, each in a CLI and an App version. Every value you need is written out in full. Nothing to guess.
Hermes Agent speaks both protocols. The guide below uses the OpenAI route (base URL https://lucif.ai/v1, model lucif) and shows the Anthropic route at the end of the CLI guide. One rule: no trailing slash on the base URL.
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
hermes model # choose: Custom endpoint (self-hosted / VLLM / etc.) # Base URL : https://lucif.ai/v1 # API key : sk-your-lucif-key # Model : lucif # API mode : Chat Completions
The wizard writes the config for you. The manual equivalent is the next step. Both end in the same file.
Hermes keeps model and endpoint in ~/.hermes/config.yaml (the single source of truth) and secrets in ~/.hermes/.env:
model: default: lucif provider: custom base_url: https://lucif.ai/v1 key_env: LUCIF_API_KEY context_length: 200000
LUCIF_API_KEY=sk-your-lucif-key
hermes chat # in-session: /model custom:lucif # per-run: hermes chat --provider custom --model lucif
Hermes needs a model context of at least 64K tokens for agent work. LUCIF routes are far above that (proven to ~480K), so no action is needed. Auxiliary tasks (compression, titles, vision) follow your main model, so they use LUCIF too.
Want both models side by side? Named providers let Hermes hold the OpenAI and Anthropic routes at once:
providers: lucif: api: https://lucif.ai/v1 key_env: LUCIF_API_KEY transport: chat_completions default_model: lucif claude-lucif: api: https://lucif.ai key_env: LUCIF_API_KEY transport: anthropic_messages default_model: claude-lucif
Add this to the same ~/.hermes/config.yaml. It tells Hermes to summarize the session automatically at 90% of the 200K window, leaving a safe margin before the limit. After compacting, it targets 30% so the session stays lean:
compression: enabled: true threshold: 0.9 # 90% of the 200K window target_ratio: 0.3 protect_last_n: 20
This mirrors the proven production config. Trigger manually anytime with /compress.
hermes dashboard
# opens http://127.0.0.1:9119
The dashboard is a form editor over the same config.yaml and .env the CLI uses. Changes here and in the terminal are the same changes. Check the profile switcher in the sidebar first: it decides which profile you are editing.
β Open API Keys and set LUCIF_API_KEY to your LUCIF key. β‘ Open Config β model and set: provider custom, base URL https://lucif.ai/v1, default model lucif. β’ Click Save. It applies from your next session or restart.
The dashboard edits the same config.yaml the CLI uses. Add the compression block from CLI step 5 to that file (via terminal or any editor). The dashboard will pick it up on the next load. Same result: auto-compact at 90% of the 200K window.
OpenCode speaks the OpenAI protocol (an Anthropic variant is at the bottom of the CLI guide). Base URL https://lucif.ai/v1, model lucif.
curl -fsSL https://opencode.ai/install | bash
# or: npm i -g opencode-ai@latest Β· brew install anomalyco/tap/opencode
Global config: ~/.config/opencode/opencode.json. A project can override it with an opencode.json in the project root. Paste this, replacing lcf-your-key-here with your actual API key:
{
"$schema": "https://opencode.ai/config.js?v=11on",
"model": "lucif/lucif",
"provider": {
"lucif": {
"npm": "@ai-sdk/openai-compatible",
"name": "LUCIF API",
"options": {
"baseURL": "https://lucif.ai/v1",
"apiKey": "lcf-your-key-here"
},
"models": {
"lucif": { "name": "lucif", "limit": { "context": 200000, "output": 16384 } }
}
}
}
}
opencode
# then type /models and select lucif/lucif
> /models Select model βββββββββββββββββββββββββββββ LUCIF API βΈ lucif (lucif/lucif)
Anthropic variant (optional): to route OpenCode through the Anthropic protocol instead, override the built-in provider. Note the /v1 here is correct: the Anthropic SDK package expects it, unlike Claude Code:
{
"$schema": "https://opencode.ai/config.js?v=11on",
"model": "anthropic/claude-lucif",
"provider": {
"anthropic": {
"options": { "baseURL": "https://lucif.ai/v1", "apiKey": "lcf-your-key-here" },
"models": { "claude-lucif": { "name": "Lucif Claude" } }
}
}
}
Merge this into the top level of the same opencode.json from step 2. With the 200K context limit already set, a 20K buffer means automatic compaction fires at 90% of the 200K window:
{
"compaction": {
"auto": true,
"buffer": 20000
}
}
Trigger manually anytime with /compact.
Get OpenCode Desktop from opencode.ai/download (macOS, Windows and Linux builds). Good news: the app reads the same opencode.json and the same stored credentials as the CLI. If your CLI setup already works, open the app and just pick the model in step 3.
Open Settings β Providers β Custom Provider β Connect and fill:
Start a session and choose lucif from the model picker (or via the command palette β Choose model). Send a test prompt. Replies now run on LUCIF routing.
The app reads the same opencode.json as the CLI. Add the compaction block from CLI step 4 to that file. The app picks it up on the next session. Same result: auto-compact at 90% of the 200K window.
Claude Code speaks the Anthropic protocol. Base URL https://lucif.ai (no /v1), model claude-lucif, key as Bearer token.
# macOS / Linux / WSL curl -fsSL https://claude.ai/install.sh | bash # Windows PowerShell irm https://claude.ai/install.ps1 | iex
Create or edit ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json) and paste this. The settings file is the reliable place: it wins over shell exports and survives restarts:
{
"env": {
"ANTHROPIC_BASE_URL": "https://lucif.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-your-lucif-key",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-lucif",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-lucif",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-lucif"
},
"model": "claude-lucif"
}
The three ANTHROPIC_DEFAULT_*_MODEL lines pin Claude Code's internal aliases (including background tasks) to claude-lucif, so nothing ever asks the gateway for a built-in Claude model name. Model discovery fills the /model picker from LUCIF automatically.
Prefer shell variables? The minimal equivalent is:
export ANTHROPIC_BASE_URL="https://lucif.ai" export ANTHROPIC_AUTH_TOKEN="sk-your-lucif-key"
claude --model claude-lucif # inside the session, run: /status
> /status
Anthropic base URL : https://lucif.ai
Auth token : ANTHROPIC_AUTH_TOKEN
Model : claude-lucif
Add one line at the top level of the same ~/.claude/settings.json from step 2 (next to "model"). This sets the auto-compact window to 90% of the 200K window for every model:
{
"autoCompactWindow": 180000
}
Verify in-session with /autocompact. Trigger manually anytime with /compact.
Download the Claude desktop app from claude.com/download and install it. The third-party configuration must be in place before you choose how to sign in.
Open Help β Troubleshooting β Enable Developer Mode. The app restarts and a Developer menu appears.
Open Developer β Configure Third-Party Inferenceβ¦ and fill the form exactly like this:
Click Test connection. It should pass. Then Apply Changes (the app may restart). On the sign-in screen, choose the third-party configuration option, not the Anthropic account sign-in. Finally pick claude-lucif in the model picker and start a chat.
{
"claudeCode.environmentVariables": [
{ "name": "ANTHROPIC_BASE_URL", "value": "https://lucif.ai" },
{ "name": "ANTHROPIC_AUTH_TOKEN", "value": "sk-your-lucif-key" }
]
}
The desktop app does not read settings.json, so set it in-session instead. In any chat, run:
/autocompact 180k
This saves the 90% of the 200K window setting to your user settings and applies immediately. Run /autocompact alone anytime to confirm what is active.
| Symptom | Likely cause | Fix |
|---|---|---|
| 404 on every request (Claude Code) | ANTHROPIC_BASE_URL ends in /v1 | Use https://lucif.ai. The tool appends /v1/messages itself |
| 401 Unauthorized | Key sent in the wrong header | LUCIF keys are Bearer tokens: ANTHROPIC_AUTH_TOKEN in Claude Code; auth scheme Bearer in the desktop app |
| Model never appears in the picker | Provider stored but not defined (OpenCode), or discovery off | OpenCode needs the provider block in opencode.json, not just /connect; Claude Code needs CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 |
| Session dies on long conversations (OpenCode) | Custom model has no context limit | Set limit.context as in the guides. Without it the tool assumes 0 |
| Hermes ignores the endpoint | Endpoint set via env vars instead of config | Put provider: custom + base_url in ~/.hermes/config.yaml; no trailing slash |
None of these match? Contact support with your tool, its version, and the exact error text. That trio solves most cases in one reply.