Lightning SDK

raw JSON →
2026.4.23 verified Fri May 01 auth: no python

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.

pip install lightning-sdk
error ImportError: cannot import name 'LightningClient' from 'lightning'
cause Trying to import LightningClient from the 'lightning' package instead of 'lightning_sdk'.
fix
Use 'from lightning_sdk import LightningClient'.
error TypeError: create_studio() missing 1 required positional argument: 'project_id'
cause Using old API that passed 'workspace_id' instead of 'project_id'.
fix
Pass 'project_id' argument to create_studio() instead of 'workspace_id'.
error lightning_sdk.exceptions.AuthenticationError: Invalid API key
cause API key is missing, expired, or malformed.
fix
Check that LIGHTNING_API_KEY environment variable is set correctly or pass a valid api_key string to LightningClient.
breaking 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'.
fix Update your code: replace 'workspace_id' with 'project_id' when calling create_studio().
deprecated The 'lightning_sdk.api.v1' module is deprecated and will be removed in a future release.
fix Use 'lightning_sdk.api.v2' or the high-level interfaces in 'lightning_sdk' directly.
gotcha 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'.
fix Ensure the environment variable is named 'LIGHTNING_API_KEY' (case-sensitive).

Initialize the Lightning client with an API key environment variable and create a studio.

import os
from lightning_sdk import LightningClient, Studio

# Authenticate using API key (set as environment variable)
client = LightningClient(api_key=os.environ.get('LIGHTNING_API_KEY', ''))

# Create a new studio
studio = client.create_studio(name='my-studio')
print(f"Created studio: {studio.id}")