Skip to main content

Frequently Asked Questions

Is the SDK API mature and stable?​

Generally the SDK is very stable, we stay for years on a major version. We also try to have our main features in stable API and avoid generated code.

If you have to use generated code we do communicate with all AI Core services to try to avoid breaking changes but we can’t promise anything. The generated code is rarely broken and we do document breaking changes in the release notes.

How are vulnerabilities handled?​

We also regularly update our dependencies and release new versions. But you can overwrite transitive dependencies yourself in your project pom.xml, so vulnerabilities shouldn’t be an issue:

<dependencies>
<dependency>
<groupId>com.sap.ai.sdk</groupId>
<artifactId>core</artifactId> <!-- contains vulnerable-transitive-dependency -->
</dependency>
</dependencies>


<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.package.dependency</groupId>
<artifactId>vulnerable-transitive-dependency</artifactId>
<version>newer.version</version> <!-- fix the vulnerability -->
</dependency>
</dependencies>
</dependencyManagement>

Is there a rate-limit or resilience?​

Some AI Core services do have a rate limit in the hundred or thousands of requests per minute. The Orchestration service doesn’t have a hard threshold, but it might have a lower limit depending on which modules are configured for your requests. The Orchestration service should return a Retry-After header on a failing request. They also have a circuit breaker.

On the AI SDK side there is also an automatic retry and general resilience configured, we recommend to not retry too soon after a failure.

How to add a custom header to AI Core requests?​

SAP AI SDK leverages the destination concept from the SAP Cloud SDK to manage the connection to AI Core. This opens up a wide range of possibilities to customize the connection, including adding custom headers. The following shows how to add custom headers to all requests sent to AI Core.

var service = new AiCoreService();
var destination =
DefaultHttpDestination.fromDestination(service.getBaseDestination())
.header("my-header-key", "my-header-value")
.build();

// AI Core client
service = service.withBaseDestination(destination);
DeploymentApi client = new DeploymentApi(service);

For more information, please refer to the AI Core connectivity guide and the SAP Cloud SDK documentation.

There is also a convenient method to add custom headers to single calls through the orchestration or OpenAI client.

var client = new OrchestrationClient();
var config = new OrchestrationModuleConfig(OrchestrationAiModel.GPT_4O);
var template = PromptTemplate.create("Hello world!");

var result =
client
.withHeader("my-header-key", "my-header-value")
.chatCompletion()
.config(config)
.promptTemplate(template)
.execute();

For more information on this feature, see the respective documentation of the OrchestrationClient and OpenAIClient.

Can I apply a minor version update for the SAP Cloud SDK for AI dependency?​

Yes, we recommend updating to the latest version of the SAP Cloud SDK for AI. The SAP Cloud SDK for AI follows semantic versioning so minor version updates should generally be safe and backward-compatible. However, there are some exceptional cases where API changes may occur:

Internal Classes​

Internal classes are intended for use only within the SAP Cloud SDK for AI itself. Their API signatures may change without notice and are not guaranteed to be stable.

Generated Classes​

The following clients are primarily generated by the SAP Cloud SDK Generator. Their API signatures may change, for example, due to updates in the underlying specifications:

What are the minimum supported versions of common dependencies?​

The SAP AI SDK is continuously verified to build against a set of minimum supported versions for its most common consumer-facing dependencies (see the General Requirements).

The SDK is designed to be compatible with any version higher or equal to these minimal requirements. Nevertheless, we highly recommend to always use the latest versions of all dependencies.

There's a vulnerability warning CVE-2021-41251?​

This is a known false-positive finding. Depending on the tooling any product called "SAP Cloud SDK for AI" or similar with a low version number may be marked as vulnerable, incorrectly. Please consider suppressing the warning, as we do.

Are there any example projects?​

Explore example applications and code snippets: