Sap Cloud Sdk Ai logo

Sap Cloud Sdk Ai

Community
secondsky
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.

Overview

Publishersecondsky
Repositorysap-skills
Skill namesap-cloud-sdk-ai
Stars
445
Forks
117
Bundled files
10
LicenseGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 10 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by secondsky on GitHub. Read the source before you install it.

Installation

Install the Sap Cloud Sdk Ai AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/secondsky/sap-skills.git /tmp/sap-skills
mkdir -p .claude/skills
cp -r /tmp/sap-skills/plugins/sap-cloud-sdk-ai/skills/sap-cloud-sdk-ai .claude/skills/sap-cloud-sdk-ai
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sap Cloud Sdk Ai in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sap Cloud Sdk Ai on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sap Cloud Sdk Ai is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

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

bash
npm install @sap-ai-sdk/orchestration@^2
typescript
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

xml
<dependency>
  <groupId>com.sap.ai.sdk</groupId>
  <artifactId>orchestration</artifactId>
  <version>${ai-sdk.version}</version>
</dependency>
java
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:

bash
export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'

Or use CAP hybrid mode:

bash
# 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

PackagePurpose
@sap-ai-sdk/orchestrationChat completion, filtering, grounding
@sap-ai-sdk/foundation-modelsDirect model access (OpenAI)
@sap-ai-sdk/langchainLangChain integration
@sap-ai-sdk/ai-apiDeployments, artifacts, configurations
@sap-ai-sdk/document-groundingPipeline, Vector, Retrieval APIs
@sap-ai-sdk/prompt-registryPrompt template management

Java

ArtifactPurpose
orchestrationChat completion, filtering, grounding
openai (foundationmodels)Direct OpenAI model access
coreBase connectivity
document-groundingPipeline, Vector, Retrieval APIs
prompt-registryPrompt 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)

DeprecatedUse Instead
text-embedding-ada-002text-embedding-3-small/large
gpt-35-turbo (all variants)gpt-4o-mini
gpt-4-32kgpt-4o
gpt-4 (base)gpt-4o or gpt-4.1
gemini-1.0-progemini-2.0-flash
gemini-1.5-pro/flashgemini-2.5-flash
mistralai--mixtral-8x7bmistralai--mistral-small-instruct

Core Features

Chat Completion with Streaming

typescript
// JavaScript
const stream = client.stream({
  placeholderValues: { question: 'Explain SAP CAP' }
});

for await (const chunk of stream.toContentStream()) {
  process.stdout.write(chunk);
}
java
// Java
client.streamChatCompletion(prompt, config)
    .forEach(chunk -> System.out.print(chunk.getDeltaContent()));

Function/Tool Calling

typescript
// 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

typescript
// 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

typescript
// 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

typescript
// 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:

yaml
resources:
  - name: my-ai-core
    type: org.cloudfoundry.managed-service
    parameters:
      service: aicore
      service-plan: extended

CAP event handler with AI:

js
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:

js
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:

typescript
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:

typescript
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 pricing
  • references/ai-core-api-guide.md - AI Core service API reference
  • references/orchestration-guide.md - Orchestration service guide
  • references/langchain-guide.md - LangChain.js integration
  • references/spring-ai-guide.md - Spring AI integration
  • references/agentic-workflows.md - Agentic workflow patterns
  • references/connecting-to-ai-core.md - Connection setup guide
  • references/error-handling.md - Error handling patterns
  • references/v1-to-v2-migration.md - V1 to V2 migration guide

Version Information

SDKCurrent VersionNode/Java Requirement
JavaScript2.11.0+Node.js 20+
Java1.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

ErrorCauseSolution
"Could not find service bindings for 'aicore'"Missing AI Core bindingBind AI Core service or set AICORE_SERVICE_KEY
"Orchestration deployment not found"No deployment in resource groupDeploy orchestration in AI Core or use different resource group
Content filter violationInput/output blockedAdjust filter thresholds or modify content
Token limit exceededResponse too longSet max_tokens parameter

Documentation Sources

Keep this skill updated using these sources:

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sap Cloud Sdk Ai 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.

Why use Sap Cloud Sdk Ai on TypingMind?

Because you install it once and use it with any model. Sap Cloud Sdk Ai is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sap Cloud Sdk Ai in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/secondsky/sap-skills/tree/main/plugins/sap-cloud-sdk-ai/skills/sap-cloud-sdk-ai. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sap Cloud Sdk Ai?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sap Cloud Sdk Ai?

As many as you like. As long as a model supports skills, you can use Sap Cloud Sdk Ai with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sap Cloud Sdk Ai AI skill free?

Yes. It is published on GitHub by secondsky under the GPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇