This integration allows you to use the OpenCode API as a conversation agent in Home Assistant. The code is based on the official Open Router component.
Place the custom_components folder in your configuration directory (or add its contents to an existing custom_components folder). Alternatively install via HACS.
To add the OpenCode service to your Home Assistant instance, use this My button:
Manual configuration steps:
- Browse to your Home Assistant instance.
- Go to Settings > Devices & services.
- In the bottom right corner, select the Add Integration button.
- From the list, select OpenCode.
- Follow the instructions on screen to complete the setup.
The API key is used to authenticate requests to OpenCode. To generate an API key:
- Log in to OpenCode Zen or sign up for an account.
- Go to the API Keys section in your account settings.
- Select Create API Key.
- Give the key a name and configure any necessary limits.
The OpenCode integration allows you to generate data using AI models available on OpenCode. You can use this functionality in automations, scripts, or directly in the Home Assistant UI.
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots menu. Then, select Delete.