Skip to main content
Every request the OuterProduct SDK makes is authenticated with an API key. You generate that key from the OuterProduct Console, then hand it to the SDK once via op.init(); all subsequent calls in the same process are automatically authenticated.

Get your API key

Sign in to console.outerproduct.com and navigate to API Keys. Create a new key and copy it immediately; the console will not show the full value again after you close the dialog. Set OUTERPRODUCT_API_KEY in your shell before running your script, then call op.init() with no arguments:
export OUTERPRODUCT_API_KEY="your-api-key"
import outerproduct as op

op.init()  # automatically reads OUTERPRODUCT_API_KEY
This keeps your key out of source code and works cleanly in CI, Docker, and hosted environments where secrets are injected as environment variables.

Option 2: Pass the key directly

If you manage secrets programmatically (for example, fetching them from a secrets manager at runtime), pass the key as an argument to op.init():
import outerproduct as op

op.init(api_key="your-api-key")
Never hardcode an API key as a string literal in source code that you commit to version control. Anyone with read access to your repository can use the key to make requests against your account.

When to call op.init()

Call op.init() once, at the start of your script or application, before any other OuterProduct SDK call. The initialized state is global to the process; you do not need to pass credentials to individual SDK functions.
import outerproduct as op

op.init()  # must come first

dataset = op.LocalDataset.from_csv("customers.csv").upload()
model = op.reasoning.fit(dataset, task=op.Binclass(label_column="churn")).wait()
If you call any SDK function before op.init(), the SDK raises an error indicating that the client has not been initialized.