Skip to content

Install

pip install opencode-python-sdk
uv add opencode-python-sdk
poetry add opencode-python-sdk

The distribution is called opencode-python-sdk; the package imports as opencode. It needs Python 3.10 or newer and depends only on httpx, pydantic, anyio and typing-extensions.

import opencode

print(opencode.__version__)  # this package
print(opencode.API_VERSION)  # the OpenCode server version it was generated from

To start a server from Python with OpencodeServer, install the OpenCode CLI as well, so that opencode is on PATH.

Next