# Class AzureOpenAiChatClient

Azure OpenAI client for chat completion.

- Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-client.d.ts:12

##### Index

### Constructors

constructor

### Methods

run
stream

## Constructors

### constructor

- new AzureOpenAiChatClient(
  modelDeployment: ModelDeployment<AzureOpenAiChatModel>,
  destination?:
  | never
  | Without<HttpDestination> & DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined }
  | Without<
  DestinationFetchOptions & {
  serviceBindingTransformFn?: ServiceBindingTransformFunction;
  } & { destinationName: string; service?: undefined },
  > & Destination & { url: string },
  ): AzureOpenAiChatClient

  Creates an instance of the Azure OpenAI chat client.

  #### Parameters

  - modelDeployment: ModelDeployment<AzureOpenAiChatModel>

    This configuration is used to retrieve a deployment. Depending on the configuration use either the given deployment ID or the model name to retrieve matching deployments. If model and deployment ID are given, the model is verified against the deployment.

  - `Optional` destination:
    | never
    | Without<HttpDestination> & DestinationFetchOptions & {
    serviceBindingTransformFn?: ServiceBindingTransformFunction;
    } & { destinationName: string; service?: undefined }
    | Without<
    DestinationFetchOptions & {
    serviceBindingTransformFn?: ServiceBindingTransformFunction;
    } & { destinationName: string; service?: undefined },
    > & Destination & { url: string }

    The destination to use for the request.

    - never
    - Without<HttpDestination> & DestinationFetchOptions & {
      serviceBindingTransformFn?: ServiceBindingTransformFunction;
      } & { destinationName: string; service?: undefined }

      - ##### `Optional` serviceBindingTransformFn?: ServiceBindingTransformFunction

        Custom transformation function to control how a Destination is built from the given Service.

      - ##### destinationName: string

        The name of the destination to retrieve from service bindings.

      - ##### `Optional` service?: undefined

    - Without<
      DestinationFetchOptions & {
      serviceBindingTransformFn?: ServiceBindingTransformFunction;
      } & { destinationName: string; service?: undefined },
      > & Destination & { url: string }

  #### Returns AzureOpenAiChatClient

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-client.d.ts:20

## Methods

### run

- run(
  request: AzureOpenAiCreateChatCompletionRequest,
  requestConfig?: CustomRequestConfig,
  ): Promise<AzureOpenAiChatCompletionResponse>

  Creates a completion for the chat messages.

  #### Parameters

  - request: AzureOpenAiCreateChatCompletionRequest

    Request containing chat completion input parameters.

  - `Optional` requestConfig: CustomRequestConfig

    The request configuration.

  #### Returns Promise<AzureOpenAiChatCompletionResponse>

  The completion result.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-client.d.ts:27

### stream

- stream(
  request: AzureOpenAiCreateChatCompletionRequest,
  signal?: AbortSignal,
  requestConfig?: CustomRequestConfig,
  ): Promise<
  AzureOpenAiChatCompletionStreamResponse<
  AzureOpenAiChatCompletionStreamChunkResponse,
  >,
  >

  Creates a completion stream for the chat messages.

  #### Parameters

  - request: AzureOpenAiCreateChatCompletionRequest

    Request containing chat completion input parameters.

  - `Optional` signal: AbortSignal

    The abort signal.

  - `Optional` requestConfig: CustomRequestConfig

    The request configuration.

  #### Returns Promise<
  AzureOpenAiChatCompletionStreamResponse<
  AzureOpenAiChatCompletionStreamChunkResponse,
  >,
  >

  A response containing the chat completion stream.

  Copyright Ⓒ 2026 SAP SE or an SAP affiliate company. All rights reserved.

  - Defined in packages/foundation-models/dist/azure-openai/azure-openai-chat-client.d.ts:35