/sap-cloud-sdk-ai-python
Integrates the SAP Cloud SDK for AI for Python (sap-ai-sdk-gen, formerly generative-ai-hub-sdk) into Python applications. Use when building Python apps with SAP AI Core, Generative AI Hub, or the Orchestration Service: chat completion, embeddings, streaming, LangChain
$ npx -y skills add secondsky/sap-skills --skill sap-cloud-sdk-ai-python --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/sap-cloud-sdk-ai-python
Context preview
The summary Claude sees to decide when to auto-load this skill.
Integrates the SAP Cloud SDK for AI for Python (sap-ai-sdk-gen, formerly generative-ai-hub-sdk) into Python applications. Use when building Python apps with SAP AI Core, Generative AI Hub, or the Orchestration Service: chat completion, embeddings, streaming, LangChain
SKILL.md
sap-cloud-sdk-ai-python.SKILL.mdname: sap-cloud-sdk-ai-python
description: |
Integrates the SAP Cloud SDK for AI for Python (sap-ai-sdk-gen, formerly generative-ai-hub-sdk) into Python applications. Use when building Python apps with SAP AI Core, Generative AI Hub, or the Orchestration Service: chat completion, embeddings, streaming, LangChain integration, templating, content filtering, data masking, and document grounding. Supports OpenAI GPT models, Llama, Gemini, Amazon Nova, and other foundation models via SAP BTP.
license: GPL-3.0
metadata:
maintainer: "Eduard Jiglau"
maintainer_email: "hello@sap-ai-skills.com"
website: "https://sap-ai-skills.com"
version: "2.4.1"
last_verified: "2026-06-15"
sdk_package: "sap-ai-sdk-gen 6.10.0"
package_evidence: "docs/project/package-evidence/2026-06-15.json"
documentation_source: "https://help.sap.com/doc/generative-ai-hub-sdk/CLOUD/en-US/_reference/gen_ai_hub.html"
SAP Cloud SDK for AI (Python)
> **Package rename**: The PyPI package `generative-ai-hub-sdk` is **deprecated** (v4.12.4 is the last release). > Its successor is **`sap-ai-sdk-gen`** (currently v6.10.0 per public PyPI registry evidence from 2026-06-15). Code and tutorials referencing > `generative-ai-hub-sdk` should migrate to `sap-ai-sdk-gen`; the import name remains `gen_ai_hub`.
The official Python SDK for SAP Generative AI Hub and Orchestration Service. It wraps the native SDKs of model providers (OpenAI, Amazon Bedrock, Google GenAI) and offers a harmonised LangChain integration and a full Orchestration client — all routed through SAP AI Core with unified authentication. Package freshness is registry-verified; AI Core runtime behavior and exact model availability still require target-tenant validation.
Related Skills
- **sap-ai-core**: Platform setup, deployments, resource groups, and model management in SAP AI Core
- **sap-cloud-sdk-ai**: JavaScript/TypeScript and Java equivalents of this SDK
- **sap-hana-ml**: HANA-side machine learning in Python
- **sap-dependency-security**: Pip dependency hygiene and upgrade patterns
Related external skills
If your task involves working inside Databricks (notebooks, Unity Catalog, Spark, SAP Databricks in SAP Business Data Cloud), consider installing the [Databricks agent skills plugin](https://github.com/databricks/databricks-agent-skills). Ask whether you would like help installing it — never install unprompted.
When to Use This Skill
Use this skill when:
- Building Python applications that call LLMs through SAP AI Core / Generative AI Hub
- Using the `gen_ai_hub` Python package (installed as `sap-ai-sdk-gen`)
- Integrating OpenAI, Amazon Bedrock, or Google GenAI models via SAP's proxy
- Implementing LangChain chains with SAP AI Core as the backend
- Using the Orchestration Service from Python (templating, filtering, masking, grounding)
- Migrating code from the deprecated `generative-ai-hub-sdk` to `sap-ai-sdk-gen`
- Generating embeddings through SAP AI Core
- Working with SAP RPT-1 (Relational Pretrained Transformer) for tabular predictions
Table of Contents
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Authentication](#authentication)
- [Available Modules](#available-modules)
- [Supported Models](#supported-models)
- [Core Features](#core-features)
- [Bundled Resources](#bundled-resources)
Quick Start
Native OpenAI Chat Completion
from gen_ai_hub.proxy.native.openai import chat
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is SAP BTP?"}
]
response = chat.completions.create(
model_name="gpt-4o-mini",
messages=messages
)
print(response.choices[0].message.content)Orchestration Service
from gen_ai_hub.orchestration_v2 import (
OrchestrationConfig, OrchestrationService,
ModuleConfig, PromptTemplatingModuleConfig,
Template, UserMessage, LLMModelDetails
)
config = OrchestrationConfig(
modules=ModuleConfig(
prompt_templating=PromptTemplatingModuleConfig(
prompt=Template(
template=[UserMessage(role="user", content="{{?question}}")]
),
model=LLMModelDetails(name="gpt-4o-mini")
)
)
)
service = OrchestrationService(config=config)
response = service.run(placeholder_values={"question": "What is SAP?"})
print(response.final_result.choices[0].message.content)Installation
# All providers + LangChain support
pip install "sap-ai-sdk-gen[all]"
# Default (OpenAI only, no LangChain)
pip install sap-ai-sdk-gen
# Specific providers (without LangChain)
pip install "sap-ai-sdk-gen[google, amazon]"
Authentication
The SDK reads credentials via `AICoreV2Client.from_env()`, which resolves credentials in this order:
1. **Keyword arguments** passed to `GenAIHubProxyClient(...)` 2. **Environment variables** — `AICORE_CLIENT_ID`, `AICORE_CLIENT_SECRET`, `AICORE_AUTH_URL`, `AICORE_BASE_URL`, `AICORE_RESOURCE_GROUP` 3. **Config file** — `$AICORE_HOME/config.json` (or path set by `AICORE_CONFIG`); use `AICORE_PROFILE` to select a named profile 4. **VCAP_SERVICES** — automatic on Cloud Foundry/Kyma when the AI Core service is bound
Local Development (Environment Variables)
export AICORE_CLIENT_ID="sb-..."
export AICORE_CLIENT_SECRET="..."
export AICORE_AUTH_URL="https://<tenant>.authentication.sap.hana.ondemand.com/oauth/token"
export AICORE_BASE_URL="https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com/v2"
export AICORE_RESOURCE_GROUP="default"
Config File Profile
# ~/.aicore/config.json
{
"AICORE_CLIENT_ID": "sb-...",
"AICORE_CLIENT_SECRET": "...",
"AICORE_AUTH_URL": "https://<tenant>.authentication.sap.hana.ondemand.com/oauth/token",
"AICORE_BASE_URL": "https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com/v2",
"AICORE_RESOURCE_GROUP": "default"
}For detailed auth setup and troubleshooting, see `references/getting-started-auth.md`.
#
Read more
name: sap-cloud-sdk-ai-python description: | Integrates the SAP Cloud SDK for AI for Python (sap-ai-sdk-gen, formerly generative-ai-hub-sdk) into Python applications. Use when building Python apps with SAP AI Core, Generative AI Hub, or the Orchestration Service: chat completion, embeddings, streaming, LangChain integration, templating, content filtering, data masking, and document grounding. Supports OpenAI GPT models, Llama, Gemini, Amazon Nova, and other foundation models via SAP BTP. license: GPL-3.0 metadata: maintainer: "Eduard Jiglau" maintainer_email: "hello@sap-ai-skills.com" website: "https://sap-ai-skills.com" version: "2.4.1" last_verified: "2026-06-15" sdk_package: "sap-ai-sdk-gen 6.10.0" package_evidence: "docs/project/package-evidence/2026-06-15.json" documentation_source: "https://help.sap.com/doc/generative-ai-hub-sdk/CLOUD/en-US/_reference/gen_ai_hub.html"
SAP Cloud SDK for AI (Python)
> **Package rename**: The PyPI package `generative-ai-hub-sdk` is **deprecated** (v4.12.4 is the last release). > Its successor is **`sap-ai-sdk-gen`** (currently v6.10.0 per public PyPI registry evidence from 2026-06-15). Code and tutorials referencing > `generative-ai-hub-sdk` should migrate to `sap-ai-sdk-gen`; the import name remains `gen_ai_hub`.
The official Python SDK for SAP Generative AI Hub and Orchestration Service. It wraps the native SDKs of model providers (OpenAI, Amazon Bedrock, Google GenAI) and offers a harmonised LangChain integration and a full Orchestration client — all routed through SAP AI Core with unified authentication. Package freshness is registry-verified; AI Core runtime behavior and exact model availability still require target-tenant validation.
Related Skills
- **sap-ai-core**: Platform setup, deployments, resource groups, and model management in SAP AI Core
- **sap-cloud-sdk-ai**: JavaScript/TypeScript and Java equivalents of this SDK
- **sap-hana-ml**: HANA-side machine learning in Python
- **sap-dependency-security**: Pip dependency hygiene and upgrade patterns
Related external skills
If your task involves working inside Databricks (notebooks, Unity Catalog, Spark, SAP Databricks in SAP Business Data Cloud), consider installing the [Databricks agent skills plugin](https://github.com/databricks/databricks-agent-skills). Ask whether you would like help installing it — never install unprompted.
When to Use This Skill
Use this skill when:
- Building Python applications that call LLMs through SAP AI Core / Generative AI Hub
- Using the `gen_ai_hub` Python package (installed as `sap-ai-sdk-gen`)
- Integrating OpenAI, Amazon Bedrock, or Google GenAI models via SAP's proxy
- Implementing LangChain chains with SAP AI Core as the backend
- Using the Orchestration Service from Python (templating, filtering, masking, grounding)
- Migrating code from the deprecated `generative-ai-hub-sdk` to `sap-ai-sdk-gen`
- Generating embeddings through SAP AI Core
- Working with SAP RPT-1 (Relational Pretrained Transformer) for tabular predictions
Table of Contents
- [Quick Start](#quick-start)
- [Installation](#installation)
- [Authentication](#authentication)
- [Available Modules](#available-modules)
- [Supported Models](#supported-models)
- [Core Features](#core-features)
- [Bundled Resources](#bundled-resources)
Quick Start
Native OpenAI Chat Completion
from gen_ai_hub.proxy.native.openai import chat
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is SAP BTP?"}
]
response = chat.completions.create(
model_name="gpt-4o-mini",
messages=messages
)
print(response.choices[0].message.content)Orchestration Service
from gen_ai_hub.orchestration_v2 import (
OrchestrationConfig, OrchestrationService,
ModuleConfig, PromptTemplatingModuleConfig,
Template, UserMessage, LLMModelDetails
)
config = OrchestrationConfig(
modules=ModuleConfig(
prompt_templating=PromptTemplatingModuleConfig(
prompt=Template(
template=[UserMessage(role="user", content="{{?question}}")]
),
model=LLMModelDetails(name="gpt-4o-mini")
)
)
)
service = OrchestrationService(config=config)
response = service.run(placeholder_values={"question": "What is SAP?"})
print(response.final_result.choices[0].message.content)Installation
# All providers + LangChain support pip install "sap-ai-sdk-gen[all]" # Default (OpenAI only, no LangChain) pip install sap-ai-sdk-gen # Specific providers (without LangChain) pip install "sap-ai-sdk-gen[google, amazon]"
Authentication
The SDK reads credentials via `AICoreV2Client.from_env()`, which resolves credentials in this order:
1. **Keyword arguments** passed to `GenAIHubProxyClient(...)` 2. **Environment variables** — `AICORE_CLIENT_ID`, `AICORE_CLIENT_SECRET`, `AICORE_AUTH_URL`, `AICORE_BASE_URL`, `AICORE_RESOURCE_GROUP` 3. **Config file** — `$AICORE_HOME/config.json` (or path set by `AICORE_CONFIG`); use `AICORE_PROFILE` to select a named profile 4. **VCAP_SERVICES** — automatic on Cloud Foundry/Kyma when the AI Core service is bound
Local Development (Environment Variables)
export AICORE_CLIENT_ID="sb-..." export AICORE_CLIENT_SECRET="..." export AICORE_AUTH_URL="https://<tenant>.authentication.sap.hana.ondemand.com/oauth/token" export AICORE_BASE_URL="https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com/v2" export AICORE_RESOURCE_GROUP="default"
Config File Profile
# ~/.aicore/config.json
{
"AICORE_CLIENT_ID": "sb-...",
"AICORE_CLIENT_SECRET": "...",
"AICORE_AUTH_URL": "https://<tenant>.authentication.sap.hana.ondemand.com/oauth/token",
"AICORE_BASE_URL": "https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com/v2",
"AICORE_RESOURCE_GROUP": "default"
}For detailed auth setup and troubleshooting, see `references/getting-started-auth.md`.
#
40 SAP development plugins with evidence-tracked verification SAP development plugins for AI coding assistants, with public-source or package-registry verification tracked where available.
Repo: secondsky/sap-skills
Other skills on sap-skills.
- /sap-abap-cds
Comprehensive SAP ABAP CDS (Core Data Services) reference for data modeling, view development, and semantic enrichment. Use when creating CDS views or view entities, defining data models with annotations, working with associations and cardinality, implementing input parameters,
Open skill - /sap-abap
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,
Open skill - /sap-ai-core
Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP. Use when: deploying generative AI models, building orchestration workflows with templating/filtering/grounding, implementing RAG with vector databases, managing ML training
Open skill - /sap-api-policy
Evidence-based assessment of whether an SAP API/interface usage scenario aligns with the SAP API Policy (v.4.2026a). Use whenever someone asks whether a way of calling SAP is allowed/compliant — e.g. Published API vs internal/private/"confidential" API status, "Documented Use",
Open skill - /sap-api-style
This skill provides comprehensive guidance for documenting SAP APIs following the SAP API Style Guide standards. It should be used when creating or reviewing API documentation for REST, OData, Java, JavaScript, .NET, or C/C++ APIs. The skill covers naming conventions,
Open skill - /sap-browser-automation
Use when an agent must inspect or operate an authenticated SAP web UI through an in-app Browser, Microsoft Edge CDP, or an existing Playwright client, especially when SAP SSO reuse, isolated Edge profiles, deterministic target selection, screenshots, or browser bootstrap
Open skill

