Aicore Sdk Java logo

Aicore Sdk Java

Organization
SAP
aicore-sdk-java

Generate working Java boilerplate for SAP GenAI Hub using the SAP AI SDK for Java (com.sap.ai.sdk). Covers chat completion, streaming, multi-turn conversations, prompt templates, content filtering, data masking, embeddings, RAG/grounding, prompt registry, and Spring Boot streaming. WHEN: user asks for Java or Kotlin code that calls a GenAI Hub model, wants a Java starter project, asks how to use com.sap.ai.sdk in their app, or asks how to integrate AI Core into a Spring Boot or plain Java application. DO NOT USE FOR: JavaScript/TypeScript code — use `aicore-sdk-js`.

Overview

PublisherSAP
Repositoryai-skills-library
Skill nameaicore-sdk-java
Stars
123
Forks
28
Bundled files
16
LicenseApache-2.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.

  • 16 bundled files

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

  • Open source

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

Installation

Install the Aicore Sdk Java 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.
    https://github.com/SAP/ai-skills-library/tree/main/skills/aicore-sdk-java
  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/SAP/ai-skills-library.git /tmp/ai-skills-library
mkdir -p .claude/skills
cp -r /tmp/ai-skills-library/skills/aicore-sdk-java .claude/skills/aicore-sdk-java
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Aicore Sdk Java 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 Aicore Sdk Java 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 Aicore Sdk Java 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.

Sources & Fallback

Resolve answers in this priority order:

  1. Assets (assets/ directory) — check for a matching template first and serve it directly. Assets are always available offline and contain runnable, tested code.
  2. Context7 MCP — if no asset matches, fetch live docs via Context7: resolve-library-id: SAP/ai-sdk-java, then get-library-docs. Context7 returns the most up-to-date API shapes straight from the repo. Silently fall back to step 3 if Context7 is not installed.
  3. references/SDK_JAVA.md — offline reference when Context7 is unavailable. Use this rather than guessing.

Do not fabricate class names, method signatures, or config shapes. If none of the three sources cover the question, say so and point the user to https://sap.github.io/ai-sdk/docs/java/ directly.


Rules

  1. If no deployment exists, check the SAP AI Core console or contact your admin to list or create one before generating code.
  2. Always include credential guidance in generated code comments; link to Connecting to AI Core for setup details.
  3. Use OrchestrationAiModel constants (e.g. OrchestrationAiModel.GPT_4O_MINI) — never raw model name strings.
  4. Always use OrchestrationClient as the primary client for chat, streaming, embeddings, grounding, and filtering. OpenAiClient (openai artifact) is only for direct OpenAI proxy use cases — do not recommend it for general chat.
  5. Streaming has two distinct APIs — use each correctly:
    • OrchestrationClient.streamChatCompletion() in a Spring Boot controller: always use ResponseBodyEmitter + ThreadContextExecutors.getExecutor().execute() to forward deltas. Never use SseEmitter, Thread.ofVirtual(), or expose a raw Flux from the controller.
    • Spring AI ChatModel.stream() (OrchestrationChatModel / OpenAiChatModel): this method is part of the Spring AI ChatModel interface and legitimately returns Flux<ChatResponse>. Composing the Flux directly (e.g. .doOnNext(…).blockLast()) is correct — do not replace it with ResponseBodyEmitter.
  6. Gather these details before generating code — ask only for what the user hasn't provided:
    • Use case: chat / streaming / multi-turn / embeddings / grounding / filtering?
    • Model: check the SAP AI Core console or the SAP GenAI Hub documentation for available models
    • Build tool: Maven or Gradle?
    • Framework: plain Java / Spring Boot?
  7. For SDK bugs or unexpected runtime behavior: acknowledge the issue, share only verified workarounds from the assets or reference docs, and direct the user to https://github.com/SAP/ai-sdk-java/issues. Do not speculate about SDK internals or diagnose bugs not covered by a source above.

Asset Map

Use caseTemplateDependency
Chat via OrchestrationClientassets/ChatOrchestration.javacom.sap.ai.sdk:orchestration
Streaming via OrchestrationClientassets/StreamingOrchestration.javacom.sap.ai.sdk:orchestration
Multi-turn conversationassets/MultiTurnOrchestration.javacom.sap.ai.sdk:orchestration
Text embeddingsassets/EmbeddingsOrchestration.javacom.sap.ai.sdk:orchestration
RAG / vector store groundingassets/GroundingOrchestration.javacom.sap.ai.sdk:orchestration
Prompt Registry templatesassets/PromptRegistryOrchestration.javacom.sap.ai.sdk:orchestration
Spring AI + Orchestrationassets/SpringAiOrchestration.javacom.sap.ai.sdk:orchestration
Spring AI + OpenAI clientassets/SpringAiOpenAi.javacom.sap.ai.sdk:openai
LLM batch processingassets/BatchOrchestration.javacom.sap.ai.sdk:batch + openai + core
Native OpenAI Responses APIassets/OpenAiNative.javacom.sap.ai.sdk:openai
RPT table completion (SAP RPT model)assets/RptOrchestration.javacom.sap.ai.sdk:sap-rpt
Content filtering (Azure + LlamaGuard)assets/FilteringOrchestration.javacom.sap.ai.sdk:orchestration
Data masking (DPI anonymization)assets/MaskingOrchestration.javacom.sap.ai.sdk:orchestration

Install Options

xml
<!-- Maven — orchestration only (default resource group) -->
<dependency>
    <groupId>com.sap.ai.sdk</groupId>
    <artifactId>orchestration</artifactId>
    <version>1.22.0</version>
</dependency>

<!-- Add core if using AiCoreService (custom resource groups) -->
<dependency>
    <groupId>com.sap.ai.sdk</groupId>
    <artifactId>core</artifactId>
    <version>1.22.0</version>
</dependency>
groovy
// Gradle
implementation 'com.sap.ai.sdk:orchestration:1.22.0'
// Add core if using AiCoreService (custom resource groups):
implementation 'com.sap.ai.sdk:core:1.22.0'

Check Maven Central for the latest version.


Quick Start (OrchestrationClient)

java
import com.sap.ai.sdk.orchestration.OrchestrationClient;
import com.sap.ai.sdk.orchestration.OrchestrationModuleConfig;
import com.sap.ai.sdk.orchestration.OrchestrationPrompt;
import com.sap.ai.sdk.orchestration.OrchestrationAiModel;

// Credentials auto-loaded from AICORE_SERVICE_KEY env var or VCAP_SERVICES
var client = new OrchestrationClient();

var config = new OrchestrationModuleConfig()
    .withLlmConfig(OrchestrationAiModel.GPT_4O_MINI);

var response = client.chatCompletion(
    new OrchestrationPrompt("What is SAP AI Core?"), config);

System.out.println(response.getContent());

Credential Setup

Set the AICORE_SERVICE_KEY environment variable to the JSON service key from SAP AI Core:

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

Or run aicore configure (Python CLI) to store credentials in ~/.aicore/config.json. See: https://sap.github.io/ai-sdk/docs/java/connecting-to-ai-core


Handoffs


When to Load Reference Files

TriggerAction
Use case matches an asset (chat, streaming, multi-turn, embeddings, grounding, prompt registry, Spring AI, filtering, masking)Serve the matching asset from assets/
Use case not covered by an asset (reasoning, structured output, Spring Boot streaming)Use Context7 (SAP/ai-sdk-java) for API usage patterns if available, else references/SDK_JAVA.md
Any code generationAlways verify class names and method signatures against a source above

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 Aicore Sdk Java AI skill do?

Generate working Java boilerplate for SAP GenAI Hub using the SAP AI SDK for Java (com.sap.ai.sdk). Covers chat completion, streaming, multi-turn conversations, prompt templates, content filtering, data masking, embeddings, RAG/grounding, prompt registry, and Spring Boot streaming. WHEN: user asks for Java or Kotlin code that calls a GenAI Hub model, wants a Java starter project, asks how to use com.sap.ai.sdk in their app, or asks how to integrate AI Core into a Spring Boot or plain Java application. DO NOT USE FOR: JavaScript/TypeScript code — use `aicore-sdk-js`.

Why use Aicore Sdk Java on TypingMind?

Because you install it once and use it with any model. Aicore Sdk Java 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 Aicore Sdk Java in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SAP/ai-skills-library/tree/main/skills/aicore-sdk-java. 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 Aicore Sdk Java?

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 Aicore Sdk Java?

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

Is the Aicore Sdk Java AI skill free?

Yes. It is published on GitHub by SAP under the Apache-2.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 👇