Skip to main content

Connecting in OpenCode

  1. Install OpenCode

  2. Create the file opencode.json in the project root and fill it with the contents below

    opencode.json
    {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
    "explyt": {
    "npm": "@ai-sdk/openai-compatible",
    "name": "explyt",
    "options": {
    "baseURL": "<YOUR_URL>"
    },
    "models": {
    "auto": {
    "limit": {
    "context": 372000,
    "output": 32768
    }
    },
    "Anthropic/opus-5": {
    "limit": {
    "context": 465536,
    "output": 65536
    }
    },
    "OpenAI/gpt-5.6-sol": {
    "limit": {
    "context": 372000,
    "output": 32768
    }
    }
    }
    }
    }
    }
    • Replace <YOUR_URL> with the OpenAI-compatible URL issued to you
      • If you see these instructions but do not have an OpenAI-compatible URL, contact your organization's administrator
    • The models block lists the main recommended models. To get the full list of models, contact your organization's administrator or open <YOUR_URL>/models
    • To use another model, add it to the models block following the same pattern
  3. Start OpenCode:

    opencode
  4. Type /connect

    OpenCode: the /connect command

  5. Choose explyt (or another name you specified in the config)

    OpenCode: choosing the explyt provider

  6. Enter the API key issued to you

    • If you see these instructions but do not have an API key, contact your organization's administrator

    OpenCode: entering the API key

For errors, see Error messages.