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
I'm developing a Python SDK to interface with the OpenCode API as an alternative to the ClaudeCode SDK.
Context:
I've generated a Python client using OpenAPI Generator and your openapi json (fetched from 127.0.0.1:4096/doc)
For now, I'm focusing only on the session endpoints, as this is the minimum needed to get some code generated.
Issue/Question
I'm unclear about the expected flow between API endpoints, particularly regarding message handling.
Current behavior:
When calling session.chat({ id, ...chatInput }) (which in my Python client translates to POST: http://127.0.0.1:4096/session/ses_72eb63d80ffe11MuiSwJ3G3wD4/message), I receive an empty response
The response contains neither the model's response nor a message ID that could be used for polling
Expected behavior (based on SDK documentation):
The documentation indicates this endpoint "returns a message."
I expected either:
The model's response directly, OR
A message ID to poll for the response
Questions:
Is the empty response from the /message endpoint expected behavior?
Should I be polling the messages list endpoint (GET /session/{id}/messages) to retrieve new messages after posting?
What is the intended flow for:
Sending a message to the model
Receiving/retrieving the model's response
Some other endpoint I also find confusing, like:
What are the APP endpoints for? Does one need to initialize the app when setting up the server?
What's the use of the File endpoints? Are they for the TUI to provide file searching capabilities in the repo for the client who is potentially on another machine? Are there other use cases?
Is there additional API documentation available that describes the endpoint interaction patterns?
Environment
Generated client using OpenAPI Generator
Python client is generated with urllib3 (synchronous)
API endpoint: http://127.0.0.1:4096
Any clarification on the proper API flow would be greatly appreciated. Happy to provide additional details if needed.
Thanks! I’ll regenerate the SDK after the next release.
While you’re updating the spec, could you also add OpenAPI tags to group endpoints? This lets generators produce namespaced clients (e.g., client.session.chat()) instead of flat names (client.session_chat()).
Example: for POST /session/{id}/message, add "tags": ["session"] and use "operationId": "chat" (instead of "session.chat").
I suspect you created the OpenAPI spec by a generator. So I'm not sure if it's possible. But it would help me (and maybe others who try to generate clients for your API) a lot.
Activity
github-actions commentedon Aug 22, 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 Aug 22, 2025
I think this endpoint was not properly documented, the spec should be fixed in next release
rekram1-node commentedon Aug 22, 2025
You will need to regen your sdk after that
Drinect commentedon Aug 25, 2025
Thanks! I’ll regenerate the SDK after the next release.
While you’re updating the spec, could you also add OpenAPI tags to group endpoints? This lets generators produce namespaced clients (e.g., client.session.chat()) instead of flat names (client.session_chat()).
Example: for POST /session/{id}/message, add "tags": ["session"] and use "operationId": "chat" (instead of "session.chat").
Suggested tags: session, config, app, file, find, tui, event, auth.
I suspect you created the OpenAPI spec by a generator. So I'm not sure if it's possible. But it would help me (and maybe others who try to generate clients for your API) a lot.
rekram1-node commentedon Aug 25, 2025
good idea
rekram1-node commentedon Dec 28, 2025
[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!