effect-io-ai

Package: @effect/ai-openrouter
Module: OpenRouterClient

OpenRouterClient.make

Creates an OpenRouter client service from explicit options.

When to use

Use when you need the OpenRouter client service value inside an effect.

Details

The returned service uses the current HttpClient, prepends apiUrl or https://openrouter.ai/api/v1, adds the bearer token and optional HTTP-Referer and X-Title headers, accepts JSON responses, and applies transformClient when provided.

Gotchas

Scoped OpenRouterConfig.withClientTransform applies to generated client request methods. Streaming chat completion requests are sent directly by this module and do not read that scoped transform.

See

Signature

declare const make: (options: Options) => Effect.Effect<Service, never, HttpClient.HttpClient>

Source

Since v4.0.0