Skip to main content
Use 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.
V1 uses provider, npm, and options, as documented in its custom provider guide.
The configuration contains an environment-variable reference, so the API key stays out of the JSON file. Global configuration locations are documented for V1 and V2. The V2 configuration explicitly limits input to text because custom models otherwise inherit image support. Client context estimates are not a guarantee of gateway capacity; see model capabilities and our request limits.

Start a session

From your project directory:
Open /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.