client
Datalayer Client - A simple Python Client for AI engineers to work with Datalayer.
Provides authentication, runtime creation, and code execution capabilities.
class DatalayerClient(urls: Optional[datalayer_core.utils.urls.DatalayerURLs] = None, token: Optional[str] = None)
Client for Datalayer AI platform.
Provides a unified interface for authentication, runtime creation, and code execution in Datalayer environments.
Parameters
-
urls : Optional[DatalayerURLs]
Pre-configured URLs object for all Datalayer services.
-
token : Optional[str]
Authentication token (can also be set via DATALAYER_API_KEY env var).
__init__(urls: Optional[datalayer_core.utils.urls.DatalayerURLs] = None, token: Optional[str] = None)
Initialize Datalayer.
Parameters
-
urls : Optional[DatalayerURLs]
Pre-configured URLs object. If not provided, will use environment variables or defaults.
-
token : Optional[str]
Authentication token (can also be set via DATALAYER_API_KEY env var).
urls
Get the configured URLs object.
Returns
-
DatalayerURLs
The URLs configuration object.
authenticate() -> bool
Validate authentication credentials.
Returns
-
bool
True if authentication is successful.
get_profile() -> datalayer_core.models.iam.UserModel
Get the user's profile information.
Returns
-
Profile
A Profile object containing user details.
get_usage_credits() -> dict[str, typing.Any]
Get usage credits and reservations.
Returns
-
dict[str, Any]
Usage credits response.