{"record":{"id":"566851cb2341291c","repo":"BerriAI/litellm","slug":"sap-ai-core-credentials-are-incomplete-invalid-cr","errorCode":null,"errorMessage":"SAP AI Core credentials are incomplete. Invalid credentials: provide exactly one of client_secret, (cert_str & key_str), or (cert_file_path & key_file_path).","messagePattern":"SAP AI Core credentials are incomplete\\. Invalid credentials: provide exactly one of client_secret, \\(cert_str & key_str\\), or \\(cert_file_path & key_file_path\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/sap/credentials.py","lineNumber":344,"sourceCode":"        - 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\ndef _request_token(\n    client_id: str, auth_url: str, timeout: float, cert_pair=None, client_secret=None\n) -> tuple[str, datetime]:\n    data: Final = {\"grant_type\": \"client_credentials\", \"client_id\": client_id}\n    if client_secret:\n        data[\"client_secret\"] = client_secret\n\n    resp: httpx.Response | None = None\n    try:\n        if cert_pair:\n            with httpx.Client(cert=cert_pair) as raw_client:\n                handler = HTTPHandler(client=raw_client)","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/sap/credentials.py#L326-L362","documentation":"Ambiguous authentication mode for SAP AI Core: more (or fewer) than exactly one of client_secret, (cert_str & key_str), or (cert_file_path & key_file_path) was supplied, so the authenticator cannot pick a single token-request strategy.","triggerScenarios":"Triggered when SAP AI Core credentials are incomplete: provide exactly one of client_secret, cert_str & key_str, or cert_file_path & key_file_path.","commonSituations":"See trigger scenarios.","solutions":["Provide exactly one credential form: client_secret, or cert_str & key_str, or cert_file_path & key_file_path.","Remove the extra/mixed credential fields."],"exampleFix":"# keep only AICORE_CLIENT_SECRET, or only the cert/key pair.","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-14T00:17:10.932Z"}