Python SDK · Issue #4031 · anomalyco/opencode · GitHub
Skip to content

Python SDK #4031

Closed as not planned
Closed as not planned

Description

@blissfolly

Have you published a Python SDK / Developer API package for version ≥ 1.0.39 please? Can you forward me a link to download this please if so.

Thanks, Mark

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 7, 2025
  2. github-actions commented on Nov 7, 2025

    @github-actions
    Contributor

    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.

  3. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 7, 2025
  4. self-assigned this
    on Nov 7, 2025
  5. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Collaborator

    @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

  6. blissfolly commented on Nov 7, 2025

    @blissfolly
    Author
  7. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Collaborator

    I think I can get it publishing soon

  8. blissfolly commented on Nov 7, 2025

    @blissfolly
    Author
  9. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Collaborator

    Yes, in this repo

  10. shreyansh073 commented on Jan 6, 2026

    @shreyansh073

    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

  11. mrlubos commented on Jan 13, 2026

    @mrlubos
    Contributor

    Tracking 🐍

  12. davidbernat commented on Feb 3, 2026

    @davidbernat

    @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.

  13. davidbernat commented on Feb 4, 2026

    @davidbernat

    Can confirm: OpenCode does not support a Python SDK.

    1. the documentation does not exist.
    2. github returns zero repositories with opencode-sdk-python in requirements.txt
    3. its own chat agent returns one file with a example which is out of date and runs a trivial use case.
    4. its own code agents create malformed sample code
    5. basic utilities such as client.config.get() fail to return all active agents, including OpenCode's own.
    6. (The REST API also commits these errors?)
    7. 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.
    8. (The REST API returns session_id as expected)
    9. The local coffeeshop is gifting strawberry shortcake today, which is nice.
    10. (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.

    Image
  14. R44VC0RP commented on Feb 4, 2026

    @R44VC0RP
    Collaborator

    We are working on a Python SDK with another provider, going to close this as it is planned internally.

  15. 7 remaining items

  16. vxnuaj commented on Feb 12, 2026

    @vxnuaj

    cool cool. curious if there's a rough timeline?

  17. SAIL-Fang commented on Mar 2, 2026

    @SAIL-Fang

    Tracking

  18. vxnuaj commented on Mar 3, 2026

    @vxnuaj

    you could ask grok.

  19. mrlubos commented on Mar 3, 2026

    @mrlubos
    Contributor

    @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.

  20. davidbernat commented on Mar 3, 2026

    @davidbernat

    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.

  21. vxnuaj commented on Mar 3, 2026

    @vxnuaj

    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.

  22. davidbernat commented on Apr 20, 2026

    @davidbernat

    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.

  23. Ardumine commented on May 7, 2026

    @Ardumine

    Any update? Im starting to really need the SDK...

  24. g0g5 commented on Jun 28, 2026

    @g0g5

    Any update? Im starting to really need the SDK... +1

  25. skislyakow commented on Jul 6, 2026

    @skislyakow

    Please give this option a try. And if possible, share your thoughts and any criticism. https://pypi.org/project/opencode-py/

    Any update? Im starting to really need the SDK... +1

  26. ashish16052 commented on Jul 9, 2026

    @ashish16052

    For anyone landing here: I’d separate this into two layers.

    1. API/SDK client: calling an existing OpenCode server.
    2. 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.

    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.

  27. Ardumine commented on Jul 20, 2026

    @Ardumine

    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.

    No way you are back 😭

  28. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions