Public Profiles

Install the Gradient CLI

How to install the Gradient Command Line Interface


The Gradient CLI is available on pypi and works on Windows, MacOS, and Linux.

The CLI requires Python 2.7 or Python 3.4+. Be sure to use a compatible version of pip depending on your Python version.

ProTip! We recommend installing and using the CLI within a Python virtual environment. This will minimize conflicts with existing libraries on your computer. We recommend virtualenv.

Python 2.7 Install virtualenv:

pip install virtualenv

Create new virtualenv:

virtualenv <env_directory_path>

Activate virtualenv:

source <env_directory_path>/bin/activate

Python 3.4+ Create new virtualenv:

python3 -m venv /path/to/new/virtual/environment

Activate virtualenv:

source /path/to/new/virtual/environment/bin/activate

Install the CLI

Using pip to install the latest stable release

pip install -U gradient

Using pip to install the latest prerelease

pip install -U --pre gradient

Connecting your account

You can either stash your API key on your computer or include your API key on each command.

Set your active API key


Alternative: Include your API key for each command

gradient experiments run ... --apiKey XXXXXXXXXXXXXXXXXXX

Obtaining an API key

First, sign in to your Paperspace account. On the left of your home console, you should find an 'API' section. There, you'll find a form where you can create API keys. You'll use the API keys you generate here to authenticate your requests.

API keys section of the console (