API Reference

REST API for programmatic access to Deliberate Lab experiment management.

Authentication

All API requests require an API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Creating an API Key

  1. Log into the Deliberate Lab web interface
  2. Navigate to Settings (top right menu)
  3. Scroll to the API Keys section
  4. Click Create New API Key
  5. Enter a descriptive name for your key
  6. Copy the generated key immediately - it will only be shown once

Important: Store your API key securely. You cannot retrieve it after closing the creation dialog.

Managing API Keys

In the Settings page API Keys section, you can:

  • View all your API keys
  • See when each key was created and last used
  • Revoke keys you no longer need

Rate Limiting

  • Limit: 100 requests per 15-minute window per API key
  • Response: HTTP 429 when exceeded

Python Client

A Python client with fully-typed Pydantic models is available:

pip install git+https://github.com/PAIR-code/deliberate-lab.git#subdirectory=scripts
import deliberate_lab as dl

client = dl.Client()  # Uses DL_API_KEY environment variable
experiments = client.list_experiments()
data = client.export_experiment("experiment-id")

API Reference