{"id":22332,"library":"sap-ai-sdk-base","title":"SAP AI SDK Base Client","description":"Core base client for SAP Cloud SDK for AI (Python), providing authentication, HTTP client, and configuration for interacting with SAP AI Core services. Current version 3.4.0, requires Python >=3.9. Released irregularly with semantic versioning.","status":"active","version":"3.4.0","language":"python","source_language":"en","source_url":"https://github.com/SAP/ai-sdk-python","tags":["sap","ai","cloud-sdk","client"],"install":[{"cmd":"pip install sap-ai-sdk-base","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import from top-level package does not work; must use subpackage.","wrong":"from sap_ai_sdk import BaseClient","symbol":"BaseClient","correct":"from sap_ai_sdk.base import BaseClient"},{"note":"AICoreDestination moved to base package in v3.x.","wrong":"from sap_ai_sdk.destination import AICoreDestination","symbol":"AICoreDestination","correct":"from sap_ai_sdk.base import AICoreDestination"}],"quickstart":{"code":"from sap_ai_sdk.base import BaseClient, AICoreDestination\nimport os\n\ndest = AICoreDestination(\n    base_url=os.environ.get('AICORE_BASE_URL', ''),\n    client_id=os.environ.get('AICORE_CLIENT_ID', ''),\n    client_secret=os.environ.get('AICORE_CLIENT_SECRET', ''),\n    auth_url=os.environ.get('AICORE_AUTH_URL', ''),\n    resource_group=os.environ.get('AICORE_RESOURCE_GROUP', 'default')\n)\nclient = BaseClient(destination=dest)\nprint(client.base_url)","lang":"python","description":"Initialize BaseClient with an AICoreDestination. Set environment variables AICORE_BASE_URL, AICORE_CLIENT_ID, AICORE_CLIENT_SECRET, AICORE_AUTH_URL."},"warnings":[{"fix":"Use async/await for all calls. Replace requests-based code with BaseClient.get/post/etc (async).","message":"v3.x removed the sync HTTP client; only async HTTPX client is used. All calls are async even if not documented.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use AICoreDestination with new keyword arguments: base_url, client_id, client_secret, auth_url, resource_group.","message":"v3.x renamed 'BaseDestination' to 'AICoreDestination' and changed its constructor parameters.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Instantiate AICoreDestination and pass it as destination parameter.","message":"Passing 'destination' as a string is deprecated in v3.3+; use AICoreDestination object.","severity":"deprecated","affected_versions":">=3.3.0, <4.0.0"},{"fix":"Explicitly set AICORE_RESOURCE_GROUP unless your AI Core instance uses the 'default' group.","message":"Environment variable 'AICORE_RESOURCE_GROUP' defaults to 'default'; if omitted, service may fail when resource group is required.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you installed 'sap-ai-sdk-base' (not 'sap-ai-sdk') and the import is 'from sap_ai_sdk.base import BaseClient'.","cause":"Package installed as sap-ai-sdk-base but import uses sap_ai_sdk.base. The package name in PyPI is 'sap-ai-sdk-base' but the import package is 'sap_ai_sdk'.","error":"ModuleNotFoundError: No module named 'sap_ai_sdk'"},{"fix":"Use AICoreDestination with correct parameters: base_url, client_id, client_secret, auth_url, resource_group.","cause":"Using older constructor arguments from v2.x. In v3.x, AICoreDestination expects 'auth_url' not 'url'.","error":"TypeError: Client.__init__() got an unexpected keyword argument 'auth_url'"},{"fix":"Uninstall 'sap-ai-sdk' and install 'sap-ai-sdk-base'. Then import 'from sap_ai_sdk.base import BaseClient'.","cause":"Trying to import from 'sap_ai_sdk.base' but the package 'sap_ai_sdk' was not installed because you installed 'sap-ai-sdk' instead of 'sap-ai-sdk-base'.","error":"AttributeError: module 'sap_ai_sdk' has no attribute 'base'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}