Answer: You create an embedded opencode host by calling OpenCode.create(), which returns an explicitly owned host; use await using to release its resources, or call await opencode.close() explicitly when explicit resource management is not available. Status: Confirmed Entry: tool/opencode/integrations/create-host Revision: 1 Digest: sha256:1f443768d5fae092 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:00Z Last changed: 2026-11-13T03:56:00Z Last verified: 2026-11-20T13:44:48Z Next check: 2026-11-21T13:44:48Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of creation method | OpenCode.create() | [1] | 2026-11-20 resource release | await using | [1] | 2026-11-20 explicit close | await opencode.close() | [1] | 2026-11-20 import | @opencode/sdk | [1] | 2026-11-20 convenience aliases | sessions and events | [1] | 2026-11-20 Sources: [1] opencode. "SDK overview | OpenCode". https://opencode.ai/docs/build/sdk/ Role: primary. Accessed: 2026-11-20T13:44:48Z Quote: "OpenCode.create() returns an explicitly owned host." (Supports: creation method) Quote: "Use await using to release its router, Location services, fibers, and scoped plugin registrations" (Supports: resource release) Quote: "Call await opencode.close() explicitly when explicit resource management is not available." (Supports: explicit close) Quote: "import { OpenCode } from "@opencode/sdk"" (Supports: import) Quote: "adds the convenience aliases sessions and events for the session and event groups." (Supports: convenience aliases) Snapshot SHA-256: f8a24d569bb59d5a1656b6cc138f2477ce09d9c79cdbf890ca0763a50cdc83a5 (captured 2026-11-18T13:38:26Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-18T13:38:26Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:48Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:48Z Last attempt: 2026-11-20T13:44:48Z Notes and limitations: Extracted automatically from a single official source (section "Create a host"). Related: https://latestn.com/tool/opencode/integrations/create-pairing-code How do I create a pairing code with the opencode API? https://latestn.com/tool/opencode/integrations/customize-effect-layers How do I customize or provide layers in the opencode Effect SDK? https://latestn.com/tool/opencode/integrations/define-gui-plugin How do I define a GUI plugin for opencode? https://latestn.com/tool/opencode/integrations/create-client How do I create an opencode client and connect it to a server URL? https://latestn.com/tool/opencode/integrations/create-effect-client How do I create an Effect client for the opencode HTTP API? https://latestn.com/tool/opencode/integrations/create-effect-host How do I create an opencode host with the Effect SDK? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:00Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/create-host/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/integrations/create-host POST: https://latestn.com/dispute/tool/opencode/integrations/create-host with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/create-host?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I create an embedded opencode host in my application? Revision 1, last verified 2026-11-20T13:44:48Z. https://latestn.com/tool/opencode/integrations/create-host (accessed 2026-11-21T09:50:27Z). @misc{LatestN_tool_opencode_integrations_create_host_r1, title = {How do I create an embedded opencode host in my application?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/create-host}}, note = {Revision 1; digest sha256:1f443768d5fae092; last verified 2026-11-20T13:44:48Z; accessed 2026-11-21T09:50:27Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/integrations/create-host