Installation and authentication
To be able to communicate with xCloud, you will need to install the Python SDK and authenticate it.
Installation
- Pip
- Conda
pip install xcloud
conda create -n xcloud python=3.8
conda activate xcloud
conda install xcloud
Check your successful installation:
python -c "import xcloud ; print(xcloud.__version__)"
Output
0.0.2
Authentication
To begin using xCloud from the Python SDK, you'll require an API key and your default workspace. By default, all resources will be created within your default workspace, unless you specify another one.
1. Obtain Your API Key and Workspace ID
- Visit https://xcloud-app.stochastic.ai and log in to your account.
- From the left-hand menu, select "Settings."
- Click on "Credentials." You should see a display like the following:
2. Python SDK Authentication
You have two options for authenticating the Python SDK: using command-line configuration or environment variables. The former is recommended for local development and testing, while the latter is advised for production environments.
2.1. Command-Line Configuration
Follow these steps:
- Run the command
xcloud configure
. - Copy the API key from the UI and paste it when prompted.
- Copy the workspace ID from the UI and paste it when prompted.
2.2. Environment Variables
Utilize the following environment variables:
XCLOUD_API_KEY
: Your API key.XCLOUD_DEFAULT_WORKSPACE
: Your default workspace ID.