Feature hasn't been suggested before.
Describe the enhancement you want to request
Plugins that need a small isolated model call currently have to use client.session.prompt(). That creates a session and runs the normal agent pipeline, adding base prompts, project instructions, tools and context. A plugin-safe raw generation API should reuse OpenCode's provider authentication and model configuration while sending only an explicit system prompt and user prompt.
Suggested contract:
await client.experimental.generateText({
query: { directory },
body: {
model: { providerID, modelID, variant },
system: "You are a professional translator. Output only the translation.",
prompt: "Translate this text...",
temperature: 0,
maxOutputTokens: 2048,
},
})
Requirements:
- Reuse existing provider resolution, API keys, OAuth, endpoints, variants, retries and timeouts.
- Exclude session history, agent prompts, project instructions, tools, skills, MCP context and plugin system transforms unless explicitly requested.
- Do not create or persist sessions/messages.
- Do not expose credential material to plugins.
- Return generated text, usage and typed provider errors.
This would let translation and similar plugins make a minimal model request without requiring duplicate credentials or paying for unrelated OpenCode context.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Plugins that need a small isolated model call currently have to use
client.session.prompt(). That creates a session and runs the normal agent pipeline, adding base prompts, project instructions, tools and context. A plugin-safe raw generation API should reuse OpenCode's provider authentication and model configuration while sending only an explicit system prompt and user prompt.Suggested contract:
Requirements:
This would let translation and similar plugins make a minimal model request without requiring duplicate credentials or paying for unrelated OpenCode context.