You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(provider): add Hostlinku provider with connection-scoped /v1/models discovery #64413
Why a static catalog is not enough:
In Hostlinku, each API key is bound to one of three service modes (performance, economy, or dedicated). Both the available models and the per-1M-token USD pricing depend on the mode of the API key being used. Because of this, a static entry in models.dev alone cannot reflect which models or prices apply to a user's key, and splitting Hostlinku into three separate providers would make the setup confusing.
Add a provider plugin (packages/core/src/plugin/provider/hostlinku.ts) using OpenCode's connection-scoped inventory (ctx.provider.transform with sourceConnection and ProviderRefresh):
When the user enters or switches their Hostlinku API key in Connect -> Hostlinku, fetch GET https://api.hostlinku.com/v1/models with that key.
Map the returned models (id, display_name, context_window, max_output_tokens, capabilities, service_mode, and pricing in USD per 1M tokens) into Model.Info entries tied to sourceConnection.
Refresh the model list and pricing automatically when the key changes, and return a clear error if the key is invalid or catalog loading fails.
Happy to submit the models.dev PR and the provider plugin PR once this approach looks good to the team.
Thanks for the detailed proposal! You're asking for a single built-in Hostlinku provider that loads the models and per-1M-token pricing for the user's API key from GET /v1/models. The key's service mode decides which models and prices apply, so a static models.dev entry alone can't get them right. Maintainers will consider it, including whether it should live in core.
In the meantime, you don't have to wait for a decision on core: the public plugin API already covers this. The server plugin docs describe how to:
add a provider and its models with ctx.provider.transform (editor.add({ info, models, sourceConnection }));
tie the model list to the active connection by passing it as sourceConnection. OpenCode then leaves that provider out while another connection is selected, until your plugin publishes the refreshed list;
replace the model list and call ctx.provider.reload() when it changes, e.g. after the key is switched.
So Hostlinku could ship as a standalone plugin package now, whatever is decided about a built-in provider.
Thanks for the details. I've opened the companion models.dev catalog PR (anomalyco/models.dev#13893) along with the built-in provider plugin PR (#64436) using connection-scoped /v1/models discovery and dynamic USD pricing per key. Also happy to keep a standalone package option available if needed.
Activity
opencodejr commentedon Nov 17, 2026
Thanks for the detailed proposal! You're asking for a single built-in Hostlinku provider that loads the models and per-1M-token pricing for the user's API key from
GET /v1/models. The key's service mode decides which models and prices apply, so a static models.dev entry alone can't get them right. Maintainers will consider it, including whether it should live in core.In the meantime, you don't have to wait for a decision on core: the public plugin API already covers this. The server plugin docs describe how to:
ctx.provider.transform(editor.add({ info, models, sourceConnection }));sourceConnection. OpenCode then leaves that provider out while another connection is selected, until your plugin publishes the refreshed list;ctx.provider.reload()when it changes, e.g. after the key is switched.So Hostlinku could ship as a standalone plugin package now, whatever is decided about a built-in provider.
I didn't find any existing issue about Hostlinku.
dyocodes commentedon Nov 17, 2026
Thanks for the details. I've opened the companion models.dev catalog PR (anomalyco/models.dev#13893) along with the built-in provider plugin PR (#64436) using connection-scoped /v1/models discovery and dynamic USD pricing per key. Also happy to keep a standalone package option available if needed.