
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
opencode-agentrouter
Advanced tools
OpenCode plugin for using AgentRouter models inside OpenCode.
The plugin patches globalThis.fetch at module load time. For any request to agentrouter.org it:
reasoning_effort, reasoning, and cache_control fields that AgentRouter rejects.thinking: { type: "adaptive" } for Claude models. Opus 4.7 requires adaptive thinking; older Claude models are upgraded from type: "enabled" (deprecated) to type: "adaptive".sensitive_words_detected, the plugin retries with exponential backoff (up to 30 attempts).Requests to all other domains pass through untouched.
{
"plugin": ["opencode-agentrouter"]
}
Add to your OpenCode config (~/.config/opencode/opencode.json). OpenCode installs npm plugins automatically.
Copy dist/index.js to:
~/.config/opencode/plugins/agentrouter-auth.js
Files in the plugins directory are auto-loaded.
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-agentrouter"],
"provider": {
"agentrouter": {
"npm": "@ai-sdk/openai-compatible",
"name": "AgentRouter",
"options": {
"baseURL": "https://agentrouter.org/v1",
"apiKey": "sk-YOUR-KEY-HERE"
},
"models": {
"claude-opus-4-6": {
"name": "Claude Opus 4.6",
"limit": { "context": 1000000, "output": 128000 },
"reasoning": true
},
"claude-opus-4-7": {
"name": "Claude Opus 4.7",
"limit": { "context": 1000000, "output": 128000 },
"reasoning": true
},
"deepseek-r1-0528": {
"name": "DeepSeek R1 0528",
"limit": { "context": 163840, "output": 16384 },
"reasoning": true
},
"glm-5.1": {
"name": "GLM 5.1",
"limit": { "context": 202752, "output": 65535 },
"reasoning": true
}
}
}
}
}
Get your API key at https://agentrouter.org/console/token
| Model | Context | Output | Reasoning |
|---|---|---|---|
claude-opus-4-6 | 1,000,000 | 128,000 | yes |
claude-opus-4-7 | 1,000,000 | 128,000 | yes |
deepseek-r1-0528 | 163,840 | 16,384 | yes |
deepseek-v3.1 | 163,840 | 32,768 | no |
deepseek-v3.2 | 131,072 | 32,768 | no |
glm-4.5 | 131,072 | 98,304 | yes |
glm-4.6 | 204,800 | 204,800 | yes |
glm-5.1 | 202,752 | 65,535 | yes |
Check https://agentrouter.org/pricing for the latest list.
/models and select an AgentRouter modelgit clone https://github.com/TVD-00/opencode-agentrouter.git
cd opencode-agentrouter
npm install
npm run build
FAQs
OpenCode plugin to use models from agentrouter.org
We found that opencode-agentrouter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.