Skip to content
This documentation covers the kagent 1.0 alpha. For the latest 0.x release, see the 0.x docs.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

SAP AI Core

Page as Markdown

Configure kagent to use models served through the SAP AI Core Orchestration Service.

kagent reaches SAP AI Core through its Orchestration Service, a single endpoint that serves models from several families, including Anthropic, OpenAI, Gemini, Amazon, Meta, and Mistral. Authentication uses OAuth2 client credentials from your SAP AI Core service key.

Create the ModelConfig

  1. Save the OAuth2 client credentials from your SAP AI Core service key as environment variables.

    export SAP_AI_CORE_CLIENT_ID=<your_client_id>
    export SAP_AI_CORE_CLIENT_SECRET=<your_client_secret>
  2. Create a Kubernetes Secret that stores both credentials. The Secret must contain the keys client_id and client_secret under exactly those names.

    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_SECRET

    Note

    SAP AI Core is the one provider that does not use apiKeySecretKey. kagent reads client_id and client_secret directly from the Secret that apiKeySecret names, so setting apiKeySecretKey has no effect.

  3. Create a ModelConfig that references the Secret. The endpoint, resource group, and OAuth2 token endpoint all come from your SAP AI Core service key.

    kubectl apply -f - <<EOF
    apiVersion: kagent.dev/v1alpha3
    kind: ModelConfig
    metadata:
      name: sapaicore-model-config
      namespace: kagent
    spec:
      apiKeySecret: kagent-sapaicore
      model: anthropic--claude-4.5-sonnet
      provider: SAPAICore
      sapAICore:
        baseUrl: https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com
        authUrl: https://<your-tenant>.authentication.eu10.hana.ondemand.com
        resourceGroup: default
    EOF
    FieldDescription
    apiKeySecretThe name of the Kubernetes Secret that holds client_id and client_secret.
    modelThe model to use, in the Orchestration Service naming convention, such as anthropic--claude-4.5-sonnet, gpt-5-mini, or gemini-3-pro-preview. For the full list, see the SAP AI Core models docs.
    providerThe provider to use, SAPAICore.
    sapAICore.baseUrlThe base URL for the SAP AI Core API. This field is required.
    sapAICore.authUrlThe OAuth2 token endpoint.
    sapAICore.resourceGroupThe resource group within SAP AI Core. Defaults to default.

    For every sapAICore field, including its type, default, and validation rules, see the API reference.

Use the ModelConfig

Reference the ModelConfig by name from an AgentTemplate in the same namespace.

spec:
  modelConfig:
    name: sapaicore-model-config

Next steps