Skip to content

OpenAiClientGenerated.ts

Since v4.0.0



Creates a generated OpenAI client service with the given options.

Signature

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

Source

Since v4.0.0

Creates a layer for the generated OpenAI client with the given options.

Signature

declare const layer: (options: Options) => Layer.Layer<OpenAiClientGenerated, never, HttpClient.HttpClient>

Source

Since v4.0.0

Creates a layer for the generated OpenAI client, loading the requisite configuration via Effect’s Config module.

Signature

declare const layerConfig: (options?: {
readonly apiKey?: Config.Config<Redacted.Redacted<string> | undefined> | undefined
readonly apiUrl?: Config.Config<string> | undefined
readonly organizationId?: Config.Config<Redacted.Redacted<string> | undefined> | undefined
readonly projectId?: Config.Config<Redacted.Redacted<string> | undefined> | undefined
readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
}) => Layer.Layer<OpenAiClientGenerated, Config.ConfigError, HttpClient.HttpClient>

Source

Since v4.0.0

Options for configuring the generated OpenAI client.

Signature

type Options = {
/**
* The OpenAI API key.
*/
readonly apiKey?: Redacted.Redacted<string> | undefined
/**
* The base URL for the OpenAI API.
*
* @default "https://api.openai.com/v1"
*/
readonly apiUrl?: string | undefined
/**
* Optional organization ID for multi-org accounts.
*/
readonly organizationId?: Redacted.Redacted<string> | undefined
/**
* Optional project ID for project-scoped requests.
*/
readonly projectId?: Redacted.Redacted<string> | undefined
/**
* Optional transformer for the HTTP client.
*/
readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
}

Source

Since v4.0.0

Service identifier for the generated OpenAI client.

Signature

declare class OpenAiClientGenerated

Source

Since v4.0.0