Skip to main content
Version: v2

JavaScript SDK Overview

Quick Start

For a quick start, check out the Getting Started section.

Why the SAP Cloud SDK for AI (SAP AI SDK)?

The SAP Cloud SDK for AI (SAP AI SDK) enables developers to seamlessly integrate AI capabilities, such as chat completion, into their JavaScript / TypeScript-based business applications using SAP Generative AI Hub. Leverage powerful features like templating, grounding, data masking, and content filtering to build intelligent applications. The SAP Cloud SDK for AI simplifies the setup and interaction with SAP AI Core, allowing you to focus on delivering value through AI integration.

Feature Matrix

Below you can find an overview of the currently available features and documentation.

Legend: ✅ - Generally Available, ❌ - Not Available, 📅 - Planned, ➖- Not Applicable

FeatureOrchestrationOrchestration with LangChainOpenAIOpenAI with LangChain
Chat Completiondocsdocsdocsdocs
Templatesdocs
Content Moderation (Filtering)docs✅ *
Data Maskingdocs✅ *
Groundingdocs
Chat Memory / Message Historydocs✅ *docs
JSON Configurationdocs
Stream Chat Completiondocsdocsdocsdocs
Multi-modal Messagesdocs
Response Formatdocsdocsdocs
Translation Servicedocs
Chat Completion: Tool Calldocs✅ *docs✅ *
Embeddingdocsdocs
note

*: The LangChain clients conform to LangChain interface. Client options are a combination of LangChain options and original client configurations. Refer to the original client and LangChain documentation for more information. Additionally, refer to the sample code in our official GitHub repository for examples.

Prerequisites

To use the SAP Cloud SDK for AI in a JavaScript / TypeScript application, it is necessary to understand the technical prerequisites and required versions for common dependencies.

  • A project using Node.js v20+ with native ESM support.
Node.js Version Recommendations

Node.js v20 is supported but approaching end-of-life (EOL).
➡️ We strongly recommend upgrading to Node.js v22 (Active LTS) or v24 (Current) for long-term support, security updates, and improved ESM/CommonJS interoperability.

If your project is still using CommonJS, you can consume ESM modules via:

Refer to Connecting to AI Core section for how to connect the SAP Cloud SDK for AI to AI Core.

Availability of Generative AI Models

For a detailed list of available models, refer to the SAP note Availability of Generative AI Models.

Deprecated Models

The following models are deprecated in SAP Cloud SDK for AI and should not be used. Replace them with the recommended alternatives.

Model NameReplacement
text-embedding-ada-002text-embedding-3-small, text-embedding-3-large
gpt-35-turbogpt-4o-mini
gpt-35-turbo-16kgpt-4o-mini
gpt-4-32kgpt-4o
gpt-4gpt-4o, gpt-4.1
gemini-1.0-progemini-2.0-flash, gemini-2.0-flash-lite
mistralai--mixtral-8x7b-instruct-v01mistralai--mistral-small-instruct
meta--llama3-70b-instruct
meta--llama3.1-70b-instruct
amazon--titan-text-express
amazon--titan-text-lite

Contribute, Support and Feedback

This project is open to feature requests/suggestions and bug reports via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.

Security / Disclosure

If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.

Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.

Licensing

Copyright 2024 SAP SE or an SAP affiliate company and ai-sdk-js contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.