opencode-zen-proxy
v1.0.5
Published
OMP plugin to fix opencode zen 429 errors by ensuring authentication headers are sent
Maintainers
Readme
opencode-zen-proxy OMP Plugin
This plugin fixes HTTP 429 (rate limit) errors when using OpenCode Zen with Oh My Pi (OMP) by ensuring authentication headers are properly sent.
Problem
When using OpenCode Zen with OMP, you may encounter 429 errors because the authentication header is not being sent with requests, causing the service to rate limit unauthenticated requests.
Solution
This OMP plugin intercepts all fetch requests and automatically adds the required Authorization header for OpenCode Zen requests.
Installation
Clone or copy this plugin to your OMP plugins directory:
git clone <this-repo-url> ~/.omp/agent/plugins/opencode-zen-proxy # or copy manuallyInstall the plugin:
cd ~/.omp/agent/plugins/opencode-zen-proxy npm installSet your OpenCode Zen API key as an environment variable:
export OPENCODE_ZEN_API_KEY="your-api-key-here" # or add to your shell profile (~/.bashrc, ~/.zshrc, etc.)Restart OMP for the plugin to take effect.
Configuration
The plugin looks for the API key in the following environment variables (in order):
OPENCODE_ZEN_API_KEY(preferred)OMP_OPENCODE_ZEN_TOKEN
You can set either of these in your environment.
How It Works
The plugin monkey-patches the global fetch function to intercept all HTTP requests. When it detects a request to OpenCode Zen URLs (containing "opencode" or "zen"), it ensures the Authorization header is present with your API key.
Building from Source
If you want to build the plugin yourself:
npm install
npm run buildThis will compile the TypeScript source to JavaScript in the dist/ directory.
License
MIT
