derestricted-llm in OpenCode through the Chat Completions API.
Before you start
Install OpenCode V1 or OpenCode V2, and create a key in the console. New verified accounts receive $5 in starting credit. In the terminal that will launch OpenCode:Add your provider
Choose the configuration for your installed major version. Merge it into~/.config/opencode/opencode.json to apply it to your projects. Existing project settings may override global settings.
- OpenCode V1
- OpenCode V2
V1 uses
provider, npm, and options, as documented in its custom provider guide.Start a session
From your project directory:/models and select derestricted/derestricted-llm if it is not already selected. Try “Explain the project structure.”
If something fails
- Unknown configuration field: use the tab matching
opencode --version; the V1 and V2 provider formats differ. - Missing provider or key: restart OpenCode from the terminal with the exported key. A separately running OpenCode server also needs that environment variable.
- Model missing from discovery: keep the explicit model entry shown above; model discovery may display compatibility aliases.
- Unsupported requests: use text and ordinary function tools. See API compatibility and the error guide.