import { type KyOptions } from './fetch-api.js'; import { type ChatParams, type ChatResponse, type ChatStreamParams, type ChatStreamResponse, type CompletionParams, type CompletionResponse, type CompletionStreamParams, type CompletionStreamResponse, type EmbeddingParams, type EmbeddingResponse, type ModerationParams, type ModerationResponse, type SpeechParams, type SpeechResponse } from './types.js'; export type ConfigOpts = { /** * The API key used to authenticate with the OpenAI API. * @see https://platform.openai.com/account/api-keys */ apiKey?: string; /** * The organization ID that should be billed for API requests. * This is only necessary if your API key is scoped to multiple organizations. * @see https://platform.openai.com/docs/api-reference/organization-optional */ organizationId?: string; /** * The HTTP endpoint for the OpenAI API. You probably don't want to change this. * @default https://api.openai.com/v1 */ baseUrl?: string; /** * Options to pass to the underlying fetch library (Ky). * @see https://github.com/sindresorhus/ky/tree/main#options */ kyOptions?: KyOptions; }; /** Override the default Ky options for a single request. */ type RequestOpts = { headers?: KyOptions['headers']; signal?: AbortSignal; }; export declare class OpenAIClient { private api; constructor(opts?: ConfigOpts); private getApi; /** Create a completion for a chat message. */ createChatCompletion(params: ChatParams, opts?: RequestOpts): Promise; /** Create a chat completion and stream back partial progress. */ streamChatCompletion(params: ChatStreamParams, opts?: RequestOpts): Promise; /** Create completions for an array of prompt strings. */ createCompletions(params: CompletionParams, opts?: RequestOpts): Promise; /** Create a completion for a single prompt string and stream back partial progress. */ streamCompletion(params: CompletionStreamParams, opts?: RequestOpts): Promise; /** Create an embedding vector representing the input text. */ createEmbeddings(params: EmbeddingParams, opts?: RequestOpts): Promise; /** Given some input text, outputs if the model classifies it as potentially harmful across several categories. */ createModeration(params: ModerationParams, opts?: RequestOpts): Promise; /** Generates audio from the input text. Also known as TTS. */ createSpeech(params: SpeechParams, opts?: RequestOpts): Promise; } export {};