?SessionSession —unknown
Loading…
Enter to send · Shift+Enter for newline · paste or drag images
API Usage—
Send message
POST /sessions/{id}/opencode/session/{ocid}/message
POST
curl -X POST https://your-host/api/v1/managed_agents/sessions/SESSION_ID/opencode/session/OPENCODE_SESSION_ID/message \
-H "Authorization: Bearer $MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{"parts":[{"type":"text","text":"your message"}]}'Stream message
GET /sessions/{id}/opencode/event
SSE
# 1) subscribe to the opencode event bus
curl -N https://your-host/api/v1/managed_agents/sessions/SESSION_ID/opencode/event -H "Authorization: Bearer $MASTER_KEY"
# 2) in another shell, fire the turn (streams on the bus above)
curl -X POST https://your-host/api/v1/managed_agents/sessions/SESSION_ID/opencode/session/OPENCODE_SESSION_ID/prompt_async \
-H "Authorization: Bearer $MASTER_KEY" -H "Content-Type: application/json" \
-d '{"parts":[{"type":"text","text":"your message"}]}'
# Each SSE frame is a raw opencode event:
# data: {"type":"message.part.delta","properties":{"partID":"p1","delta":"Hi"}}
# data: {"type":"session.idle","properties":{...}}Session must be ready before sending. Session ID above is pre-filled.