Generate an API key from the Wrenn dashboard and authenticate using WRENN_API_KEY, the api_key constructor argument, or the X-API-Key HTTP header.
Every request to the Wrenn API must include a valid API key. You can provide it through an environment variable — which the SDK picks up automatically — or pass it explicitly when constructing a Capsule. API keys are scoped to your team and have the prefix wrn_.
Open the Wrenn dashboard, navigate to Settings → API Keys, and create a new key. The plaintext key is shown only once at creation time — copy it immediately and store it somewhere safe.
Never commit API keys to source control. Use environment variables, a secrets manager, or a .env file excluded from version control.
You have two options for providing credentials to the SDK.
export WRENN_API_KEY="wrn_your_api_key_here"
When WRENN_API_KEY is set, you never need to pass api_key= explicitly:
from wrenn import Capsule# Reads WRENN_API_KEY from the environmentwith Capsule(template="minimal", wait=True) as capsule: result = capsule.commands.run("echo hello") print(result.stdout)