Skip to main content
Module

x/openai/mod.ts>OpenAI

Deno build of the official Typescript library for the OpenAI API.
Extremely Popular
Go to Latest
namespace OpenAI
import { OpenAI } from "https://deno.land/x/openai@v4.38.5/mod.ts";

Type Aliases

class OpenAI
import { OpenAI } from "https://deno.land/x/openai@v4.38.5/mod.ts";

API Client for interfacing with the OpenAI API.

Constructors

new
OpenAI(unnamed 0?: ClientOptions)

API Client for interfacing with the OpenAI API.

Properties

private
_options: ClientOptions
apiKey: string
audio: API.Audio
batches: API.Batches
beta: API.Beta
chat: API.Chat
completions: API.Completions
embeddings: API.Embeddings
files: API.Files
fineTuning: API.FineTuning
images: API.Images
models: API.Models
moderations: API.Moderations
organization: string | null
project: string | null

Methods

protected
authHeaders(opts: Core.FinalRequestOptions): Core.Headers
protected
defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers
protected
defaultQuery(): Core.DefaultQuery | undefined

Static Properties

APIConnectionError
APIConnectionTimeoutError
APIError
APIUserAbortError
AuthenticationError
BadRequestError
ConflictError
fileFromPath
InternalServerError
NotFoundError
OpenAI
OpenAIError
PermissionDeniedError
RateLimitError
toFile
UnprocessableEntityError