OpenRouterClient
Constructors
Signature
declare const make: (options: { readonly apiKey?: Redacted.Redacted; readonly apiUrl?: string; readonly referrer?: string; readonly title?: string; readonly transformClient?: (client: HttpClient.HttpClient) => HttpClient.HttpClient;}) => Effect.Effect<Service, never, HttpClient.HttpClient>Context
OpenRouterClient
Added in v1.0.0
Source
Signature
declare class OpenRouterClient extends any { constructor();}Layers
Signature
declare function layer(options: { readonly apiKey?: Redacted<string>; readonly apiUrl?: string; readonly referrer?: string; readonly title?: string; readonly transformClient?: (client: HttpClient) => HttpClient;}): Layer<OpenRouterClient, never, HttpClient>layerConfig
Added in v1.0.0
Source
Signature
declare function layerConfig(options: { readonly apiKey?: Config<Redacted<string>>; readonly apiUrl?: Config<string>; readonly referrer?: Config<string>; readonly title?: Config<string>; readonly transformClient?: (client: HttpClient) => HttpClient;}): Layer<OpenRouterClient, ConfigError, HttpClient>Models
Signature
interface Service { readonly client: Client; readonly createChatCompletion: (options: { [key: string]: any; }) => Effect<ChatResponse, AiError>; readonly createChatCompletionStream: (options: Omit<typeof Generated.ChatGenerationParams.Encoded, "stream">) => Stream<ChatStreamingResponseChunk, AiError>;}Schemas
ChatStreamingChoice
Added in v1.0.0
Source
Signature
declare class ChatStreamingChoice extends { [key: string]: any;} { [key: string]: any; constructor(...args: [props?: { [key: string]: any; }, options?: MakeOptions]);}ChatStreamingMessageChunk
Added in v1.0.0
Source
Signature
declare class ChatStreamingMessageChunk extends { [key: string]: any;} { [key: string]: any; constructor(...args: [props?: { [key: string]: any; }, options?: MakeOptions]);}ChatStreamingMessageToolCall
Added in v1.0.0
Source
Signature
declare class ChatStreamingMessageToolCall extends { [key: string]: any;} { [key: string]: any; constructor(...args: [props?: { [key: string]: any; }, options?: MakeOptions]);}ChatStreamingResponseChunk
Added in v1.0.0
Source
Signature
declare class ChatStreamingResponseChunk extends { [key: string]: any;} { [key: string]: any; constructor(...args: [props?: { [key: string]: any; }, options?: MakeOptions]);}