Install the Runpod SDK
Create a Python virtual environment to install the Runpod SDK library. Virtual environments allow you to manage dependencies for different projects separately, avoiding conflicts between project requirements. To get started, install setup a virtual environment then install the Runpod SDK library.Create a Python virtual environment with venv:
Get Runpod SDK version
To ensure you’ve setup your Runpod SDK in Python, choose from one of the following methods to print the Runpod Python SDK version to your terminal.Run the following command using pip to get the Runpod SDK version.You should see something similar to the following output.
Add your API key
Setapi_key
and reference its variable in your Python application. This authenticates your requests to the Runpod platform and allows you to access the Runpod API.
It’s recommended to use environment variables to set your API key. You shouldn’t load your API key directly into your code.For these examples, the API key loads from an environment variable called
RUNPOD_API_KEY
.