Class OpenRouterLlmClient

All Implemented Interfaces:
LlmClient

public class OpenRouterLlmClient extends OpenAiLlmClient
Runtime client for OpenRouter. OpenAI-chat-compatible, so it inherits request building and response parsing from OpenAiLlmClient. The default base URL includes OpenRouter's /api prefix (https://openrouter.ai/api), which combines with the inherited /v1/chat/completions path.
  • Constructor Details

    • OpenRouterLlmClient

      public OpenRouterLlmClient()
  • Method Details

    • provider

      public Provider provider()
      Description copied from interface: LlmClient
      The provider this client handles — the registry key.
      Specified by:
      provider in interface LlmClient
      Overrides:
      provider in class OpenAiLlmClient
    • defaultBaseUrl

      protected String defaultBaseUrl()
      Description copied from class: OpenAiLlmClient
      The default base URL used when the backend does not supply one. OpenAI-compatible subclasses (Mistral, xAI, DeepSeek, Groq, OpenRouter) override this to point at their own host while inheriting the identical request/response wire format.
      Overrides:
      defaultBaseUrl in class OpenAiLlmClient