Class NaruOpenRouterProvider

java.lang.Object
net.thevpc.naru.api.model.AbstractNaruModelProvider
net.thevpc.naru.ext.models.openrouter.NaruOpenRouterProvider
All Implemented Interfaces:
NaruModelProvider, net.thevpc.nuts.spi.NComponent

public class NaruOpenRouterProvider extends AbstractNaruModelProvider
OpenRouter provider — one API key gives access to hundreds of models, including a rotating set of :free variants.

Endpoint: POST {baseUrl}/chat/completions

Default baseUrl: https://openrouter.ai/api/v1

  • Constructor Details

    • NaruOpenRouterProvider

      public NaruOpenRouterProvider()
  • Method Details

    • getProtocol

      public net.thevpc.nuts.util.NOptional<NaruModelProtocol> getProtocol(NaruModelConfig model, NaruSession session)
    • findModelIds

      public List<String> findModelIds(NaruSession session)
      Model list is dynamic: fetched live from GET /models when an API key is provided. If no API key is provided, returns empty list because OpenRouter models cannot be used.
    • baseUrl

      protected String baseUrl(NaruSession session)