Skip to main content

latest
Works with
It is unknown whether this package works with Node.js, Deno, Browsers, Cloudflare Workers, Bun
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score29%
Published2 years ago (0.0.1)
interface ClientOptions

Properties

optional
apiKey: string | undefined

Defaults to process.env['OPENAI_API_KEY'].

optional
organization: string | null | undefined

Defaults to process.env['OPENAI_ORG_ID'].

optional
project: string | null | undefined

Defaults to process.env['OPENAI_PROJECT_ID'].

optional
baseURL: string | null | undefined

Override the default base URL for the API, e.g., "https://api.example.com/v2/"

Defaults to process.env['OPENAI_BASE_URL'].

The maximum amount of time (in milliseconds) that the client should wait for a response from the server before timing out a single request.

Note that request timeouts are retried by default, so in a worst-case scenario you may wait much longer than this timeout before the promise succeeds or fails.

optional
httpAgent: Agent

An HTTP agent used to manage HTTP(S) connections.

If not provided, an agent will be constructed by default in the Node.js environment, otherwise no agent is used.

optional
fetch: Core.Fetch | undefined

Specify a custom fetch function implementation.

If not provided, we use node-fetch on Node.js and otherwise expect that fetch is defined globally.

The maximum number of times that the client will retry a request in case of a temporary failure, like a network error or a 5XX error from the server.

optional
defaultHeaders: Core.Headers

Default headers to include with every request to the API.

These can be removed in individual requests by explicitly setting the header to undefined or null in request options.

optional
defaultQuery: Core.DefaultQuery

Default query parameters to include with every request to the API.

These can be removed in individual requests by explicitly setting the param to undefined in request options.

By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers. Only set this option to true if you understand the risks and have appropriate mitigations in place.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@luca/openai

Import symbol

import { type ClientOptions } from "@luca/openai";
or

Import directly with a jsr specifier

import { type ClientOptions } from "jsr:@luca/openai";