# OpenCode

Configure an OpenAI-compatible OpenCode provider with a current model ID.

Create or update an OpenCode custom OpenAI-compatible provider using the canonical base URL and environment variable.

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "koscompute": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "KosCompute",
      "options": {
        "baseURL": "https://api.koscompute.com/v1",
        "apiKey": "{env:KOSCOMPUTE_API_KEY}"
      },
      "models": {
        "qwen/qwen3.8-27b": {"name": "KosCompute coding model"}
      }
    }
  },
  "model": "koscompute/qwen/qwen3.8-27b"
}
```

OpenCode configuration schemas can evolve. The API-specific parts tested by this portal are the base URL, Bearer authentication, model ID, Chat Completions streaming, reasoning controls, structured output, and local tool calls. Confirm the surrounding config keys against your installed OpenCode version.
