API Keys

API keys provide machine-to-machine access to LTprophecy without requiring a user session. They are scoped to an organization and support granular permissions.

Creating an API Key

  1. Navigate to Settings → API Keys.
  2. Click Create API Key.
  3. Provide:
    • Name — a descriptive label (e.g., CI Pipeline)
    • Permissions — select scopes from the list below
    • Expiry — optional expiration date (recommended for security)
  4. Copy the generated key immediately. It will not be shown again. The key is stored as a SHA-256 hash; LTprophecy cannot recover the plaintext.

Available Scopes

ScopeAccess
org:data:readRead datasets and quality reports
org:data:writeUpload and modify datasets
org:models:readList and inspect ML models
org:models:trainStart training runs
org:models:managePromote, archive, delete models
org:forecasts:readRead forecast results
org:forecasts:writeCreate and schedule forecasts
org:knowledge:readRead graph and scenarios
org:knowledge:writeCreate factors, links, scenarios
org:research:readRead research sessions and documents
org:research:writeStart research sessions
org:api_keys:manageCreate, rotate, and delete API keys

Using an API Key

Pass the API key in the Authorization header as a Bearer token:

curl https://api.ltprophecy.com/api/forecasts \
  -H "Authorization: Bearer ltpk_live_..."

Or using the Python SDK:

import ltprophecy

client = ltprophecy.Client(api_key="ltpk_live_...")
forecasts = client.forecasts.list()

Key Rotation

For security, rotate API keys regularly. Rotation generates a new key while immediately invalidating the old one. To rotate:

  1. Navigate to Settings → API Keys.
  2. Click the menu next to the key and select Rotate.
  3. Copy the new key and update your systems before closing the modal.

Rate Limits

API key requests are subject to the same rate limits as user sessions:

PlanRequests / minuteRequests / day
Free201,000
Growth10010,000
EnterpriseUnlimitedUnlimited

When a rate limit is exceeded, the API returns HTTP 429 Too Many Requests with a Retry-After header.

Audit Log

All API key usage is recorded in the Audit Log, including the endpoint called, HTTP method, response status, and source IP address. Access via Settings → Audit Log.