Skip to content
Development
Skill

/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

From plugin
sap-skills
48540 skills31 agents69 commands8 MCP

Claude Code

$ npx -y skills add secondsky/sap-skills --skill sap-cloud-sdk-ai-python --agent claude-code

SKILL.md

sap-cloud-sdk-ai-python.SKILL.md
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`.

#

Read more
@secondsky
Ships withsap-skills

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.

48540 skills31 agents8 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
485
Star history of secondsky/sap-skills on GitHub, a chart by star-history.com

Other skills on sap-skills.

sap-abap-cds

sap-abap-cds

Comprehensive SAP ABAP CDS (Core Data Services) reference for data modeling, view development, and semantic enrichment. Use when…

sap-abap

sap-abap

Comprehensive ABAP development skill for SAP systems. Use when writing ABAP code, working with internal tables, structures, ABAP…

sap-ai-core

sap-ai-core

Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP. Use when: deploying…

sap-api-policy

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…

sap-api-style

sap-api-style

This skill provides comprehensive guidance for documenting SAP APIs following the SAP API Style Guide standards. It should be…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about sap-cloud-sdk-ai-python.

Which coding agents can use sap-cloud-sdk-ai-python?
sap-cloud-sdk-ai-python installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.