Answer: Use @opencode/sdk/workerd inside a Cloudflare Durable Object, holding one host for the lifetime of the Durable Object instance via state.blockConcurrencyWhile(() => OpenCodeWorkerd.create({ storage: state.storage, ... })). Status: Confirmed Entry: tool/opencode/integrations/cloudflare-durable-object-sdk Revision: 1 Digest: sha256:27bc93a2a2b03889 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:56:03Z Last changed: 2026-11-13T03:56:03Z Last verified: 2026-11-20T13:44:49Z Next check: 2026-11-21T13:44:49Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of package | @opencode/sdk/workerd | [1] | 2026-11-20 install command | bun add @opencode/sdk | [1] | 2026-11-20 storage | state.storage | [1] | 2026-11-20 default agent | build | [1] | 2026-11-20 compatibility flag | nodejs_compat | [1] | 2026-11-20 Sources: [1] opencode. "Cloudflare | OpenCode". https://opencode.ai/docs/build/sdk/cloudflare/ Role: primary. Accessed: 2026-11-20T13:44:49Z Quote: "Use @opencode/sdk/workerd inside a Cloudflare Durable Object." (Supports: package) Quote: "bun add @opencode/sdk" (Supports: install command) Quote: "storage: state.storage" (Supports: storage) Quote: "default_agent: "build"" (Supports: default agent) Quote: ""compatibility_flags" : [ "nodejs_compat" ]" (Supports: compatibility flag) Snapshot SHA-256: 5e138c3369bbdbe3846f298aaa0070f658aae025cc15dc8cd3fda6d8fbd26c71 (captured 2026-11-13T03:56:03Z) 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-13T03:56:03Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:49Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:49Z Last attempt: 2026-11-20T13:44:49Z Notes and limitations: Extracted automatically from a single official source (section "Cloudflare"). Related: https://latestn.com/tool/opencode/integrations/cloudflare-route-outbound-requests How do I route outbound requests with the opencode Cloudflare SDK? https://latestn.com/tool/opencode/integrations/configure-console-provider-in-codex How do I configure opencode Console as a model provider in Codex? https://latestn.com/tool/opencode/integrations/configure-opencode-provider How do I configure OpenCode Zen or OpenCode Go as the provider in Hermes? https://latestn.com/tool/opencode/integrations/call-rpc-method How do I call an opencode RPC method over HTTP or from a plugin? https://latestn.com/tool/opencode/integrations/client-headers-requests How do I pass authentication headers or a custom fetch to the opencode client? https://latestn.com/tool/opencode/integrations/close-host-resources How do I release or close an opencode host's resources? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:56:03Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/cloudflare-durable-object-sdk/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/cloudflare-durable-object-sdk POST: https://latestn.com/dispute/tool/opencode/integrations/cloudflare-durable-object-sdk with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/cloudflare-durable-object-sdk?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I use the opencode SDK inside a Cloudflare Durable Object? Revision 1, last verified 2026-11-20T13:44:49Z. https://latestn.com/tool/opencode/integrations/cloudflare-durable-object-sdk (accessed 2026-11-21T09:52:46Z). @misc{LatestN_tool_opencode_integrations_cloudflare_durable_object_sdk_r1, title = {How do I use the opencode SDK inside a Cloudflare Durable Object?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/cloudflare-durable-object-sdk}}, note = {Revision 1; digest sha256:27bc93a2a2b03889; last verified 2026-11-20T13:44:49Z; accessed 2026-11-21T09:52:46Z} } 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/cloudflare-durable-object-sdk