Agents
OpenCode
The open-source terminal agent, through its OpenAI-compatible provider.
OpenCode 2 plugin
Download Lyber for OpenCode 2 (0.5.0-rc.5). Requires OpenCode 2.2.5 or later. Defaults are temperature 0.7, top-p 0.95 and 131,072 output tokens. Explicit request settings are preserved.
Unzip the package into a stable directory. Add its absolute directory path to the plugins array in your existing OpenCode 2 configuration, preserving other settings, then restart OpenCode.
{
"plugins": ["/absolute/path/to/lyber-opencode-provider"]
}Run opencode auth login lyber or provide LYBER_API_KEY privately in OpenCode's environment. This is an experimental candidate. The archive includes install, update and rollback instructions; release details and SHA-256 checksum identify the current download.
OpenCode 1 setup prompt
Copy this prompt into OpenCode itself or any coding agent you use, such as Claude Code, Codex or Cursor. It adds Lyber to OpenCode's settings, keeps your key out of every file, and checks the connection without spending credit.
Set up OpenCode on this computer to use Lyber, an OpenAI-compatible API.
Lyber:
- Base URL: https://api.lyber.ai/v1
- Model: kimi-k31-pro-abliterated
- API key: in the LYBER_API_KEY environment variable. Never print it, never write it into a file, and never ask me to paste it into this chat.
Do this:
1. Open ~/.config/opencode/opencode.json. If it exists, copy it to ~/.config/opencode/opencode.json.bak first, then merge these settings into it and keep everything else. If it doesn't exist, create it with exactly this:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"lyber": {
"npm": "@ai-sdk/openai-compatible",
"name": "Lyber",
"options": {
"baseURL": "https://api.lyber.ai/v1",
"apiKey": "{env:LYBER_API_KEY}"
},
"models": {
"kimi-k31-pro-abliterated": {
"name": "Kimi K3.1 Pro",
"cost": { "input": 4, "output": 15, "cache_read": 4, "cache_write": 4 },
"limit": { "context": 1048576, "output": 32768 }
}
}
}
},
"model": "lyber/kimi-k31-pro-abliterated",
"small_model": "lyber/kimi-k31-pro-abliterated"
}
2. If OpenCode isn't installed, tell me to run: npm install -g opencode-ai
3. If LYBER_API_KEY isn't set in my shell, tell me to add export LYBER_API_KEY="…" to my shell profile myself and open a new terminal.
4. Check the key without spending credit. This should print 200:
curl -s -o /dev/null -w "%{http_code}\n" https://api.lyber.ai/v1/models -H "Authorization: Bearer $LYBER_API_KEY"
5. Tell me what you changed and how to start OpenCode on Lyber: opencode
Don't send a chat request through Lyber unless I ask.OpenCode 1 manual setup
1. Install OpenCode
npm install -g opencode-ai2. Put your key in your environment
Add this to your shell profile (~/.zshrc or ~/.bashrc) and open a new terminal.
export LYBER_API_KEY="lyber_prepaid_…"3. Add Lyber to ~/.config/opencode/opencode.json
Keep any settings already in the file; add these beside them.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"lyber": {
"npm": "@ai-sdk/openai-compatible",
"name": "Lyber",
"options": {
"baseURL": "https://api.lyber.ai/v1",
"apiKey": "{env:LYBER_API_KEY}"
},
"models": {
"kimi-k31-pro-abliterated": {
"name": "Kimi K3.1 Pro",
"cost": { "input": 4, "output": 15, "cache_read": 4, "cache_write": 4 },
"limit": { "context": 1048576, "output": 32768 }
}
}
}
},
"model": "lyber/kimi-k31-pro-abliterated",
"small_model": "lyber/kimi-k31-pro-abliterated"
}4. Start OpenCode
opencodeNotes
{env:LYBER_API_KEY}reads the key from your environment; it never sits in the file.small_modelwrites session titles on Kimi too; the account limit is shared across its keys and reported by the Router.- Cost fields are USD per million tokens, cached input included. Lyber's balance and request ledger govern billing; refresh this configuration after a price change.
- This recipe requests up to 32,768 output tokens. Check the active route’s context and output limits before using it. Preview the credit hold through the credits API.
- These settings are for OpenCode 1 from npm (
opencode-ai). OpenCode 2, which Homebrew installs, uses a different file format. - Don't add
"reasoning": trueto the entry: OpenCode then sends athinkingfield that Lyber rejects. Kimi reasons by default.