Skip to main content
Version: 0.4.0


This document describes how to authenticate with the Seaplane SDK and the built-in components such as data stores or models. In general, we recommend you store authentication secrets inside the seaplane secrets store. This allows your apps to read them from environment variables and avoids unnecessary security risks of hard-coding secrets inside your project.

General Authentication

Seaplane automatically creates environment variables and stores them inside the Seaplane secrets store for each secret defined inside your projects .env file. For example, assume you have the following .env file.


Seaplane automatically checks for an environment variable with the name SEAPLANE_API_KEY to authenticate with the Seaplane SDK.

During deployment, Seaplane creates the additional secrets as environment variables. You can load them inside your application as follows using os.getenv()
from seaplane import task
import os

def my_sql_task(context):

# load API keys from environment variables
open_ai_key = os.getenv('OPEN_AI_API_KEY')
external_key = os.getenv('MY_EXTERNAL_SERVICE')

Setting API Keys Manually

Alternatively, you can set the API key manually. Import config from the Seaplane package and call the set_api_key method inside your file as follows.


For security reasons, setting API keys manually should be avoided. We always recommend using the .env file when possible.

from seaplane import config
import os


You can set multiple keys all at once by calling the config.set_api_keys() method with an API key object. By doing so you can set the Seaplane API key and any external service API keys at the same time.

from seaplane import config

api_keys = {