Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
- I have searched the existing issues and confirmed this feature has not already been requested in the same form.
Description
As a follow-up to #52743, OpenCode's future Auto routing mode should not only choose the appropriate model and reasoning level, but also optimize which provider or endpoint should execute the request.
Many users have access to multiple providers at the same time:
- OpenRouter
- OpenAI
- Anthropic
- Groq
- Together AI
- Fireworks AI
- DeepInfra
- other OpenAI-compatible providers
- local/self-hosted models
Some providers may also offer free models, prepaid credits, subscriptions, promotional quotas, or cheaper inference for the same/similar models.
OpenCode could use this information when routing requests.
Example
Instead of:
Task → selected model
the routing process could become:
Task → required capabilities → candidate models → candidate providers → cost/quota/availability → best route
For example:
- simple task → eligible free model
- normal coding task → inexpensive open model
- complex task → stronger paid model
- free quota exhausted → cheapest suitable paid route
- subscription quota available → prefer subscription before API spend
- provider unavailable/rate-limited → automatically use an allowed fallback
- difficult task or failed attempt → escalate to a stronger model
OpenRouter example
OpenRouter is particularly interesting because it provides many models and free endpoints behind one API.
If a user has OpenRouter configured, OpenCode could optionally prefer eligible free models first and only consume paid credits when the task requires it.
The same concept should not be limited to OpenRouter. Direct providers or local models could be preferred whenever they offer a better route.
User policy
Users should control the optimization strategy rather than manually selecting a model for every task.
For example:
Auto – Quality
Auto – Balanced
Auto – Save
Auto – Free first
A custom policy could eventually allow preferences such as:
- prefer free models
- prefer existing subscriptions/quotas
- minimize API spending
- prefer local models
- preserve premium quota
- prioritize quality
- maximum cost per request/session
- allowed/blocked providers
Manual model selection should always remain available.
Transparency
OpenCode should clearly show why a route was selected.
Example:
Qwen → OpenRouter Free
Reason: sufficient capability + free quota available
or:
Claude → Anthropic
Reason: complex task + subscription quota available
The user should ideally see the estimated cost before or after execution where pricing information is available.
Relationship to #52743
#52743 proposes a provider-agnostic intelligent model and compute router.
This issue extends that idea specifically with economic routing:
model quality + task requirements + provider + price + free quota + subscription quota + credits + availability
The goal is not simply to always choose the cheapest model.
The goal is to use the cheapest route that is sufficiently capable for the task, while respecting the user's quality and provider preferences.
Long term, this could make:
/models → Auto
a true intelligent routing layer instead of only an automatic model selector.
Activity
github-actions commentedon Oct 2, 2026
This issue might be a duplicate of an existing issue. Please check:
mixxermannipro commentedon Oct 2, 2026
No, it's an extension. I wrote both.
opencodejr commentedon Oct 28, 2026
Thanks for writing this up in such detail!
I think this is a duplicate of #52743, your own open request. It already covers provider-, quota- and cost-aware
Autorouting, and this issue describes itself as a follow-up to it. The free-model, credit and policy-preset details here fit best as a comment on #52743, so the whole proposal stays in one place for maintainers.Possible duplicates and related issues, ordered by likelihood:
Autorouter that picks the provider and model while weighing cost, subscription/quota state, availability and user preferences.The bot will close this issue as a duplicate in 1 day unless you reply explaining how it differs from #52743.
opencodejr commentedon Oct 29, 2026
Closing this as a duplicate of #52743, your open request for provider-, quota- and cost-aware
Autorouting. We gave it a day in case this was meant as a separate request, and there's been no reply. Please add the free-model, credit and policy-preset details from here as a comment on #52743, so the whole proposal is in one place for maintainers. If this really is a different request, reply here and it can be reopened. Thanks!