Lyber
Request access
DocsOpenCode

Agents

Markdown

OpenCode

The open-source terminal agent, through its OpenAI-compatible provider.

Easy setup

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.

opencode-lyber-setup.txt
Set up OpenCode on this computer to use Lyber, an OpenAI-compatible API.

Lyber:
- Base URL: https://lyber-paid-acceptance-gateway-production.up.railway.app/v1
- Models: minimax-m3.1-flash-abliterated (default; 1,048,576-token context, 32,768-token output) and deepseek-v4.1-flash-1017-abliterated (1,048,576-token context, 262,144-token output)
- 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://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
        "apiKey": "{env:LYBER_API_KEY}"
      },
      "models": {
        "minimax-m3.1-flash-abliterated": {
          "name": "MiniMax M3.1 Flash",
          "limit": { "context": 1048576, "output": 32768 }
        },
        "deepseek-v4.1-flash-1017-abliterated": {
          "name": "DeepSeek V4.1 Flash 1017",
          "limit": { "context": 1048576, "output": 262144 }
        }
      }
    }
  },
  "model": "lyber/minimax-m3.1-flash-abliterated",
  "small_model": "lyber/deepseek-v4.1-flash-1017-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://lyber-paid-acceptance-gateway-production.up.railway.app/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.

Manual setup

1. Install OpenCode

terminal
npm install -g opencode-ai

2. Put your key in your environment

Add this to your shell profile (~/.zshrc or ~/.bashrc) and open a new terminal.

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.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "lyber": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Lyber",
      "options": {
        "baseURL": "https://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
        "apiKey": "{env:LYBER_API_KEY}"
      },
      "models": {
        "minimax-m3.1-flash-abliterated": {
          "name": "MiniMax M3.1 Flash",
          "limit": { "context": 1048576, "output": 32768 }
        },
        "deepseek-v4.1-flash-1017-abliterated": {
          "name": "DeepSeek V4.1 Flash 1017",
          "limit": { "context": 1048576, "output": 262144 }
        }
      }
    }
  },
  "model": "lyber/minimax-m3.1-flash-abliterated",
  "small_model": "lyber/deepseek-v4.1-flash-1017-abliterated"
}

4. Start OpenCode

terminal
opencode

Notes

  • {env:LYBER_API_KEY} reads the key from your environment; it never sits in the file.
  • small_model writes session titles. Pointing it at the other Lyber model keeps it from waiting for the main model, which serves one request at a time.
  • Switch models inside OpenCode with /models.
  • These settings are for OpenCode 1 from npm (opencode-ai). OpenCode 2, which Homebrew installs, uses a different file format.
  • Don't add "reasoning": true to the MiniMax entry: OpenCode then sends a thinking field that Lyber rejects.