{"record":{"id":"4d783c77dd291459","repo":"BerriAI/litellm","slug":"sap-ai-core-credentials-not-found-please-provide","errorCode":null,"errorMessage":"SAP AI Core credentials not found. Please provide credentials by setting appropriate environment variables (e.g. AICORE_CLIENT_ID, AICORE_CLIENT_SECRET, etc.)","messagePattern":"SAP AI Core credentials not found\\. Please provide credentials by setting appropriate environment variables \\(e\\.g\\. AICORE_CLIENT_ID, AICORE_CLIENT_SECRET, etc\\.\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/sap/credentials.py","lineNumber":332,"sourceCode":"        client_id: OAuth2 client ID (required)\n        client_secret: OAuth2 client secret (for secret-based auth)\n        cert_str: PEM-encoded certificate string (for cert-based auth)\n        key_str: PEM-encoded private key string (for cert-based auth)\n        cert_file_path: Path to certificate file (for file-based cert auth)\n        key_file_path: Path to private key file (for file-based cert auth)\n\n    Raises:\n        ValueError: If required fields are missing or authentication mode is ambiguous.\n\n    Note:\n        - This function does NOT validate resource_group (resolved separately).\n        - Exactly one authentication method must be provided:\n          * client_secret, OR\n          * (cert_str AND key_str), OR\n          * (cert_file_path AND key_file_path)\n    \"\"\"\n    if not auth_url or not client_id or not base_url:\n        raise ValueError(\n            \"SAP AI Core credentials not found. \"\n            \"Please provide credentials by setting appropriate environment variables \"\n            \"(e.g. AICORE_CLIENT_ID, AICORE_CLIENT_SECRET, etc.)\"\n        )\n\n    modes: Final = [\n        bool(client_secret),\n        bool(cert_str) and bool(key_str),\n        bool(cert_file_path) and bool(key_file_path),\n    ]\n    if sum(bool(m) for m in modes) != 1:\n        raise ValueError(\n            \"SAP AI Core credentials are incomplete. \"\n            \"Invalid credentials: provide exactly one of client_secret, \"\n            \"(cert_str & key_str), or (cert_file_path & key_file_path).\"\n        )\n\n","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/credentials.py#L314-L350","documentation":"SAP AI Core credential validation: one of the mandatory fields (auth_url, client_id, base_url) is absent after resolution from env/config, so no valid credentials exist and a ValueError listing the AICORE_* env vars is raised.","triggerScenarios":"Triggered when SAP AI Core credentials are missing; set env vars such as AICORE_CLIENT_ID and AICORE_CLIENT_SECRET.","commonSituations":"See trigger scenarios.","solutions":["Set the SAP AI Core environment variables (AICORE_CLIENT_ID, AICORE_CLIENT_SECRET, etc.).","Or provide a credentials config file via AICORE_HOME."],"exampleFix":"export AICORE_CLIENT_ID=<id> AICORE_CLIENT_SECRET=<secret>","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}