You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue might be a duplicate of existing issues. Please check:
Feature request: Python SDK #2266: Feature request for Python SDK - This issue has the same request for a Python SDK and already has 10 comments with discussion about implementation using stainless and the publishing burden
Feel free to ignore if none of these address your specific case.
Hi, bumping this up. Would be great if there's a python sdk for this - I'm currently generating the pydantic interface from the config's json schema directly, and would need to manually update it everytime the schema changes.
@shreyansh073 agreed that the opencode-sdk-python appears up to date re: @freedom07
My understanding is that the python code itself was generated from the OpenAPI scheme of the REST API itself automatically*.
I did several searches online at GitHub and search engines, and cannot find even one package that contains a requirements.txt file with opencode-sdk-python. I am further exploring with a deep research agentic AI that I have and finding nothing. From what I can see from these results it is most probably OpenCode never supported a Python SDK. Which, again, is challenging to understand. I have communicated opinions regarding typed languages and projects such as these for many years (c.f. 2019) and this simply cannot be resolved with my expectations any longer. Looking forward to moving on. Eventually.
Does anyone have tutorials on the basic json-line streaming examples of the REST API at a quick disposal? I am late for a thing.
PS @freedom07 if you need anything for a PR that my dummy dummy dummy mind can help feel free to comment along here.
Can confirm: OpenCode does not support a Python SDK.
the documentation does not exist.
github returns zero repositories with opencode-sdk-python in requirements.txt
its own chat agent returns one file with a example which is out of date and runs a trivial use case.
its own code agents create malformed sample code
basic utilities such as client.config.get() fail to return all active agents, including OpenCode's own.
(The REST API also commits these errors?)
basic utilities such as client.session.create() which are required for all subsequent operations fail with opaque "malformed JSON request" before even compiling a request to send to the server. This method is the session initiation required to get a session_id to begin a new session through .chat(). This happens in both sync and async clients in opencode-sdk-python.
(The REST API returns session_id as expected)
The local coffeeshop is gifting strawberry shortcake today, which is nice.
(Instead of its usual burnt ends of the banana bread. Yum.)
Tracking the issue, and building a simple REST API client on our own. Thanks.
@davidbernat if you feel something is behind schedule, feel free to open pull requests to accelerate said features. Last time I checked, you had 0 pull requests in either project. There's also no public roadmap as far as I'm aware, so I'd love to know what your schedule is based on.
At this point, your comments are mostly noise, diminishing the value of engaging in this issue. I also want to clarify I'm not associated with OpenCode, which is the reason I didn't respond to your earlier mention and why you still haven't been banned.
For anyone else interested in progress, you may view the latest in https://github.com/hey-api/openapi-ts/tree/main/packages/openapi-python/. The plugins to watch are Pydantic, SDK, and HTTPX client. Unless there are OpenCode-specific issues, I'd encourage you to open issues under that repository as I'm way more responsive there.
I built my own, which hangs due to unresolved opencode run internal errors, and which remain unaddressed on other tickets.
I also built an entire logging reconstruction stack, after those tickets went unaddressed.
Hoffman can phone Starlight any day of the week (9-5 ET) and offer me to do the work of his teams for him. @mrlubos Thanks man. You let us know when you replace Stainless.
Hey @vxnuaj@freedom07@rekram1-node Just confirming for my boys at OMB/GAO that the API/SDK is NOT ready for Python, from either Hey nor Stainless. Also, the tickets stating opencode serve fails for large file objects were not updated since moi.
We are not blocked but will be if opencode serve remains blocked via API in any major fashion. Are you guys hiring ?
PS I have worked for YC compan[ies] as Chief Scientist and know very well their timed-release gear grinding problems.
For anyone landing here: I’d separate this into two layers.
API/SDK client: calling an existing OpenCode server.
Runtime management: starting/stopping OpenCode, isolating workspaces per user, reusing sessions, streaming events, and health-checking the server process.
For simple API calls, the official OpenCode server/API path is probably the right starting point. For Python backend use cases, I’ve been working on the second layer: a small runtime wrapper that manages OpenCode instances per workspace/user.
Hey BlissFolly. SDK is finished. 1.17 fixed the async serverside bugs the OC team languished. excited to OS soon enough. Check with PG and YC. He knows exactly the 411 and ISR on the issue. SO relieved to actually have a company that can beat Cursor at its own games. Send my regards to PG. Muffin basket.
Activity
github-actions commentedon Nov 7, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Nov 7, 2025
@blissfolly we do have one but I need to release it and write some CI to keep it up to date
it's in packages/sdk/python but it is a bit outdated
blissfolly commentedon Nov 7, 2025
rekram1-node commentedon Nov 7, 2025
I think I can get it publishing soon
blissfolly commentedon Nov 7, 2025
rekram1-node commentedon Nov 7, 2025
Yes, in this repo
shreyansh073 commentedon Jan 6, 2026
Hi, bumping this up. Would be great if there's a python sdk for this - I'm currently generating the pydantic interface from the config's json schema directly, and would need to manually update it everytime the schema changes.
This repo doesn't seem to be updated
mrlubos commentedon Jan 13, 2026
Tracking 🐍
davidbernat commentedon Feb 3, 2026
@shreyansh073 agreed that the
opencode-sdk-pythonappears up to date re: @freedom07My understanding is that the python code itself was generated from the OpenAPI scheme of the REST API itself automatically*.
I did several searches online at GitHub and search engines, and cannot find even one package that contains a
requirements.txt filewithopencode-sdk-python. I am further exploring with a deep research agentic AI that I have and finding nothing. From what I can see from these results it is most probably OpenCode never supported a Python SDK. Which, again, is challenging to understand. I have communicated opinions regarding typed languages and projects such as these for many years (c.f. 2019) and this simply cannot be resolved with my expectations any longer. Looking forward to moving on. Eventually.Does anyone have tutorials on the basic json-line streaming examples of the REST API at a quick disposal? I am late for a thing.
PS @freedom07 if you need anything for a PR that my dummy dummy dummy mind can help feel free to comment along here.
davidbernat commentedon Feb 4, 2026
Can confirm: OpenCode does not support a Python SDK.
client.config.get()fail to return all active agents, including OpenCode's own.client.session.create()which are required for all subsequent operations fail with opaque "malformed JSON request" before even compiling a request to send to the server. This method is the session initiation required to get a session_id to begin a new session through .chat(). This happens in both sync and async clients inopencode-sdk-python.Tracking the issue, and building a simple REST API client on our own. Thanks.
R44VC0RP commentedon Feb 4, 2026
We are working on a Python SDK with another provider, going to close this as it is planned internally.
7 remaining items
vxnuaj commentedon Feb 12, 2026
cool cool. curious if there's a rough timeline?
SAIL-Fang commentedon Mar 2, 2026
Tracking
vxnuaj commentedon Mar 3, 2026
you could ask grok.
mrlubos commentedon Mar 3, 2026
@davidbernat if you feel something is behind schedule, feel free to open pull requests to accelerate said features. Last time I checked, you had 0 pull requests in either project. There's also no public roadmap as far as I'm aware, so I'd love to know what your schedule is based on.
At this point, your comments are mostly noise, diminishing the value of engaging in this issue. I also want to clarify I'm not associated with OpenCode, which is the reason I didn't respond to your earlier mention and why you still haven't been banned.
For anyone else interested in progress, you may view the latest in https://github.com/hey-api/openapi-ts/tree/main/packages/openapi-python/. The plugins to watch are Pydantic, SDK, and HTTPX client. Unless there are OpenCode-specific issues, I'd encourage you to open issues under that repository as I'm way more responsive there.
davidbernat commentedon Mar 3, 2026
I built my own, which hangs due to unresolved
opencode runinternal errors, and which remain unaddressed on other tickets.I also built an entire logging reconstruction stack, after those tickets went unaddressed.
Hoffman can phone Starlight any day of the week (9-5 ET) and offer me to do the work of his teams for him.
@mrlubos Thanks man. You let us know when you replace Stainless.
vxnuaj commentedon Mar 3, 2026
You could ask grok. Only one prompt away.
https://grok.com/share/c2hhcmQtNA_f3c2c051-baf7-4b66-9ea6-9d3c102aaa15
I would kindly appreciate it that you keep this thread relevant to the PR.
davidbernat commentedon Apr 20, 2026
Hey @vxnuaj @freedom07 @rekram1-node Just confirming for my boys at OMB/GAO that the API/SDK is NOT ready for Python, from either Hey nor Stainless. Also, the tickets stating
opencode servefails for large file objects were not updated since moi.We are not blocked but will be if
opencode serveremains blocked via API in any major fashion. Are you guys hiring ?PS I have worked for YC compan[ies] as Chief Scientist and know very well their timed-release gear grinding problems.
feat(sdk): scaffold Python SDK with auto-regen CI
Ardumine commentedon May 7, 2026
Any update? Im starting to really need the SDK...
g0g5 commentedon Jun 28, 2026
Any update? Im starting to really need the SDK... +1
skislyakow commentedon Jul 6, 2026
Please give this option a try. And if possible, share your thoughts and any criticism. https://pypi.org/project/opencode-py/
ashish16052 commentedon Jul 9, 2026
For anyone landing here: I’d separate this into two layers.
For simple API calls, the official OpenCode server/API path is probably the right starting point. For Python backend use cases, I’ve been working on the second layer: a small runtime wrapper that manages OpenCode instances per workspace/user.
I’m the author, so take this as related work rather than an official answer:
https://pypi.org/project/opencode-runtime/
Would be interested to know whether people here need a pure Python API client, or more of a “run OpenCode safely from a Python app” layer.
Ardumine commentedon Jul 20, 2026
No way you are back 😭
github-actions commentedon Oct 7, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.