SAP AI SDK for JavaScript - v2.15.0
    Preparing search index...

    Function createOpenAiConfig

    • Experimental

      Creates a configuration object that can be passed directly to new AzureOpenAI(config). Resolves the deployment URL and sets up token-based authentication for SAP AI Core.

      Parameters

      • options: SapOpenAiInput

        The options for creating the OpenAI configuration.

      Returns Promise<AzureClientOptions>

      A promise that resolves to an AzureClientOptions object. This function is experimental and may change at any time without prior notice.

      import { AzureOpenAI } from 'openai';
      import { createOpenAiConfig } from '@sap-ai-sdk/openai';

      const config = await createOpenAiConfig('gpt-5.4');
      const client = new AzureOpenAI(config);
      await client.chat.completions.create({
      messages: [{ role: 'user', content: 'Hello!' }]
      });