Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
When using xAI Grok 4.5 in OpenCode (via xAI API / OAuth / @ai-sdk/xai), there is no way to adjust thinking / reasoning intensity (low / medium / high). The model effectively always runs at the provider default (high), and OpenCode does not expose effort variants for this model.
This matters for both latency and cost: Grok 4.5's default is high effort, so simple coding tasks burn more reasoning tokens than necessary if low/medium cannot be selected.
xAI API support
Per xAI Reasoning docs:
grok-4.5 supports reasoning_effort / reasoning.effort
- Accepted values:
low / medium / high
- Default:
high
- Reasoning cannot be disabled (no
none)
Also documented on the Grok 4.5 overview.
Example (chat completions style):
{
"model": "grok-4.5",
"reasoning_effort": "low",
"messages": [{ "role": "user", "content": "…" }]
}
Current OpenCode behavior
In packages/opencode/src/provider/transform.ts, variants() only special-cases grok-3-mini for Grok reasoning effort:
// see: https://docs.x.ai/docs/guides/reasoning#control-how-hard-the-model-thinks
if (id.includes("grok") && id.includes("grok-3-mini")) {
// only low / high
return {
low: { reasoningEffort: "low" },
high: { reasoningEffort: "high" },
}
}
grok-4.5 (and related Grok 4.x models that now expose effort) fall through and do not get low/medium/high variants in the model picker / Ctrl+T cycling / config.
reasoningEffort() already maps @ai-sdk/xai → { reasoningEffort: effort }, so the missing piece is mainly exposing the correct effort variants for Grok 4.5 (and wiring models.dev / capabilities if needed).
Expected behavior
For Grok 4.5 (and preferably other Grok models that support effort):
- OpenCode exposes low / medium / high as selectable reasoning variants (same UX as other models with effort controls).
- Selecting a variant sends the correct
reasoningEffort / reasoning.effort to xAI.
- Works for both xAI API key and Grok OAuth paths.
- Do not offer
none for Grok 4.5 (API rejects disabling reasoning).
Why this matters
| Effort |
Use case |
low |
Fast agent loops, simple edits, latency-sensitive work |
medium |
Balanced coding sessions |
high (default) |
Hard debugging / architecture / multi-step reasoning |
Without this control, every request is effectively stuck on high, which is slower and more expensive than necessary for everyday agentic coding.
Related
Suggested implementation sketch
- Extend the Grok branch in
ProviderTransform.variants() beyond grok-3-mini to cover grok-4.5 (and ideally a broader grok-4 / models.dev-driven set).
- For Grok 4.5 specifically, expose:
low → { reasoningEffort: "low" }
medium → { reasoningEffort: "medium" }
high → { reasoningEffort: "high" }
- For OpenRouter / compatible providers, use the matching
{ reasoning: { effort } } shape already used for other models.
- Prefer driving this from models.dev
reasoning_options if available, so future Grok models do not need one-off hardcoding.
Happy to test a PR once this lands.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary
When using xAI Grok 4.5 in OpenCode (via xAI API / OAuth /
@ai-sdk/xai), there is no way to adjust thinking / reasoning intensity (low/medium/high). The model effectively always runs at the provider default (high), and OpenCode does not expose effort variants for this model.This matters for both latency and cost: Grok 4.5's default is high effort, so simple coding tasks burn more reasoning tokens than necessary if low/medium cannot be selected.
xAI API support
Per xAI Reasoning docs:
grok-4.5supportsreasoning_effort/reasoning.effortlow/medium/highhighnone)Also documented on the Grok 4.5 overview.
Example (chat completions style):
{ "model": "grok-4.5", "reasoning_effort": "low", "messages": [{ "role": "user", "content": "…" }] }Current OpenCode behavior
In
packages/opencode/src/provider/transform.ts,variants()only special-casesgrok-3-minifor Grok reasoning effort:grok-4.5(and related Grok 4.x models that now expose effort) fall through and do not get low/medium/high variants in the model picker / Ctrl+T cycling / config.reasoningEffort()already maps@ai-sdk/xai→{ reasoningEffort: effort }, so the missing piece is mainly exposing the correct effort variants for Grok 4.5 (and wiring models.dev / capabilities if needed).Expected behavior
For Grok 4.5 (and preferably other Grok models that support effort):
reasoningEffort/reasoning.effortto xAI.nonefor Grok 4.5 (API rejects disabling reasoning).Why this matters
lowmediumhigh(default)Without this control, every request is effectively stuck on high, which is slower and more expensive than necessary for everyday agentic coding.
Related
[FEATURE]: Grok 4.3 reasoning levels) — same class of feature; please extend coverage to Grok 4.5 with the officiallow|medium|highset (note: Grok 4.5 has nonone, default is high).Suggested implementation sketch
ProviderTransform.variants()beyondgrok-3-minito covergrok-4.5(and ideally a broadergrok-4/ models.dev-driven set).low→{ reasoningEffort: "low" }medium→{ reasoningEffort: "medium" }high→{ reasoningEffort: "high" }{ reasoning: { effort } }shape already used for other models.reasoning_optionsif available, so future Grok models do not need one-off hardcoding.Happy to test a PR once this lands.