---
id: frequently-asked-questions
title: Frequently Asked Questions
hide_title: false
hide_table_of_contents: false
sidebar_label: FAQ
description: You asked! We answered! We collected here the most frequent question about SAP Cloud SDK for Java.
keywords:
  - sap
  - cloud
  - sdk
  - ai
---

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

```java
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](https://sap.github.io/ai-sdk/docs/java/guides/connecting-to-ai-core) and the [SAP Cloud SDK documentation](https://sap.github.io/cloud-sdk/docs/java/features/connectivity/http-destinations).

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

```java
var client = new OrchestrationClient();

var result = client.withHeader("my-header-key", "my-header-value").chatCompletion(prompt, config);
```

For more information on this feature, see the respective documentation of the [OrchestrationClient](https://sap.github.io/ai-sdk/docs/java/orchestration/chat-completion#custom-headers) and [OpenAIClient](https://sap.github.io/ai-sdk/docs/java/foundation-models/openai/chat-completion#custom-headers).

### 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](https://semver.org) 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.

- [Orchestration models](https://github.com/SAP/ai-sdk-java/tree/main/orchestration/src/main/java/com/sap/ai/sdk/orchestration/model)
- [OpenAI models](https://github.com/SAP/ai-sdk-java/tree/main/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/generated/model)

#### Generated Classes

The following clients are primarily generated by the [SAP Cloud SDK Generator](https://sap.github.io/cloud-sdk/).
Their API signatures may change, for example, due to updates in the underlying specifications:

- AI Core client
  - [client classes](https://github.com/SAP/ai-sdk-java/tree/main/core/src/main/java/com/sap/ai/sdk/core/client)
  - [model classes](https://github.com/SAP/ai-sdk-java/tree/main/core/src/main/java/com/sap/ai/sdk/core/model)
- [Document Grounding client](https://github.com/SAP/ai-sdk-java/tree/main/core-services/document-grounding)
- [Prompt Registry client](https://github.com/SAP/ai-sdk-java/tree/main/core-services/prompt-registry)

### 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](https://github.com/SAP/ai-sdk-java/blob/main/.pipeline/dependency-check-suppression.xml).

### Are there any example projects?

Explore example applications and code snippets:

- [Spring Boot Application Example](https://github.com/SAP/ai-sdk-java/tree/main/sample-code/spring-app)
