OpenRouterLLMClient

constructor(settings: OpenRouterClientSettings = OpenRouterClientSettings(), httpClient: KoogHttpClient, clock: Clock = Clock.System, toolsConverter: OpenAICompatibleToolDescriptorSchemaGenerator = OpenAICompatibleToolDescriptorSchemaGenerator())(source)

Parameters

settings

The base URL and timeouts for the OpenRouter API, defaults to "https://openrouter.ai" and 900s

httpClient

A fully configured KoogHttpClient for making API requests. Use the secondary constructor to create a Ktor-backed client configured with an API key.

clock

Clock instance used for tracking response metadata timestamps.


constructor(apiKey: String, settings: OpenRouterClientSettings = OpenRouterClientSettings(), baseClient: HttpClient = HttpClient(), clock: Clock = Clock.System, toolsConverter: OpenAICompatibleToolDescriptorSchemaGenerator = OpenAICompatibleToolDescriptorSchemaGenerator())(source)