Configuring SAP AI Core#
kagent connects to SAP AI Core through its Orchestration Service, which provides a unified endpoint for models from multiple families, including Anthropic, OpenAI, Gemini, Amazon, Meta, and Mistral. Authentication uses OAuth2 client credentials from your SAP AI Core service key.
-
Create a Kubernetes Secret that stores the OAuth2 client credentials. The Secret must contain two keys,
client_idandclient_secret. Replace the placeholder values with the credentials from your SAP AI Core service key.export SAP_AI_CORE_CLIENT_ID=<your_client_id>export SAP_AI_CORE_CLIENT_SECRET=<your_client_secret>kubectl create secret generic kagent-sapaicore -n kagent \--from-literal client_id=$SAP_AI_CORE_CLIENT_ID \--from-literal client_secret=$SAP_AI_CORE_CLIENT_SECRETUnlike other providers, the
apiKeySecretKeyfield on theModelConfigis not used for SAP AI Core. The keysclient_idandclient_secretare read directly from the Secret. -
Create a
ModelConfigresource that references the Secret and specifies the SAP AI Core endpoint, resource group, and OAuth2 token endpoint. You can find these values in your SAP AI Core service key.kubectl apply -f - <<EOFapiVersion: kagent.dev/v1alpha2kind: ModelConfigmetadata:name: sapaicore-model-confignamespace: kagentspec:apiKeySecret: kagent-sapaicoremodel: anthropic--claude-4.5-sonnetprovider: SAPAICoresapAICore:baseUrl: "https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com"authUrl: "https://<your-tenant>.authentication.eu10.hana.ondemand.com"resourceGroup: "default"EOFField Required Description apiKeySecretYes Name of the secret that contains the OAuth2 client credentials. modelYes Model names follow the Orchestration Service naming convention, such as anthropic--claude-4.6-sonnet,gpt-5-mini, orgemini-3-pro-preview. For the full list of supported models, see the SAP AI Core Orchestration Service documentation.providerYes Provider name. Must be SAPAICore.sapAICore.baseUrlYes Base URL for the SAP AI Core API. sapAICore.authUrlNo OAuth2 token endpoint URL. sapAICore.resourceGroupNo Resource group in SAP AI Core. Defaults to default.
After the resource is applied, you can select the model from the Model dropdown in the UI when creating or updating agents.