OptionalclientOptions: ClientOptionsProtected_Create large batches of API requests to run asynchronously.
Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.
Manage conversations and conversation items.
Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.
Manage and run evals in the OpenAI platform.
Files are used to upload documents that can be used with features like Assistants and Fine-tuning.
Protected OptionalidempotencyGiven a prompt and/or an input image, the model will generate a new image.
List and describe the various models available in the API.
Given text and/or image inputs, classifies if those inputs are potentially harmful.
Create and manage model responses.
Use Uploads to upload large files in multiple parts.
StaticAPIStaticAPIStaticAPIStaticAPIStaticAuthenticationStaticBadStaticConflictStaticDEFAULT_StaticInternalStaticInvalidStaticNotStaticOpenStaticOpenStaticPermissionStaticRateStatictoBuffers compatible content into a native File for an SDK upload.
Existing native File objects are returned unchanged when their effective
filename and metadata are unchanged. Renamed native files reuse the original
file contents without buffering and retain their MIME type and modification
time unless explicitly overridden. Other filenames are inferred from response
URLs or input metadata when omitted or null, falling back to unknown_file.
An explicit empty filename is preserved. Responses,
native or compatible Blob values, and compatible non-native files supply
their MIME type unless options.type provides an explicit override.
An existing file, response, binary buffer, Blob-like object, async stream of file parts, or a promise resolving to one of those values.
Optionalname: string | null
Optional filename overriding inferred metadata or an existing filename.
Optionaloptions: FilePropertyBag
Optional file metadata, including MIME type and modification time.
A native File containing the complete buffered input.
StatictoWrap a stream as an uploadable file without reading it into memory.
Unlike toFile, this helper does not create a web File, because the File constructor
must consume all of its contents up front. The stream is instead encoded lazily as multipart
form data when the request is sent.
Async-iterable or readable-stream chunks containing text, binary data, or blobs.
Non-empty logical/source filename. Ordinary uploads send only its basename; Skills uploads may preserve a validated relative path with normalized forward slashes.
Optionaloptions: Pick<FilePropertyBag, "type">
Optional MIME type for the streaming file.
StaticUnprocessableInternal
Resolves and retains a provider key, returning whether a provider was invoked.
Overrides should forward capture (or call it with their resolved key) for local credentials.
Optionalcapture: (apiKey: string | null) => voidProtectedadminProtectedauthProtectedbearerBuilds a request, resolving callback credentials when constructing authentication
headers, after any subclass request-option rewrites. Calling this method directly
also resolves credentials. Complete replacement builders own authentication and
can call this.authHeaders() to resolve headers with request-local credentials.
Optional__namedParameters: { retryCount?: number }ProtecteddefaultProtecteddefaultOptionalopts: PromiseOrValue<RequestOptions>ProtectedfetchOptionalschemes: { adminAPIKeyAuth?: boolean; bearerAuth?: boolean }Optionalopts: PromiseOrValue<RequestOptions>ProtectedmakeOptionalopts: PromiseOrValue<RequestOptions>Optionalopts: PromiseOrValue<RequestOptions>ProtectedprepareUsed as a callback for mutating the given FinalRequestOptions object.
Function-based credentials are resolved later, when building authentication
headers, including for direct buildRequest() calls. Overriding this hook
does not bypass that resolution.
ProtectedprepareUsed as a callback for mutating the given RequestInit object.
This is useful for cases where you want to add certain headers based off of
the request properties, e.g. method or url.
Optionalopts: PromiseOrValue<RequestOptions>ProtectedstringifyProtectedvalidateCreate a new client instance re-using the same options given to the current client with optional overriding.
API Client for interfacing with the OpenAI API.