Sends a message and returns the complete response as a single JSON body. Blocks until the agent turn completes.
When to use this endpoint: Best for server-to-server integrations, background processing, or any context where you want the full response in one call without managing an SSE stream.
Alternatives:
POST /chat/:id/respond — streaming SSE with normalized events (recommended for custom chat UIs)API key starting with sk_case_
Chat session ID
Message payload following the AI SDK UIMessage format. The body is passed through 1:1 to the underlying OpenCode session. Currently only text parts are supported.
Message content parts. Currently only "text" type is supported. Additional types (e.g. file, image) may be added in future versions.
Upstream OpenCode response with per-turn usage metadata when available