Lesson 6 of 7
Calling the hub from code: SAP Cloud SDK for AI, CAP and ABAP
8 min
Listen to this lesson
Everything in this course can be called with plain HTTP, but SAP recommends its SDKs, and for good reason: they handle authentication, resource groups, the orchestration payload and the prompt registry for you. This lesson maps the options to Contoso's two developer communities: Theo's BTP and CAP developers, and Kenji's ABAP team.
SAP Cloud SDK for AI
SAP's documentation calls SAP Cloud SDK for AI "the official SDK for SAP AI Core, generative AI hub, and orchestration." It exists in three languages:
| Language | Packages (examples) | Typical use |
|---|---|---|
| JavaScript / TypeScript | @sap-ai-sdk/orchestration, @sap-ai-sdk/foundation-models, @sap-ai-sdk/ai-api, @sap-ai-sdk/prompt-registry, @sap-ai-sdk/document-grounding (beta), @sap-ai-sdk/langchain | CAP Node.js services, Node apps on BTP |
| Java | SAP Cloud SDK for AI for Java (Maven) | CAP Java and Spring apps |
| Python | sap-ai-sdk-base (AI API), sap-ai-sdk-core (administration and lifecycle), sap-ai-sdk-gen (models, LangChain, orchestration) | Data science, scripts, Python services |
SAP Cloud SDK for AI distributions. Package names checked on npm and PyPI in October 2026.
The orchestration client in each SDK builds the V2 request from a configuration object (template, model, masking, filtering, grounding), sends it to the orchestration deployment in the named resource group and returns a typed response. Credentials come from the SAP AI Core service binding or service key: an OAuth client that the SDK uses to obtain the bearer token. In a CAP application, the AI Core instance is bound like any other BTP service, so no secret lives in code.
Frameworks
If your team already uses an agent or LLM framework, there are bridges. SAP documents LangChain support (a LangChain package exists for JavaScript and the Python generative package integrates it), and SAP's library list names LiteLLM, an open-source library that can reach generative AI hub models. A bridge keeps your application on SAP's governed access path instead of calling providers directly.
ABAP: the ABAP AI SDK with ISLM
For ABAP developers, SAP provides the ABAP AI SDK powered by Intelligent Scenario Lifecycle Management (ISLM), which SAP describes as "the official client for consuming LLMs in ABAP." It lets ABAP code call models hosted on the generative AI hub "as easily as if they were implemented in ABAP", with reuse components for prompt completion, a prompt library, function calling and exception handling. ISLM represents each generative AI use case as an intelligent scenario, manages connectivity to the generative AI hub and the model deployment lifecycle, and offers basic prompt management. SAP documents the generative AI scenario in ISLM for SAP S/4HANA 2025, SAP S/4HANA Cloud Public Edition and the ABAP environment.
- Does the logic live in an ABAP application in SAP S/4HANA?Yes → ABAP AI SDK with ISLM · No → next question
- Is it a CAP or Node.js service on BTP?Yes → SAP Cloud SDK for AI (JavaScript) · No → next question
- Is it a Java or Spring service?Yes → SAP Cloud SDK for AI (Java)
- Is it a Python script or data-science workload?Yes → SAP Cloud SDK for AI (Python: base, core, gen)
Engineering basics still apply
- Keep prompts in the registry or Git, not scattered in code; reference templates by ID or name and version.
- Set timeouts and handle 429 and 5xx responses; use orchestration fallbacks for model outages.
- Log the template version, model, resource group and a request ID with each call, without logging personal data.
- Separate dev, test and prod: Contoso's cmc-ext-dev, cmc-ext-test and cmc-ext-prod each have their own AI Core instance and resource group.
- Test the integration with the same regression set used for prompt changes.
What would you do?
Kenji wants an ABAP report in Contoso's SAP S/4HANA system to summarize long free-text notes on core return agreements with an LLM. Which approach fits SAP's documented options?
- SAP Cloud SDK for AI (JavaScript, Java, Python) is the official SDK for AI Core, the generative AI hub and orchestration.
- CAP apps bind the AI Core instance; credentials come from the binding, not code.
- ABAP applications use the ABAP AI SDK powered by ISLM; Joule for Developers is a different product for developers.
- Log template version, model and request ID; handle 429 and 5xx; separate dev, test and prod.
Check your understanding · not graded
Lesson check
1. Which Python distribution of SAP Cloud SDK for AI provides models, LangChain integration and orchestration?
2. What does SAP call the ABAP AI SDK powered by ISLM?
3. Where should a CAP application get its SAP AI Core credentials?
4. Which JavaScript package of SAP Cloud SDK for AI did SAP mark as beta in October 2026?