Skip to content

Getting an API Key

The PAIS Portal lets you generate and revoke API keys for the inference API. Keys are personal — each researcher generates their own.

Generating a key

  1. Navigate to https://portal.pais.auckland.ac.nz
  2. Click Log in with University of Auckland and authenticate via Tuakiri
  3. On the dashboard, click Generate new API key
  4. Copy the key immediately — it is only shown once

Save your key

The Portal only displays the full key at generation time. If you lose it, revoke the old key and generate a new one.

Storing your key securely

Never hardcode API keys in scripts or notebooks. Use an environment variable:

export PAIS_API_KEY="pais-sk-..."
Add this to ~/.zshrc or ~/.bashrc to persist across sessions.

# .env
PAIS_API_KEY=pais-sk-...
PAIS_API_BASE=https://api.pais.auckland.ac.nz/v1
from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv("PAIS_API_KEY")
Install python-dotenv: pip install python-dotenv

import os
api_key = os.environ["PAIS_API_KEY"]  # set before launching Jupyter
Or use %env PAIS_API_KEY=pais-sk-... in a cell (not recommended for shared notebooks).

Revoking a key

In the Portal, find the key in the Active keys table and click Revoke. The key is invalidated immediately.

Key limits

Each user may hold up to 5 active keys at once. Keys do not expire automatically but are subject to per-key rate limits (see Rate Limits & Quotas).

Next step

Make your first API call →