Theia API Documentation v1.77.0
    Preparing search index...

    Hierarchy

    • OpenAI
      • MistralFixedOpenAI
    Index
    • API Client for interfacing with the OpenAI API.

      Parameters

      • OptionalclientOptions: ClientOptions

      Returns MistralFixedOpenAI

    _options: ClientOptions
    admin: Admin
    adminAPIKey: string | null
    apiKey: string | null
    audio: Audio
    baseURL: string
    batches: Batches

    Create large batches of API requests to run asynchronously.

    beta: Beta
    chat: Chat
    completions: Completions

    Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position.

    containers: Containers
    contentProvenanceChecks: ContentProvenanceChecks
    conversations: Conversations

    Manage conversations and conversation items.

    decisions: Decisions
    embeddings: Embeddings

    Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

    evals: Evals

    Manage and run evals in the OpenAI platform.

    fetchOptions: MergedRequestInit | undefined
    files: Files

    Files are used to upload documents that can be used with features like Assistants and Fine-tuning.

    fineTuning: FineTuning
    graders: Graders
    idempotencyHeader?: string
    images: Images

    Given a prompt and/or an input image, the model will generate a new image.

    live: Live
    logger: Logger
    logLevel: LogLevel | undefined
    maxRetries: number
    models: Models

    List and describe the various models available in the API.

    moderations: Moderations

    Given text and/or image inputs, classifies if those inputs are potentially harmful.

    organization: string | null
    project: string | null
    realtime: Realtime
    responses: Responses

    Create and manage model responses.

    safety: Safety
    skills: Skills
    timeout: number
    uploads: Uploads

    Use Uploads to upload large files in multiple parts.

    vectorStores: VectorStores
    videos: Videos

    The Sora API is scheduled to permanently shut down on September 24, 2026.

    webhooks: Webhooks
    webhookSecret: string | null
    APIConnectionError: typeof APIConnectionError
    APIConnectionTimeoutError: typeof APIConnectionTimeoutError
    APIError: typeof APIError
    APIUserAbortError: typeof APIUserAbortError
    AuthenticationError: typeof AuthenticationError
    BadRequestError: typeof BadRequestError
    ConflictError: typeof ConflictError
    DEFAULT_TIMEOUT: number
    InternalServerError: typeof InternalServerError
    InvalidWebhookSignatureError: typeof InvalidWebhookSignatureError
    NotFoundError: typeof NotFoundError
    OpenAI: typeof OpenAI
    OpenAIError: typeof OpenAIError
    PermissionDeniedError: typeof PermissionDeniedError
    RateLimitError: typeof RateLimitError
    toFile: (
        value: ToFileInput | PromiseLike<ToFileInput>,
        name?: string | null,
        options?: FilePropertyBag,
    ) => Promise<File>

    Type Declaration

      • (
            value: ToFileInput | PromiseLike<ToFileInput>,
            name?: string | null,
            options?: FilePropertyBag,
        ): Promise<File>
      • Buffers 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.

        Parameters

        • value: ToFileInput | PromiseLike<ToFileInput>

          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.

        Returns Promise<File>

        A native File containing the complete buffered input.

        If the runtime lacks a global File constructor or the input cannot be converted into file contents.

    toStreamingFile: (
        data: StreamingFileInput,
        name: string,
        options?: Pick<FilePropertyBag, "type">,
    ) => StreamingFile

    Type Declaration

      • (
            data: StreamingFileInput,
            name: string,
            options?: Pick<FilePropertyBag, "type">,
        ): StreamingFile
      • Wrap 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.

        Parameters

        • data: StreamingFileInput

          Async-iterable or readable-stream chunks containing text, binary data, or blobs.

        • name: string

          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.

        Returns StreamingFile

        If name is empty or the content type contains control characters.

    UnprocessableEntityError: typeof UnprocessableEntityError
    • Internal

      Client request headers for each new WebSocket handshake.

      Parameters

      • authHeaders: Record<string, string>
      • OptionalremovedHeaders: Set<string>

      Returns Record<string, string>

    • Internal

      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.

      Parameters

      • Optionalcapture: (apiKey: string | null) => void

      Returns Promise<boolean>

    • Returns boolean

    • Parameters

      • opts: FinalRequestOptions

      Returns Promise<NullableHeaders | undefined>

    • Parameters

      • opts: FinalRequestOptions
      • Optionalschemes: { adminAPIKeyAuth?: boolean; bearerAuth?: boolean }

      Returns Promise<NullableHeaders | undefined>

    • Parameters

      • opts: FinalRequestOptions

      Returns Promise<NullableHeaders | undefined>

    • Builds 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.

      Parameters

      • inputOptions: FinalRequestOptions
      • Optional__namedParameters: { retryCount?: number }

      Returns Promise<{ req: FinalizedRequestInit; timeout: number; url: string }>

    • Parameters

      • path: string
      • query: Record<string, unknown> | null | undefined
      • OptionaldefaultBaseURL: string

      Returns string

    • Returns string

    • Returns Record<string, string | undefined> | undefined

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Parameters

      • url: _RequestInfo
      • init: RequestInit
      • timeout: number
      • controller: AbortController
      • Optionalschemes: { adminAPIKeyAuth?: boolean; bearerAuth?: boolean }

      Returns Promise<Response>

    • Parameters

      • url: _RequestInfo
      • init: RequestInit | undefined
      • ms: number
      • controller: AbortController

      Returns Promise<Response>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Type Parameters

      • Item
      • PageClass extends AbstractPage<Item> = AbstractPage<Item>

      Parameters

      • path: string
      • Page: new (...args: any[]) => PageClass
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns PagePromise<PageClass, Item>

    • Parameters

      • status: number
      • error: Object
      • message: string | undefined
      • headers: Headers

      Returns APIError

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    post

    • post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp>

      Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Used 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.

      Parameters

      • options: RequestOptions

      Returns Promise<void>

    • Used 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.

      Parameters

      • request: RequestInit
      • __namedParameters: { options: FinalRequestOptions; url: string }

      Returns Promise<void>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Type Parameters

      • Rsp

      Parameters

      • options: PromiseOrValue<FinalRequestOptions>
      • OptionalremainingRetries: number | null

      Returns APIPromise<Rsp>

    • Type Parameters

      • Item = unknown
      • PageClass extends AbstractPage<Item> = AbstractPage<Item>

      Parameters

      • Page: new (
            ...args: [
                client: OpenAI,
                response: Response,
                body: unknown,
                options: FinalRequestOptions,
            ],
        ) => PageClass
      • options: PromiseOrValue<FinalRequestOptions>

      Returns PagePromise<PageClass, Item>

    • Parameters

      • query: object | Record<string, unknown>

      Returns string

    • Parameters

      • __namedParameters: NullableHeaders
      • Optionalschemes: { adminAPIKeyAuth?: boolean; bearerAuth?: boolean }

      Returns void

    • Create a new client instance re-using the same options given to the current client with optional overriding.

      Parameters

      • options: Partial<ClientOptions>

      Returns this