# Connect OpenCode to Void API

Connect Void API models through an OpenAI-compatible provider.

Examples use MODEL_ID as a placeholder, not an available model. Replace it with an ID from the current catalog. Choose a model that supports the endpoint and features used by this tool; vision and tool calling are not universal.

[Current model catalog](https://void-api.tech/models)

## API key

Store your key in an environment variable.

### Environment variables

```
export VOID_API_KEY='void_your_key'
```

## Configuration

Create opencode.json in your project root.

### opencode.json

```
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "void-api": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Void API",
      "options": {
        "baseURL": "https://void-api.tech/v1",
        "apiKey": "{env:VOID_API_KEY}"
      },
      "models": {
        "MODEL_ID": {
          "name": "MODEL_ID",
          "attachment": true,
          "modalities": {
            "input": [
              "text",
              "image"
            ],
            "output": [
              "text"
            ]
          }
        }
      }
    }
  }
}
```

## Run

Start OpenCode and select a Void API model.

### shell

```
opencode
/models
```

[Upstream documentation](https://opencode.ai/docs/providers/#custom)
