Skip to content

feat(provider): add Hostlinku provider with connection-scoped /v1/models discovery #64413

Open

Description

@dyocodes

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

We would like to add built-in support for Hostlinku (https://hostlinku.com / https://docs.hostlinku.com) as a single provider in OpenCode.

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.

Proposed approach:

  1. Register a single hostlinku provider in models.dev (https://api.hostlinku.com/v1, HOSTLINKU_API_KEY) with reference model metadata from https://hostlinku.com/models and https://api.hostlinku.com/api/public/models.
  2. 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.

Activity

  1. opencodejr commented on Nov 17, 2026

    @opencodejr
    Contributor

    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.

    I didn't find any existing issue about Hostlinku.

  2. dyocodes commented on Nov 17, 2026

    @dyocodes
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions