Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/openai/mod.ts>OpenAI

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

Type Aliases

class OpenAI
import { OpenAI } from "https://deno.land/x/openai@v4.69.0/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
uploads: API.Uploads

Methods

protected
authHeaders(opts: Core.FinalRequestOptions): Core.Headers
protected
defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers
protected
defaultQuery(): Core.DefaultQuery | undefined
protected
stringifyQuery(query: Record<string, unknown>): string

Static Properties

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