Prerequisites

Option 1 — HACS (recommended)

Add this repository as a custom repository, then install it as a normal integration.

  1. Open HACS

    Go to HACS → Integrations in the sidebar.

  2. Add the custom repository

    Click the menu (top-right) → Custom repositories. Add:

    https://github.com/pranjal-joshi/opencode

    with category Integration, then click Add.

  3. Install

    Find OpenCode in the list, click Download, then Install.

  4. Restart Home Assistant

    Restart, then head to Configuration.

Option 2 — Manual install

Download the latest release ZIP and extract custom_components/opencode into your config/custom_components/ directory. Restart Home Assistant.

The integration pulls in the openai Python package automatically during setup. On some installs, you may need to wait a moment for the dependency to be installed.
Never share your OpenCode Zen API key. It is stored in Home Assistant's encrypted .storage files and grants access to your account billing.