Answer: Read the prompt with text() (and focused() for typing state), write it with insert(text) or setText(text), and choose the model with model() and setModel({ providerID, modelID, variant }). Status: Confirmed Entry: tool/opencode/integrations/host-apis-prompt-model Revision: 2 Digest: sha256:ef3f82d55b7fc95c (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:50Z Last changed: 2026-11-19T13:34:49Z (set variant: — → setVariant(variant)) Last verified: 2026-11-20T13:44:39Z Next check: 2026-11-21T13:44:39Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of read prompt | text() | [1] | 2026-11-20 insert text | insert(text) | [1] | 2026-11-20 replace text | setText(text) | [1] | 2026-11-20 current model | model() | [1] | 2026-11-20 set model | setModel | [1] | 2026-11-20 set variant | setVariant(variant) | [1] | 2026-11-20 Sources: [1] opencode. "GUI | OpenCode". https://opencode.ai/docs/build/plugins/gui/ Role: primary. Accessed: 2026-11-20T13:44:39Z Quote: "Read what the user typed with text() , and whether they are typing with focused()" (Supports: read prompt) Quote: "insert(text) types text into the prompt for the user to review and send." (Supports: insert text) Quote: "setText(text) replaces the prompt’s text, mentions included." (Supports: replace text) Quote: "model() is the model the next prompt is sent with, and setModel selects one as the model picker does" (Supports: current model) Quote: "setModel makes the model the session’s choice and its first recent model." (Supports: set model) Quote: "setVariant(variant) selects a variant of the current model." (Supports: set variant) Snapshot SHA-256: 326eaeb3ad935eb18bbcc5bbb10c7a6ba4d7a1eb6a469b5d3f4f1ca35f1407ee (captured 2026-11-19T13:34:47Z) 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-19T13:34:49Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:39Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:39Z Last attempt: 2026-11-20T13:44:39Z Notes and limitations: Extracted automatically from a single official source (section "Host APIs"). Related: https://latestn.com/tool/opencode/integrations/implement-rpc How do I implement an RPC in an opencode plugin? https://latestn.com/tool/opencode/integrations/inference-api-endpoints Which API endpoints does the opencode Inference API support for OpenAI, Anthropic, and Gemini models? https://latestn.com/tool/opencode/integrations/load-plugin How do I load an opencode plugin? https://latestn.com/tool/opencode/integrations/effect-plugin-rpc How do I call opencode plugin RPC methods from the Effect client? https://latestn.com/tool/opencode/integrations/effect-stream-events How do I stream events from opencode using the Effect client? https://latestn.com/tool/opencode/integrations/find-provider-url Where do I find the provider URL for the opencode Console Providers API? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T13:34:49Z | changed | set variant: — → setVariant(variant) | [1] 2026-11-19T13:34:49Z | changed | set model: — → setModel | [1] 2026-11-19T13:34:49Z | changed | current model: — → model() | [1] 2026-11-19T13:34:49Z | changed | composer access: ctx.screen.current()?.composer → — | [1] 2026-11-19T13:34:49Z | changed | model fields: providerID → — | [1] 2026-11-19T13:34:49Z | changed | choose model: setModel → — | [1] 2026-11-15T13:53:01Z | recovered | Check succeeded again | — 2026-11-14T13:42:08Z | check-failed | Extraction did not pass verification: section "Host APIs" not found in the source (the page may have been reorganized) | — 2026-11-13T03:55:50Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/integrations/host-apis-prompt-model/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/host-apis-prompt-model POST: https://latestn.com/dispute/tool/opencode/integrations/host-apis-prompt-model with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/integrations/host-apis-prompt-model?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I read and write the prompt or choose the model from an opencode GUI plugin? Revision 2, last verified 2026-11-20T13:44:39Z. https://latestn.com/tool/opencode/integrations/host-apis-prompt-model (accessed 2026-11-21T09:54:27Z). @misc{LatestN_tool_opencode_integrations_host_apis_prompt_model_r2, title = {How do I read and write the prompt or choose the model from an opencode GUI plugin?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/integrations/host-apis-prompt-model}}, note = {Revision 2; digest sha256:ef3f82d55b7fc95c; last verified 2026-11-20T13:44:39Z; accessed 2026-11-21T09:54: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/host-apis-prompt-model