@alessiods/openrouter-maskOpenCode plugin that masks your requests as Hermes Agent on OpenRouter. Spoofs HTTP-Referer, X-OpenRouter-Title, and X-OpenRouter-Categories headers.
0
501
近 7 天 237
35.4
生态多维模型
27 天前
2026-07-23
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@alessiods/openrouter-mask@1.0.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@alessiods/openrouter-mask@1.0.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @alessiods/openrouter-maskopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
OpenCode plugin that masks your API requests as Hermes Agent on OpenRouter.
What it does
When you send requests through OpenRouter, this plugin overrides the following HTTP headers:
| Header | Value |
|---|---|
HTTP-Referer |
https://hermes-agent.nousresearch.com/ |
X-OpenRouter-Title |
Hermes Agent |
X-OpenRouter-Categories |
personal-agent,cli-agent |
This makes your requests appear as if they originate from the Hermes Agent application on OpenRouter, which can help with rate limits, usage tracking, and attribution.
Install
npm
npm install @alessiods/openrouter-mask
OpenCode
Add to your opencode.json:
{
"plugin": ["@alessiods/openrouter-mask"]
}
From source
{
"plugin": ["path/to/openrouter-mask/.opencode/plugins/openrouter-mask.mjs"]
}
How it works
The plugin hooks into OpenCode's chat.headers lifecycle event and injects the spoofed headers before each request is sent to the OpenRouter API.
import type { Plugin } from "@opencode-ai/plugin"
export default (async () => {
return {
"chat.headers": async (input, output) => {
output.headers["HTTP-Referer"] = "https://hermes-agent.nousresearch.com/"
output.headers["X-OpenRouter-Title"] = "Hermes Agent"
output.headers["X-OpenRouter-Categories"] = "personal-agent,cli-agent"
},
}
}) satisfies Plugin
Configuration
No configuration needed. Install and it works.
License
MIT