{"id":23965,"library":"lightning-sdk","title":"Lightning SDK","description":"The Lightning SDK provides programmatic access to Lightning AI Studios, enabling developers to create, manage, and interact with studios, workspaces, and apps. Version 2026.4.23 supports Python >=3.8 and is released on a monthly cadence.","status":"active","version":"2026.4.23","language":"python","source_language":"en","source_url":"https://github.com/Lightning-AI/lightning-sdk","tags":["lightning-ai","studio","sdk","machine-learning","deep-learning","cloud"],"install":[{"cmd":"pip install lightning-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core Lightning AI framework for studio operations","package":"lightning","optional":false},{"reason":"HTTP client for API calls","package":"requests","optional":false}],"imports":[{"note":"LightningClient is not in the main 'lightning' package; it is in 'lightning_sdk'.","wrong":"from lightning import LightningClient","symbol":"LightningClient","correct":"from lightning_sdk import LightningClient"},{"note":"Studio class is exported from lightning_sdk, not lightning.","wrong":"from lightning import Studio","symbol":"Studio","correct":"from lightning_sdk import Studio"}],"quickstart":{"code":"import os\nfrom lightning_sdk import LightningClient, Studio\n\n# Authenticate using API key (set as environment variable)\nclient = LightningClient(api_key=os.environ.get('LIGHTNING_API_KEY', ''))\n\n# Create a new studio\nstudio = client.create_studio(name='my-studio')\nprint(f\"Created studio: {studio.id}\")","lang":"python","description":"Initialize the Lightning client with an API key environment variable and create a studio."},"warnings":[{"fix":"Update your code: replace 'workspace_id' with 'project_id' when calling create_studio().","message":"In version 2026.4.0, the API for creating studios changed. The 'create_studio' method now requires a 'project_id' parameter instead of 'workspace_id'.","severity":"breaking","affected_versions":">=2026.4.0"},{"fix":"Use 'lightning_sdk.api.v2' or the high-level interfaces in 'lightning_sdk' directly.","message":"The 'lightning_sdk.api.v1' module is deprecated and will be removed in a future release.","severity":"deprecated","affected_versions":">=2026.1.0"},{"fix":"Ensure the environment variable is named 'LIGHTNING_API_KEY' (case-sensitive).","message":"API keys must be passed as a string to the client constructor. If you omit the api_key and have LIGHTNING_API_KEY env var set, it will be read automatically, but only if the env var is exactly 'LIGHTNING_API_KEY'.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from lightning_sdk import LightningClient'.","cause":"Trying to import LightningClient from the 'lightning' package instead of 'lightning_sdk'.","error":"ImportError: cannot import name 'LightningClient' from 'lightning'"},{"fix":"Pass 'project_id' argument to create_studio() instead of 'workspace_id'.","cause":"Using old API that passed 'workspace_id' instead of 'project_id'.","error":"TypeError: create_studio() missing 1 required positional argument: 'project_id'"},{"fix":"Check that LIGHTNING_API_KEY environment variable is set correctly or pass a valid api_key string to LightningClient.","cause":"API key is missing, expired, or malformed.","error":"lightning_sdk.exceptions.AuthenticationError: Invalid API key"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}