---
title: "OpenCode"
description: "Configure OpenCode to call plaingateway."
---

# OpenCode

Put this in `opencode.json`:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "plaingateway": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "plaingateway",
      "options": {
        "baseURL": "https://api.plaingateway.com/api/v1",
        "apiKey": "{env:PLAINGATEWAY_API_KEY}"
      },
      "models": {
        "openai/gpt-5.6-luna": { "name": "GPT-5.6 Luna" }
      }
    }
  }
}
```

`plaingateway` is the provider ID; each key under `models` is a plaingateway model ID.
Start OpenCode and run `/models`, then pick `plaingateway/openai/gpt-5.6-luna`.
