Skip to main content
OpenCode can use custom OpenAI-compatible providers. Configure LinkModel with the /v1 base URL and explicit model entries.
OpenCode v2 uses the providers object, package, and settings.baseURL. Older OpenCode examples may use provider, npm, and options.baseURL.

Configure

Set your API key:
Create or update opencode.json in your project:
Start OpenCode:
Use /models and select a linkmodel/* model.

Notes

  • Keep API keys in environment variables. Do not commit them in opencode.json.
  • Add more models from Models as needed.
  • If your OpenCode version expects the older config shape, use the official OpenCode provider docs linked below.

Official Reference