Skip to main content
The outerproduct.init() function is the entry point for every OuterProduct session. It authenticates the SDK against the OuterProduct API and must be called before you create datasets, configure trainers, or invoke any other SDK operation. You can supply your API key either through an environment variable (recommended for production) or by passing it directly in code.

Function Signature

outerproduct.init(api_key=None)

Parameters

api_key
string
Your OuterProduct API key. If omitted, the SDK reads the key from the OUTERPRODUCT_API_KEY environment variable. Generate a key from the OuterProduct Console.

Usage

import outerproduct as op

# Reads OUTERPRODUCT_API_KEY from the environment automatically.
# Set it beforehand with: export OUTERPRODUCT_API_KEY="your-api-key"
op.init()
The environment-variable approach is strongly recommended for production workloads. It keeps credentials out of source code and avoids accidental exposure in version-control history or notebook outputs.

Setting the environment variable

Set OUTERPRODUCT_API_KEY in your shell before running your script:
export OUTERPRODUCT_API_KEY="your-api-key"
If you are using a secrets manager or a CI/CD platform, inject the variable there rather than hard-coding the key in Python.
Calling any SDK function before op.init() raises an AuthenticationError. Make sure init() is always the first call in your program.

What happens at initialization

When init() is called, the SDK:
  1. Resolves the API key from the argument or the environment variable.
  2. Validates the key format locally.
  3. Establishes an authenticated session that all subsequent SDK calls reuse.
No network round-trip is made during init() itself; the key is sent with the first API request.

Next steps

Once initialized, you are ready to load data and start training:
1

Load your data

Create a Dataset from a CSV, DataFrame, Parquet file, or NumPy array.
2

Configure a Trainer

Use Trainer.configure() to select your target column, model families, and optimization metric.
3

Run training

Call .run().wait() to submit the job and block until the trained model is returned.