
sap-cloud-sdk-ai
Integrates SAP Cloud SDK for AI into JavaScript/TypeScript and Java applications. Use when building applications with SAP AI Core, Generative AI Hub, or Orchestration Service. Covers chat completion, embedding, streaming, function calling, content filtering, data masking, document grounding, prompt registry, and LangChain/Spring AI integration. Supports OpenAI GPT-4o, Llama, Gemini, Amazon Nova, and other foundation models via SAP BTP.
- Installs
- 688
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/secondsky/sap-skills --skill sap-cloud-sdk-ai- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads sap-cloud-sdk-ai automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
SAP Cloud SDK for AI
Related Skills
- sap-cap-capire: Use for building CAP applications that consume AI services, including event handler patterns and async LLM orchestration
- sap-ai-core: Use for AI Core platform setup, orchestration configuration, and model deployment
- sap-dependency-security: Hardening guidance for npm package upgrades, lockfile policies, and secure dependency workflows
The official SDK for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. Package versions are verified against public registries; AI Core tenant execution and exact model availability still require target-tenant validation.
When to Use This Skill
Use this skill when:
- Integrating AI/LLM capabilities into SAP BTP applications
- Building chat completion or embedding features
- Using tenant-approved OpenAI, Claude, Gemini, Amazon, Mistral, or other model families via SAP AI Core
- Implementing content filtering, data masking, or document grounding
- Creating agentic workflows with LangChain or Spring AI
- Managing prompts via Prompt Registry
- Deploying AI models on SAP AI Core
Table of Contents
- Quick Start
- Prerequisites
- Connection Setup
- Available Packages
- Supported Models
- Core Features
- Bundled Resources
Quick Start
Note: This skill uses SAP Cloud SDK for AI JavaScript v2.11.0+ and Java v1.19.0+ based on public package registry evidence from 2026-06-15. If you're migrating from v1.x, see V1 to V2 Migration Guide for breaking changes.
JavaScript/TypeScript
npm install @sap-ai-sdk/orchestration@^2
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
const client = new OrchestrationClient({
promptTemplating: {
model: { name: 'gpt-4o' },
prompt: [{ role: 'user', content: '{{?question}}' }]
}
});
const response = await client.chatCompletion({
placeholderValues: { question: 'What is SAP?' }
});
console.log(response.getContent());
Java
<dependency>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>orchestration</artifactId>
<version>${ai-sdk.version}</version>
</dependency>
var client = new OrchestrationClient();
var config = new OrchestrationModuleConfig()
.withLlmConfig(OrchestrationAiModel.GPT_4O);
var prompt = new OrchestrationPrompt("What is SAP?");
var result = client.chatCompletion(prompt, config);
System.out.println(result.getContent());
Prerequisites
- Node.js 20+ (JavaScript) or Java 17+ (Java)
- SAP AI Core service instance (extended or sap-internal plan)
- Orchestration deployment in AI Core (default resource group has this)
Connection Setup
BTP Runtime (Cloud Foundry/Kyma)
Bind AI Core service instance to your application. SDK auto-detects via VCAP_SERVICES or mounted secrets.
Local Development
Set environment variable:
export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
Or use CAP hybrid mode:
# JavaScript
cds bind -2 <AICORE_INSTANCE> && cds-tsx watch --profile hybrid
# Java
cds bind --to aicore --exec mvn spring-boot:run
For detailed connection options, see references/connecting-to-ai-core.md
Available Packages
JavaScript/TypeScript
| Package | Purpose |
|---|---|
@sap-ai-sdk/orchestration | Chat completion, filtering, grounding |
@sap-ai-sdk/foundation-models | Direct model access (OpenAI) |
@sap-ai-sdk/langchain | LangChain integration |
@sap-ai-sdk/ai-api | Deployments, artifacts, configurations |
@sap-ai-sdk/document-grounding | Pipeline, Vector, Retrieval APIs |
@sap-ai-sdk/prompt-registry | Prompt template management |
Java
| Artifact | Purpose |
|---|---|
orchestration | Chat completion, filtering, grounding |
openai (foundationmodels) | Direct OpenAI model access |
core | Base connectivity |
document-grounding | Pipeline, Vector, Retrieval APIs |
prompt-registry | Prompt template management |
Supported Models
Model IDs and versions are tenant-specific. Before copying an example into application code, list the target catalog through SAP AI Launchpad Model Library or the AI Core model-list API.
Example Families
- OpenAI: GPT-family chat, multimodal, reasoning, and embedding models where entitled
- Anthropic (AWS): Claude-family models where entitled
- Amazon: Nova/Titan-family models where entitled
- Google: Gemini-family models where entitled
- Mistral: Mistral-family models where entitled
Deprecated Models (Use Replacements)
| Deprecated | Use Instead |
|---|---|
| text-embedding-ada-002 | text-embedding-3-small/large |
| gpt-35-turbo (all variants) | gpt-4o-mini |
| gpt-4-32k | gpt-4o |
| gpt-4 (base) | gpt-4o or gpt-4.1 |
| gemini-1.0-pro | gemini-2.0-flash |
| gemini-1.5-pro/flash | gemini-2.5-flash |
| mistralai--mixtral-8x7b | mistralai--mistral-small-instruct |
Core Features
Chat Completion with Streaming
// JavaScript
const stream = client.stream({
placeholderValues: { question: 'Explain SAP CAP' }
});
for await (const chunk of stream.toContentStream()) {
process.stdout.write(chunk);
}
// Java
client.streamChatCompletion(prompt, config)
.forEach(chunk -> System.out.print(chunk.getDeltaContent()));
Function/Tool Calling
// JavaScript
const tools = [{
type: 'function',
function: {
name: 'get_weather',
parameters: { type: 'object', properties: { city: { type: 'string' } } }
}
}];
const response = await client.chatCompletion({
placeholderValues: { question: 'Weather in Berlin?' }
}, { tools });
const toolCalls = response.getToolCalls();
Content Filtering
// JavaScript
import { buildAzureContentSafetyFilter } from '@sap-ai-sdk/orchestration';
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
filtering: {
input: buildAzureContentSafetyFilter({ Hate: 'ALLOW_SAFE' }),
output: buildAzureContentSafetyFilter({ Violence: 'ALLOW_SAFE' })
}
});
Data Masking
// JavaScript
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
masking: {
masking_providers: [{
type: 'sap_data_privacy_integration',
method: 'anonymization',
entities: [{ type: 'profile-email' }, { type: 'profile-person' }]
}]
}
});
Document Grounding
// JavaScript
const client = new OrchestrationClient({
promptTemplating: { model: { name: 'gpt-4o' } },
grounding: {
grounding_input: ['{{?question}}'],
grounding_output: ['{{?context}}'],
data_repositories: [{ type: 'vector', id: 'my-repo-id' }]
}
});
CAP Integration
The SDK integrates natively with CAP event handlers. Use OrchestrationClient inside CAP service classes to add AI capabilities to your CAP services.
Service binding in MTA:
resources:
- name: my-ai-core
type: org.cloudfoundry.managed-service
parameters:
service: aicore
service-plan: extended
CAP event handler with AI:
import { OrchestrationClient } from '@sap-ai-sdk/orchestration';
import cds from '@sap/cds';
export default class AnalysisService extends cds.ApplicationService {
async init() {
const client = new OrchestrationClient({
promptTemplating: {
model: { name: 'gpt-4o' },
prompt: [
{ role: 'system', content: 'Analyze and categorize as JSON.' },
{ role: 'user', content: '{{?input}}' }
]
}
});
this.on('analyzeText', async (req) => {
const response = await client.chatCompletion({
placeholderValues: { input: req.data.text }
});
return response.getContent();
});
return super.init();
}
}
Critical: Use async processing for production LLM calls. LLM responses can take 30-60 seconds, exceeding BTP load balancer timeouts. Return 202 Accepted and process in the background:
this.on('analyzeText', async (req) => {
const entry = await INSERT.into('Results').entries({
text: req.data.text, status: 'processing'
});
cds.spawn(() => processLLM(entry.id, req.data.text, client));
return req.reply(202, { id: entry.id, status: 'processing' });
});
For the complete CAP + AI integration guide including HANA Vector types for RAG and prompt externalization, see the sap-cap-capire skill.
Response Helpers
JavaScript SDK provides helper methods:
const response = await client.chatCompletion({ placeholderValues });
response.getContent(); // Model output string
response.getTokenUsage(); // { prompt_tokens, completion_tokens, total_tokens }
response.getFinishReason(); // 'stop', 'length', 'tool_calls', etc.
response.getToolCalls(); // Array of function calls
response.getDeltaToolCalls(); // Partial tool calls (streaming)
response.getAllMessages(); // Full message history
response.getAssistantMessage(); // Assistant response only
response.getRefusal(); // Refusal message if blocked
Streaming response methods:
const stream = client.stream({ placeholderValues });
for await (const chunk of stream.toContentStream()) {
process.stdout.write(chunk);
}
// After stream ends:
stream.getFinishReason();
stream.getTokenUsage();
Advanced Topics
For detailed guidance:
- Orchestration features:
references/orchestration-guide.md - Foundation models (direct OpenAI):
references/foundation-models-guide.md - LangChain integration:
references/langchain-guide.md - Spring AI integration:
references/spring-ai-guide.md - AI Core management:
references/ai-core-api-guide.md
Bundled Resources
Reference Documentation
references/foundation-models-guide.md- Foundation models and pricingreferences/ai-core-api-guide.md- AI Core service API referencereferences/orchestration-guide.md- Orchestration service guidereferences/langchain-guide.md- LangChain.js integrationreferences/spring-ai-guide.md- Spring AI integrationreferences/agentic-workflows.md- Agentic workflow patternsreferences/connecting-to-ai-core.md- Connection setup guidereferences/error-handling.md- Error handling patternsreferences/v1-to-v2-migration.md- V1 to V2 migration guide
Version Information
| SDK | Current Version | Node/Java Requirement |
|---|---|---|
| JavaScript | 2.11.0+ | Node.js 20+ |
| Java | 1.19.0+ | Java 17+ (21 LTS recommended) |
Version evidence: docs/project/package-evidence/2026-06-15.json. This is package-registry evidence only, not live AI Core runtime evidence.
Note: Generated model classes (in ...model packages) may change in minor releases but are safe to use.
Common Errors
| Error | Cause | Solution |
|---|---|---|
| "Could not find service bindings for 'aicore'" | Missing AI Core binding | Bind AI Core service or set AICORE_SERVICE_KEY |
| "Orchestration deployment not found" | No deployment in resource group | Deploy orchestration in AI Core or use different resource group |
| Content filter violation | Input/output blocked | Adjust filter thresholds or modify content |
| Token limit exceeded | Response too long | Set max_tokens parameter |
Documentation Sources
Keep this skill updated using these sources:
- JS Docs: https://github.com/SAP/ai-sdk/tree/main/docs-js
- Java Docs: https://github.com/SAP/ai-sdk/tree/main/docs-java
- JS SDK: https://github.com/SAP/ai-sdk-js
- Java SDK: https://github.com/SAP/ai-sdk-java
- Release Notes: Check docs-js/release-notes.mdx and docs-java/release-notes.mdx
FAQ
What does the sap-cloud-sdk-ai skill do?
Integrates SAP Cloud SDK for AI into JavaScript/TypeScript and Java applications. Use when building applications with SAP AI Core, Generative AI Hub, or Orchestration Service. Covers chat completion, embedding, streaming, function calling, content filtering, data masking, document grounding, prompt registry, and LangChain/Spring AI integration. Supports OpenAI GPT-4o, Llama, Gemini, Amazon Nova, and other foundation models via SAP BTP.
How do I install sap-cloud-sdk-ai?
Run npx skills add https://github.com/secondsky/sap-skills --skill sap-cloud-sdk-ai in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sap-cloud-sdk-ai/ (personal) or .claude/skills/sap-cloud-sdk-ai/ (project).
Which AI agents can use sap-cloud-sdk-ai?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is sap-cloud-sdk-ai safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains sap-cloud-sdk-ai?
It is published by secondsky in secondsky/sap-skills. It has 688 recorded installs.
More from secondsky/sap-skills
sap-abap
secondsky/sap-skills
Comprehensive ABAP development skill for SAP systems. Use when writing ABAP code, working with internal tables, structures, ABAP SQL, object-oriented programming, RAP (RESTful Application Programming Model), CDS views, EML statements, ABAP Cloud development, string processing, dynamic programming, RTTI/RTTC, field symbols, data references, exception handling, or ABAP unit testing. Covers both classic ABAP and modern ABAP for Cloud Development patterns.
sap-fiori-tools
secondsky/sap-skills
Develops SAP Fiori applications using SAP Fiori tools extensions for VS Code and SAP Business Application Studio. Use when: generating Fiori Elements or Freestyle SAPUI5 applications, configuring Page Editor for List Report or Object Page, working with annotations and Service Modeler, setting up deployment to ABAP or Cloud Foundry, creating adaptation projects, using Guided Development, previewing with mock data or live data, configuring SAP Fiori launchpad, or using AI-powered generation with Project Accelerator/Joule. Technologies: SAP Fiori Elements, SAPUI5, OData V2/V4, CAP, SAP BTP, ABAP, Cloud Foundry, fiori-mcp-server (MCP tools for AI-assisted generation).
sap-cap-capire
secondsky/sap-skills
SAP Cloud Application Programming Model (CAP) development skill using Capire documentation. Use when: building CAP applications, defining CDS models, implementing services, working with SAP HANA/SQLite/PostgreSQL databases, deploying to SAP BTP Cloud Foundry or Kyma, implementing Fiori UIs, handling authorization, multitenancy, or messaging. Covers CDL/CQL/CSN syntax, Node.js and Java runtimes, event handlers, OData services, and CAP plugins.
sap-btp-developer-guide
secondsky/sap-skills
Develops business applications on SAP Business Technology Platform (BTP) using CAP (Node.js/Java) or ABAP Cloud. Use when: building cloud applications on SAP BTP, deploying to Cloud Foundry or Kyma runtimes, integrating with SAP HANA Cloud, implementing SAP Fiori UIs, connecting to remote SAP systems, building multitenant SaaS applications, extending SAP S/4HANA or SuccessFactors, setting up CI/CD pipelines, implementing observability, or following SAP development best practices. Keywords: SAP BTP, Business Technology Platform, CAP, Cloud Application Programming Model, ABAP Cloud, Cloud Foundry, Kyma, SAP HANA Cloud, SAP Fiori, SAPUI5, CI/CD, observability, multitenant, SaaS, SAP BTP ABAP environment, SAP Business Application Studio, SAP Cloud SDK, SAP Integration Suite, SAP Event Mesh, SAP Connectivity Service, SAP Destination Service, XSUAA, OAuth, OpenID Connect, OData, CDS, Core Data Services, ABAP CDS, ABAP RESTful Application Programming Model, RAP, ABAP development, SAP BTP deve
sap-btp-best-practices
secondsky/sap-skills
SAP BTP best practices for enterprise architecture, account management, security, and operations, with verification evidence tracked in the repository ledger. Use when planning BTP implementations, setting up account hierarchies, configuring environments, implementing authentication, designing CI/CD pipelines, establishing governance, building Platform Engineering teams, implementing failover strategies, or managing application lifecycle on SAP BTP. Keywords: SAP BTP, account hierarchy, global account, directory, subaccount, Cloud Foundry, Kyma, ABAP, SAP Identity Authentication, CI/CD, governance, Platform Engineering, failover, multi-region, SAP BTP best practices
sap-btp-connectivity
secondsky/sap-skills
SAP BTP Connectivity skill covering Destination Service, Connectivity Service, Cloud Connector, Connectivity Proxy, and Transparent Proxy for Kubernetes. Use when configuring destinations (HTTP, RFC, LDAP, MAIL, TCP), setting up cloud-to-on-premise connectivity, implementing OAuth and principal propagation, deploying connectivity proxies in Kubernetes/Kyma, troubleshooting connectivity errors (405, 407, 503), or configuring multitenancy.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available